Average Error: 13.9 → 2.5
Time: 9.8s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -9.366595038322077 \cdot 10^{+241}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.0920028912698875 \cdot 10^{-17}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 1.1709972192635315 \cdot 10^{-251}:\\ \;\;\;\;\frac{x \cdot y}{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 2 regimes
  2. if (/ y z) < -9.366595038322077e+241 or -1.0920028912698875e-17 < (/ y z) < 1.1709972192635315e-251

    1. Initial program 16.7

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

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

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

    if -9.366595038322077e+241 < (/ y z) < -1.0920028912698875e-17 or 1.1709972192635315e-251 < (/ y z)

    1. Initial program 11.8

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -9.366595038322077 \cdot 10^{+241}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.0920028912698875 \cdot 10^{-17}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 1.1709972192635315 \cdot 10^{-251}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]

Reproduce

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

start101.0ms

Algorithm
intervals

setup324.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 1.4b

localize10.0ms

Local error

Found 1 expressions with local error:

7.1b
(/ y (/ z x))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
Calls

1 calls. Slowest were:

0.0ms
(/ y (/ z x))

series14.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

14.0ms
(/ y (/ z x))

simplify27.0ms

Counts
7 → 18
Calls

7 calls. Slowest were:

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

prune176.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 1 expressions with local error:

5.8b
(/ (* x y) z)

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
1 → 11
Calls

1 calls. Slowest were:

4.0ms
(/ (* x y) z)

series20.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

20.0ms
(/ (* x y) z)

simplify18.0ms

Counts
3 → 14
Calls

3 calls. Slowest were:

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

prune110.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0b

localize15.0ms

Local error

Found 1 expressions with local error:

6.2b
(/ (/ y z) (/ 1 x))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
1 → 38
Calls

1 calls. Slowest were:

6.0ms
(/ (/ y z) (/ 1 x))

series17.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

17.0ms
(/ (/ y z) (/ 1 x))

simplify713.0ms

Counts
43 → 41
Calls

43 calls. Slowest were:

377.0ms
(/ (* (* (/ y z) (/ y z)) (/ y z)) (* (* (/ 1 x) (/ 1 x)) (/ 1 x)))
26.0ms
(- (log (/ y z)) (log (/ 1 x)))
25.0ms
(/ (/ 1 z) (/ 1 x))

prune397.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0b

localize16.0ms

Local error

Found 4 expressions with local error:

5.6b
(* (/ y (* (cbrt (/ 1 x)) (cbrt (/ 1 x)))) (/ (/ 1 z) (cbrt (/ 1 x))))
0.6b
(cbrt (/ 1 x))
0.6b
(cbrt (/ 1 x))
0.6b
(cbrt (/ 1 x))

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
4 → 95
Calls

4 calls. Slowest were:

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

series842.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

289.0ms
(cbrt (/ 1 x))
260.0ms
(cbrt (/ 1 x))
237.0ms
(cbrt (/ 1 x))
55.0ms
(* (/ y (* (cbrt (/ 1 x)) (cbrt (/ 1 x)))) (/ (/ 1 z) (cbrt (/ 1 x))))

simplify2.0s

Counts
74 → 107
Calls

74 calls. Slowest were:

512.0ms
(+ (log (/ y (* (cbrt (/ 1 x)) (cbrt (/ 1 x))))) (- (log (/ 1 z)) (log (cbrt (/ 1 x)))))
454.0ms
(* (/ y (* (cbrt (/ 1 x)) (cbrt (/ 1 x)))) (/ (/ 1 z) (cbrt (/ 1 x))))
402.0ms
(+ (log (/ y (* (cbrt (/ 1 x)) (cbrt (/ 1 x))))) (log (/ (/ 1 z) (cbrt (/ 1 x)))))

prune1.3s

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0b

regimes339.0ms

Accuracy

56.1% (2.5b remaining)

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

bsearch5.0ms