Average Error: 14.2 → 1.5
Time: 3.8s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -3.0606422525398804 \cdot 10^{-200}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 4.4236070957955074 \cdot 10^{-228}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 6.0163287876914765 \cdot 10^{+292}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \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) < -3.0606422525398804e-200 or 4.4236070957955074e-228 < (/ y z) < 6.0163287876914765e+292

    1. Initial program 11.4

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

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

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

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

    if -3.0606422525398804e-200 < (/ y z) < 4.4236070957955074e-228 or 6.0163287876914765e+292 < (/ y z)

    1. Initial program 21.1

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

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

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

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}}\]
    6. Taylor expanded around -inf 0.5

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -3.0606422525398804 \cdot 10^{-200}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 4.4236070957955074 \cdot 10^{-228}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 6.0163287876914765 \cdot 10^{+292}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]

Reproduce

herbie shell --seed 2019010 
(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.2s)Debug log

sample61.0ms

Algorithm
intervals

simplify356.0ms

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

prune17.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 1.1b

localize12.0ms

Local error

Found 1 expressions with local error:

6.1b
(* y (/ x z))

rewrite2.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))

series19.0ms

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

simplify36.0ms

Counts
7 → 16
Calls
7 calls:
Slowest
13.0ms
(/ (* x y) z)
8.0ms
(/ (* x y) z)
8.0ms
(/ (* x y) z)
2.0ms
(/ 1 z)
1.0ms
(cbrt (/ x z))

prune156.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 1 expressions with local error:

5.1b
(/ (* x y) z)

rewrite4.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
4.0ms
(/ (* x y) z)

series20.0ms

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

simplify26.0ms

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

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

4.3b
(/ 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))

simplify19.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))

prune108.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0.0b

localize6.0ms

Local error

Found 2 expressions with local error:

4.1b
(/ (/ z y) x)
1.0b
(/ 1 (/ (/ z y) x))

rewrite4.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
2.0ms
(/ (/ z y) x)
1.0ms
(/ 1 (/ (/ z y) x))

series41.0ms

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

simplify40.0ms

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

prune341.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0.0b

regimes358.0ms

Accuracy

74.3% (1.5b remaining)

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

bsearch6.0ms

end0.0ms

sample1.4s

Algorithm
intervals