Average Error: 14.5 → 0.4
Time: 8.2s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -4.868209975303927 \cdot 10^{-240}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 3.3270316362416 \cdot 10^{-317}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 5.18146444823841 \cdot 10^{+203}:\\ \;\;\;\;\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 3 regimes
  2. if (/ y z) < -inf.0

    1. Initial program 60.0

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

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

    if -inf.0 < (/ y z) < -4.868209975303927e-240 or 3.3270316362416e-317 < (/ y z) < 5.18146444823841e+203

    1. Initial program 9.6

      \[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*0.4

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

    if -4.868209975303927e-240 < (/ y z) < 3.3270316362416e-317 or 5.18146444823841e+203 < (/ y z)

    1. Initial program 24.0

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} = -\infty:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -4.868209975303927 \cdot 10^{-240}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 3.3270316362416 \cdot 10^{-317}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 5.18146444823841 \cdot 10^{+203}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \end{array}\]

Reproduce

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

sample52.0ms

Algorithm
intervals
Results
37.0ms300×body80valid

simplify299.0ms

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

prune10.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.8b

localize6.0ms

Local error

Found 1 expressions with local error:

5.2b
(* 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))

simplify19.0ms

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

prune168.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0.0b

localize10.0ms

Local error

Found 4 expressions with local error:

13.4b
(cbrt (/ x z))
13.4b
(cbrt (/ x z))
13.4b
(cbrt (/ x z))
2.2b
(* y (* (cbrt (/ x z)) (cbrt (/ x z))))

rewrite11.0ms

Algorithm
rewrite-expression-head
Rules
12×cbrt-prod
add-cube-cbrt
*-un-lft-identity
cbrt-div
add-sqr-sqrt
add-log-exp
add-exp-log
associate-*r/
add-cbrt-cube
pow1
div-inv
pow1/3
*-commutative
associate-*l/
associate-*r*
frac-times
Counts
4 → 51
Calls
4 calls:
Slowest
9.0ms
(* y (* (cbrt (/ x z)) (cbrt (/ x z))))
1.0ms
(cbrt (/ x z))
0.0ms
(cbrt (/ x z))
0.0ms
(cbrt (/ x z))

series296.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
80.0ms
(* y (* (cbrt (/ x z)) (cbrt (/ x z))))
79.0ms
(cbrt (/ x z))
78.0ms
(cbrt (/ x z))
58.0ms
(cbrt (/ x z))

simplify1.6s

Counts
31 → 63
Calls
31 calls:
Slowest
326.0ms
(* (exp (* 1/3 (- (* 2 (log (/ -1 z))) (* 2 (log (/ -1 x)))))) y)
200.0ms
(* y (exp (* 1/3 (- (* 2 (log x)) (* 2 (log z))))))
166.0ms
(exp (* 1/3 (- (log (/ 1 z)) (log (/ 1 x)))))
164.0ms
(exp (* 1/3 (- (log (/ 1 z)) (log (/ 1 x)))))
155.0ms
(* y (exp (* 1/3 (- (* 2 (log (/ 1 z))) (* 2 (log (/ 1 x)))))))

prune641.0ms

Pruning

7 alts after pruning (5 fresh and 2 done)

Merged error: 0.0b

localize24.0ms

Local error

Found 4 expressions with local error:

13.4b
(cbrt (/ x z))
13.4b
(cbrt (/ x z))
2.2b
(* y (* (cbrt (/ x z)) (* (cbrt x) (cbrt (/ 1 z)))))
0.6b
(cbrt (/ 1 z))

rewrite29.0ms

Algorithm
rewrite-expression-head
Rules
12×cbrt-prod
add-cube-cbrt
*-un-lft-identity
cbrt-div
add-sqr-sqrt
associate-*r/
add-log-exp
add-exp-log
add-cbrt-cube
pow1
div-inv
pow1/3
*-commutative
associate-*l/
associate-*r*
frac-times
Counts
4 → 51
Calls
4 calls:
Slowest
26.0ms
(* y (* (cbrt (/ x z)) (* (cbrt x) (cbrt (/ 1 z)))))
1.0ms
(cbrt (/ x z))
1.0ms
(cbrt (/ 1 z))
1.0ms
(cbrt (/ x z))

series519.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
294.0ms
(cbrt (/ 1 z))
98.0ms
(* y (* (cbrt (/ x z)) (* (cbrt x) (cbrt (/ 1 z)))))
66.0ms
(cbrt (/ x z))
61.0ms
(cbrt (/ x z))

simplify1.3s

Counts
31 → 63
Calls
31 calls:
Slowest
317.0ms
(* (pow (cbrt -1) 2) (* (exp (* 1/3 (- (* 2 (log (/ -1 z))) (* 2 (log (/ -1 x)))))) y))
192.0ms
(* y (exp (* 1/3 (- (* 2 (log (/ 1 z))) (* 2 (log (/ 1 x)))))))
178.0ms
(exp (* 1/3 (- (log (/ 1 z)) (log (/ 1 x)))))
130.0ms
(* y (exp (* 1/3 (- (* 2 (log x)) (* 2 (log z))))))
126.0ms
(exp (* 1/3 (- (log (/ 1 z)) (log (/ 1 x)))))

prune682.0ms

Pruning

7 alts after pruning (4 fresh and 3 done)

Merged error: 0.0b

localize10.0ms

Local error

Found 1 expressions with local error:

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

series21.0ms

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

simplify32.0ms

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

prune112.0ms

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0b

regimes500.0ms

Accuracy

94.2% (0.4b remaining)

Error of 0.4b against oracle of 0.0b and baseline of 6.1b

bsearch11.0ms

end0.0ms

sample1.2s

Algorithm
intervals
Results
957.0ms9555×body80valid