Average Error: 14.0 → 2.4
Time: 5.0s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le -5.579595939232642 \cdot 10^{-117}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le 5.465027716549306 \cdot 10^{-309}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le 1.3033798898661042 \cdot 10^{+287}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array}\]

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if (/ (* (/ y z) t) t) < -5.579595939232642e-117 or 5.465027716549306e-309 < (/ (* (/ y z) t) t) < 1.3033798898661042e+287

    1. Initial program 6.2

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified8.2

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]
    3. Taylor expanded around -inf 8.9

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    4. Using strategy rm
    5. Applied associate-/l*2.6

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}}\]

    if -5.579595939232642e-117 < (/ (* (/ y z) t) t) < 5.465027716549306e-309 or 1.3033798898661042e+287 < (/ (* (/ y z) t) t)

    1. Initial program 26.8

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified2.0

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification2.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le -5.579595939232642 \cdot 10^{-117}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le 5.465027716549306 \cdot 10^{-309}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le 1.3033798898661042 \cdot 10^{+287}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019008 +o rules:numerics
(FPCore (x y z t)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1"
  (* x (/ (* (/ y z) t) t)))

Details

Time bar (total: 4.3s)Debug log

sample65.0ms

Algorithm
intervals

simplify278.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

278.0ms
(* x (/ (* (/ y z) t) t))

prune10.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.3b

localize9.0ms

Local error

Found 1 expressions with local error:

8.1b
(* y (/ x z))

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
Calls

1 calls. Slowest were:

2.0ms
(* y (/ x z))

series22.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

22.0ms
(* y (/ x z))

simplify30.0ms

Counts
7 → 18
Calls

7 calls. Slowest were:

9.0ms
(/ (* x y) z)
8.0ms
(/ (* x y) z)
5.0ms
(/ (* x y) z)

prune151.0ms

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0.0b

localize5.0ms

Local error

Found 1 expressions with local error:

7.5b
(/ (* x y) z)

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

2.0ms
(/ (* x y) z)

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

13.0ms
(/ (* x y) z)

simplify18.0ms

Counts
3 → 16
Calls

3 calls. Slowest were:

7.0ms
(/ (* x y) z)
5.0ms
(/ (* x y) z)
5.0ms
(/ (* x y) z)

prune167.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.0b

localize5.0ms

Local error

Found 1 expressions with local error:

7.5b
(/ x (/ z y))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 17
Calls

1 calls. Slowest were:

0.0ms
(/ x (/ z y))

series15.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

15.0ms
(/ x (/ z y))

simplify20.0ms

Counts
7 → 20
Calls

7 calls. Slowest were:

5.0ms
(/ (* x y) z)
5.0ms
(/ (* x y) z)
5.0ms
(/ (* x y) z)

prune191.0ms

Pruning

7 alts after pruning (5 fresh and 2 done)

Merged error: 0b

localize14.0ms

Local error

Found 1 expressions with local error:

7.6b
(* (* y x) (/ 1 z))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
1 → 20
Calls

1 calls. Slowest were:

7.0ms
(* (* y x) (/ 1 z))

series21.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

21.0ms
(* (* y x) (/ 1 z))

simplify567.0ms

Counts
10 → 23
Calls

10 calls. Slowest were:

491.0ms
(* (* (* (* y x) (* y x)) (* y x)) (* (* (/ 1 z) (/ 1 z)) (/ 1 z)))
33.0ms
(+ (log (* y x)) (log (/ 1 z)))
20.0ms
(* (* y x) (/ 1 z))

prune236.0ms

Pruning

7 alts after pruning (4 fresh and 3 done)

Merged error: 0b

regimes603.0ms

Accuracy

60.2% (2.4b remaining)

Error of 2.4b against oracle of 0.0b and baseline of 6.0b

bsearch7.0ms

end0.0ms

sample1.9s

Algorithm
intervals