Average Error: 13.9 → 1.7
Time: 4.2s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -4.672154975256748 \cdot 10^{+209}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -2.537105397623105 \cdot 10^{-218}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le -0.0:\\ \;\;\;\;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 2 regimes
  2. if (/ y z) < -4.672154975256748e+209 or -2.537105397623105e-218 < (/ y z) < -0.0

    1. Initial program 23.3

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

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

    if -4.672154975256748e+209 < (/ y z) < -2.537105397623105e-218 or -0.0 < (/ y z)

    1. Initial program 10.7

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -4.672154975256748 \cdot 10^{+209}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -2.537105397623105 \cdot 10^{-218}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le -0.0:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \end{array}\]

Reproduce

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

sample40.0ms

Algorithm
intervals
Results
315×(pre true 80)
315×(body real 80)

simplify208.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
208.0ms
(* x (/ (* (/ y z) t) t))

prune12.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.3b

localize7.0ms

Local error

Found 1 expressions with local error:

7.0b
(* y (/ x z))

rewrite1.0ms

Algorithm
rewrite-expression-head
Rules
associate-*r*
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
div-inv
*-commutative
add-exp-log
associate-*r/
add-cbrt-cube
pow1
Counts
1 → 13
Calls
1 calls:
Slowest
1.0ms
(* y (/ x z))

series13.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
12.0ms
(* y (/ x z))

simplify30.0ms

Counts
7 → 16
Calls
7 calls:
Slowest
10.0ms
(/ (* x y) z)
10.0ms
(/ (* x y) z)
5.0ms
(/ (* x y) z)
1.0ms
(/ 1 z)
1.0ms
(cbrt (/ x z))

prune116.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:

5.4b
(/ (* x y) z)

rewrite2.0ms

Algorithm
rewrite-expression-head
Rules
add-log-exp
associate-/l*
div-inv
add-cube-cbrt
add-exp-log
add-cbrt-cube
*-un-lft-identity
frac-2neg
clear-num
pow1
add-sqr-sqrt
Counts
1 → 11
Calls
1 calls:
Slowest
2.0ms
(/ (* x y) z)

series13.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
13.0ms
(/ (* x y) z)

simplify23.0ms

Counts
3 → 14
Calls
3 calls:
Slowest
9.0ms
(/ (* x y) z)
8.0ms
(/ (* x y) z)
5.0ms
(/ (* x y) z)

prune90.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0.0b

localize5.0ms

Local error

Found 1 expressions with local error:

5.2b
(/ x (/ z y))

rewrite1.0ms

Algorithm
rewrite-expression-head
Rules
associate-/r*
div-inv
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-log-exp
associate-/r/
add-exp-log
add-cbrt-cube
frac-2neg
clear-num
pow1
Counts
1 → 15
Calls
1 calls:
Slowest
0.0ms
(/ x (/ z y))

series14.0ms

Counts
1 → 3
Calls
1 calls:
Slowest
14.0ms
(/ x (/ z y))

simplify20.0ms

Counts
7 → 18
Calls
7 calls:
Slowest
5.0ms
(/ (* x y) z)
5.0ms
(/ (* x y) z)
5.0ms
(/ (* x y) z)
1.0ms
(/ 1 y)
1.0ms
(cbrt (/ z y))

prune166.0ms

Pruning

7 alts after pruning (4 fresh and 3 done)

Merged error: 0.0b

localize13.0ms

Local error

Found 2 expressions with local error:

5.0b
(/ (/ z y) x)
0.6b
(/ 1 (/ (/ z y) x))

rewrite7.0ms

Algorithm
rewrite-expression-head
Rules
associate-/l*
div-inv
add-cube-cbrt
*-un-lft-identity
associate-/r*
add-sqr-sqrt
add-exp-log
pow1
add-log-exp
add-cbrt-cube
frac-2neg
clear-num
associate-/l/
inv-pow
pow-flip
associate-/r/
rec-exp
Counts
2 → 33
Calls
2 calls:
Slowest
5.0ms
(/ (/ z y) x)
2.0ms
(/ 1 (/ (/ z y) x))

series36.0ms

Counts
2 → 6
Calls
2 calls:
Slowest
21.0ms
(/ (/ z y) x)
15.0ms
(/ 1 (/ (/ z y) x))

simplify41.0ms

Counts
13 → 39
Calls
13 calls:
Slowest
6.0ms
(sqrt (/ (/ z y) x))
5.0ms
(/ (* x y) z)
5.0ms
(/ (* x y) z)
5.0ms
(/ (* x y) z)
4.0ms
(/ (/ z y) x)

prune303.0ms

Pruning

6 alts after pruning (2 fresh and 4 done)

Merged error: 0.0b

regimes470.0ms

Accuracy

71.7% (1.6b remaining)

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

bsearch5.0ms

end0.0ms

sample1.8s

Algorithm
intervals
Results
9609×(pre true 80)
9609×(body real 80)