Average Error: 14.0 → 0.5
Time: 3.4s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -8.005487962508441 \cdot 10^{+218}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -8.587130974343098 \cdot 10^{-234}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 3.032959188079464 \cdot 10^{-244}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{y}{z} \le 5.171222666601488 \cdot 10^{+154}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot 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 3 regimes
  2. if (/ y z) < -8.005487962508441e+218

    1. Initial program 42.8

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

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]
    3. Using strategy rm
    4. Applied associate-*r/0.6

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

      \[\leadsto \color{blue}{\frac{y}{\frac{z}{x}}}\]
    7. Taylor expanded around inf 0.6

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

    if -8.005487962508441e+218 < (/ y z) < -8.587130974343098e-234 or 3.032959188079464e-244 < (/ y z) < 5.171222666601488e+154

    1. Initial program 7.9

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified9.0

      \[\leadsto \color{blue}{y \cdot \frac{x}{z}}\]
    3. Using strategy rm
    4. Applied associate-*r/8.8

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

      \[\leadsto \color{blue}{\frac{y}{\frac{z}{x}}}\]
    7. Using strategy rm
    8. Applied associate-/r/0.2

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

    if -8.587130974343098e-234 < (/ y z) < 3.032959188079464e-244 or 5.171222666601488e+154 < (/ y z)

    1. Initial program 22.3

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified1.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -8.005487962508441 \cdot 10^{+218}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -8.587130974343098 \cdot 10^{-234}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 3.032959188079464 \cdot 10^{-244}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{y}{z} \le 5.171222666601488 \cdot 10^{+154}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array}\]

Reproduce

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

sample71.0ms

Algorithm
intervals

simplify360.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

360.0ms
(* x (/ (* (/ y z) t) t))

prune21.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 1.0b

localize18.0ms

Local error

Found 1 expressions with local error:

5.9b
(* y (/ x z))

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

2.0ms
(* y (/ x z))

series22.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

22.0ms
(* y (/ x z))

simplify40.0ms

Counts
7 → 16
Calls

7 calls. Slowest were:

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

prune153.0ms

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0.0b

localize7.0ms

Local error

Found 1 expressions with local error:

6.1b
(/ (* y x) z)

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
1 → 11
Calls

1 calls. Slowest were:

2.0ms
(/ (* y x) z)

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

13.0ms
(/ (* y x) z)

simplify16.0ms

Counts
3 → 14
Calls

3 calls. Slowest were:

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

prune99.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0.0b

localize5.0ms

Local error

Found 1 expressions with local error:

5.9b
(/ y (/ z x))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
Calls

1 calls. Slowest were:

0.0ms
(/ y (/ z x))

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

13.0ms
(/ y (/ z x))

simplify19.0ms

Counts
7 → 18
Calls

7 calls. Slowest were:

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

prune106.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0b

localize5.0ms

Local error

Found 1 expressions with local error:

6.1b
(/ (* x y) z)

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
1 → 11
Calls

1 calls. Slowest were:

4.0ms
(/ (* x y) z)

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

13.0ms
(/ (* x y) z)

simplify15.0ms

Counts
3 → 14
Calls

3 calls. Slowest were:

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

prune95.0ms

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0b

regimes429.0ms

Accuracy

92.5% (0.5b remaining)

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

bsearch13.0ms

end0.0ms

sample1.2s

Algorithm
intervals