Average Error: 14.1 → 5.8
Time: 6.3s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -2.4167143474665745 \cdot 10^{-201}:\\ \;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \le 3.9387554926515795 \cdot 10^{-199}:\\ \;\;\;\;x \cdot \left(\frac{1}{z} \cdot y\right)\\ \mathbf{elif}\;y \le 9.86503952705176 \cdot 10^{+94}:\\ \;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \le 1.2026216740967171 \cdot 10^{+290}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{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 4 regimes
  2. if y < -2.4167143474665745e-201 or 3.9387554926515795e-199 < y < 9.86503952705176e+94

    1. Initial program 13.9

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Initial simplification4.7

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    4. Using strategy rm
    5. Applied div-inv5.0

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{z}}\]

    if -2.4167143474665745e-201 < y < 3.9387554926515795e-199

    1. Initial program 12.6

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Initial simplification7.8

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    4. Using strategy rm
    5. Applied div-inv7.9

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{z}}\]
    6. Using strategy rm
    7. Applied associate-*l*6.7

      \[\leadsto \color{blue}{x \cdot \left(y \cdot \frac{1}{z}\right)}\]

    if 9.86503952705176e+94 < y < 1.2026216740967171e+290

    1. Initial program 17.4

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Initial simplification8.5

      \[\leadsto y \cdot \frac{x}{z}\]

    if 1.2026216740967171e+290 < y

    1. Initial program 24.4

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -2.4167143474665745 \cdot 10^{-201}:\\ \;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \le 3.9387554926515795 \cdot 10^{-199}:\\ \;\;\;\;x \cdot \left(\frac{1}{z} \cdot y\right)\\ \mathbf{elif}\;y \le 9.86503952705176 \cdot 10^{+94}:\\ \;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;y \le 1.2026216740967171 \cdot 10^{+290}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]

Reproduce

herbie shell --seed 2018365 
(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: 2.7s)Debug log

start87.0ms

Algorithm
intervals

setup347.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 1.1b

localize14.0ms

Local error

Found 1 expressions with local error:

6.3b
(* y (/ x z))

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

2.0ms
(* y (/ x z))

series20.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

20.0ms
(* y (/ x z))

simplify30.0ms

Counts
7 → 16
Calls

7 calls. Slowest were:

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

prune186.0ms

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0.0b

localize10.0ms

Local error

Found 1 expressions with local error:

5.9b
(/ (* x y) z)

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
1 → 11
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)

simplify25.0ms

Counts
3 → 14
Calls

3 calls. Slowest were:

11.0ms
(/ (* x y) z)
7.0ms
(/ (* x y) z)
6.0ms
(/ (* x y) z)

prune128.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 1 expressions with local error:

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

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
1 → 18
Calls

1 calls. Slowest were:

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

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify551.0ms

Counts
10 → 21
Calls

10 calls. Slowest were:

454.0ms
(* (* (* (* x y) (* x y)) (* x y)) (* (* (/ 1 z) (/ 1 z)) (/ 1 z)))
43.0ms
(+ (log (* x y)) (log (/ 1 z)))
26.0ms
(* (* x y) (/ 1 z))

prune226.0ms

Pruning

7 alts after pruning (5 fresh and 2 done)

Merged error: 0.0b

localize7.0ms

Local error

Found 2 expressions with local error:

5.9b
(/ z (* x y))
0.6b
(/ 1 (/ z (* x y)))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
2 → 29
Calls

2 calls. Slowest were:

1.0ms
(/ 1 (/ z (* x y)))
0.0ms
(/ z (* x y))

series37.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

23.0ms
(/ 1 (/ z (* x y)))
14.0ms
(/ z (* x y))

simplify54.0ms

Counts
12 → 35
Calls

12 calls. Slowest were:

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

prune305.0ms

Pruning

7 alts after pruning (4 fresh and 3 done)

Merged error: 0.0b

regimes318.0ms

Accuracy

6.9% (5.8b remaining)

Error of 5.8b against oracle of 0.0b and baseline of 6.3b

bsearch293.0ms