Average Error: 13.9 → 2.5
Time: 9.6s
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 +o rules:numerics
(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.3s)Debug log

start76.0ms

Algorithm
intervals

setup305.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 1.4b

localize14.0ms

Local error

Found 1 expressions with local error:

7.1b
(/ y (/ z x))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 17
Calls

1 calls. Slowest were:

1.0ms
(/ y (/ z x))

series23.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

23.0ms
(/ y (/ z x))

simplify40.0ms

Counts
7 → 20
Calls

7 calls. Slowest were:

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

prune207.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.0b

localize6.0ms

Local error

Found 1 expressions with local error:

5.8b
(/ (* x y) z)

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

3.0ms
(/ (* x y) z)

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

13.0ms
(/ (* x y) z)

simplify30.0ms

Counts
3 → 16
Calls

3 calls. Slowest were:

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

prune186.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0b

localize17.0ms

Local error

Found 1 expressions with local error:

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

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
1 → 40
Calls

1 calls. Slowest were:

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

series28.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify698.0ms

Counts
43 → 43
Calls

43 calls. Slowest were:

344.0ms
(/ (* (* (/ y z) (/ y z)) (/ y z)) (* (* (/ 1 x) (/ 1 x)) (/ 1 x)))
39.0ms
(- (log (/ y z)) (log (/ 1 x)))
27.0ms
(/ (* (cbrt (/ y z)) (cbrt (/ y z))) (* (cbrt (/ 1 x)) (cbrt (/ 1 x))))

prune413.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0b

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

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
4 → 103
Calls

4 calls. Slowest were:

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

series881.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

289.0ms
(cbrt (/ 1 x))
269.0ms
(cbrt (/ 1 x))
268.0ms
(cbrt (/ 1 x))
54.0ms
(* (/ y (* (cbrt (/ 1 x)) (cbrt (/ 1 x)))) (/ (/ 1 z) (cbrt (/ 1 x))))

simplify1.8s

Counts
74 → 115
Calls

74 calls. Slowest were:

457.0ms
(+ (log (/ y (* (cbrt (/ 1 x)) (cbrt (/ 1 x))))) (- (log (/ 1 z)) (log (cbrt (/ 1 x)))))
447.0ms
(* (/ y (* (cbrt (/ 1 x)) (cbrt (/ 1 x)))) (/ (/ 1 z) (cbrt (/ 1 x))))
327.0ms
(+ (log (/ y (* (cbrt (/ 1 x)) (cbrt (/ 1 x))))) (log (/ (/ 1 z) (cbrt (/ 1 x)))))

prune1.1s

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0b

regimes319.0ms

Accuracy

56.1% (2.5b remaining)

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

bsearch5.0ms