Skip to content

Commit 1d68030

Browse files
committed
Merge branch 'main' into minor-2.0
2 parents c8b8b10 + 578f711 commit 1d68030

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+748
-698
lines changed

src/float.rkt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
ulp-difference ulps->bits
99
midpoint random-generate
1010
</total <=/total
11-
value->string value->json
11+
value->string value->json json->value
1212
real->repr repr->real)
1313

1414
(define (ulp-difference x y repr)
@@ -62,6 +62,20 @@
6262
[_ (hash 'type (~a (representation-name repr))
6363
'ordinal (~a ((representation-repr->ordinal repr) x)))]))
6464

65+
(define (json->value x repr)
66+
(match x
67+
[(? real?) x]
68+
[(? hash?)
69+
(match (hash-ref x 'type)
70+
["real"
71+
(match (hash-ref x 'value)
72+
["-inf" -inf.0]
73+
["+inf" +inf.0]
74+
["NaN" +nan.0]
75+
[_ +nan.0])]
76+
[_ ((representation-ordinal->repr repr)
77+
(string->number (hash-ref x 'ordinal)))])]))
78+
6579
(define (value->string n repr)
6680
;; Prints a number with relatively few digits
6781
(define ->bf (representation-repr->bf repr))

src/points.rkt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@
9191
(define-values (pts exs)
9292
(for/lists (pts exs) ([entry (in-list json)])
9393
(match-define (list pt ex) entry)
94-
(values (map real->repr pt var-reprs) (real->repr ex output-repr))))
94+
(values (map real->repr pt var-reprs) (real->repr (json->value ex output-repr) output-repr))))
9595
(mk-pcontext pts exs))
9696

97-
(define (pcontext->json pcontext)
97+
(define (pcontext->json pcontext repr)
9898
(for/list ([(pt ex) (in-pcontext pcontext)])
99-
(list pt ex)))
99+
(list (map (curryr value->json repr) pt) (value->json ex repr))))

src/web/demo.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@
368368
(define pctx (job-result-backend result))
369369

370370
(eprintf " complete\n")
371-
(hasheq 'points (pcontext->json pctx)))))
371+
(hasheq 'points (pcontext->json pctx (context-repr (test-context test)))))))
372372

373373
(define analyze-endpoint
374374
(post-with-json-response

www/doc.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,18 @@ <h2>Tutorials</h2>
3333
<h2>Documentation</h2>
3434

3535
<ul>
36-
<li><a href="doc/latest/faq.html">FAQ</a>: troubleshooting Herbie.</li>
37-
<li><a href="doc/latest/release-notes.html">Release Notes</a>: the biggest and latest changes to Herbie.</li>
3836
<li><a href="doc/latest/input.html">Input format</a>: what sorts of expressions Herbie supports.</li>
3937
<li><a href="doc/latest/options.html">Command-line flags</a>: modifying Herbie's behavior.</li>
38+
<li><a href="doc/latest/error.html">What is error?</a>: how Herbie measures floating-point error.</li>
39+
<li><a href="doc/latest/faq.html">FAQ</a>: troubleshooting Herbie.</li>
40+
<li><a href="doc/latest/release-notes.html">Release Notes</a>: the biggest and latest changes to Herbie.</li>
41+
</ul>
42+
43+
<h2>Internal Documentation</h2>
44+
<ul>
4045
<li><a href="doc/latest/plugins.html">Plugins</a>: teaching Herbie about new input formats.</li>
41-
<li><a href="doc/latest/diagrams.html">Diagrams</a>: miscellaneous figures related to Herbie</li>
4246
<li><a href="doc/latest/api-endpoints.html">HTTP API</a>: Herbie's HTTP endpoints</li>
47+
<li><a href="doc/latest/diagrams.html">Diagrams</a>: miscellaneous figures related to Herbie</li>
4348
</ul>
4449

4550
<h2>Blog posts about Herbie</h2>

www/doc/1.7/report.html

Lines changed: 0 additions & 198 deletions
This file was deleted.

0 commit comments

Comments
 (0)