Average Error: 14.3 → 2.2
Time: 4.9s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le -5.995228819261882 \cdot 10^{-116}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le -0.0:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le 1.2042578784291804 \cdot 10^{+237}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{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) t) t) < -5.995228819261882e-116 or -0.0 < (/ (* (/ y z) t) t) < 1.2042578784291804e+237

    1. Initial program 6.5

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

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

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

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

    if -5.995228819261882e-116 < (/ (* (/ y z) t) t) < -0.0

    1. Initial program 20.5

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

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

    if 1.2042578784291804e+237 < (/ (* (/ y z) t) t)

    1. Initial program 51.0

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\frac{y}{z} \cdot t}{t} \le -5.995228819261882 \cdot 10^{-116}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le -0.0:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{\frac{y}{z} \cdot t}{t} \le 1.2042578784291804 \cdot 10^{+237}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \end{array}\]

Reproduce

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

sample47.0ms

Algorithm
intervals

simplify325.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune10.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.7b

localize7.0ms

Local error

Found 1 expressions with local error:

4.8b
(* y (/ x z))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

1.0ms
(* y (/ x z))

series20.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

20.0ms
(* y (/ x z))

simplify39.0ms

Counts
7 → 16
Calls

7 calls. Slowest were:

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

prune172.0ms

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 1 expressions with local error:

4.2b
(/ (* x y) z)

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
1 → 11
Calls

1 calls. Slowest were:

2.0ms
(/ (* x y) z)

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

13.0ms
(/ (* x y) 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)

prune122.0ms

Pruning

7 alts after pruning (5 fresh and 2 done)

Merged error: 0.0b

localize8.0ms

Local error

Found 1 expressions with local error:

4.3b
(* (* y x) (/ 1 z))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
1 → 18
Calls

1 calls. Slowest were:

4.0ms
(* (* y x) (/ 1 z))

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

13.0ms
(* (* y x) (/ 1 z))

simplify576.0ms

Counts
10 → 21
Calls

10 calls. Slowest were:

470.0ms
(* (* (* (* y x) (* y x)) (* y x)) (* (* (/ 1 z) (/ 1 z)) (/ 1 z)))
54.0ms
(+ (log (* y x)) (log (/ 1 z)))
17.0ms
(* (* y x) (/ 1 z))

prune207.0ms

Pruning

8 alts after pruning (6 fresh and 2 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 2 expressions with local error:

4.8b
(* y (* x (/ 1 z)))
0.2b
(* x (/ 1 z))

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
2 → 25
Calls

2 calls. Slowest were:

3.0ms
(* y (* x (/ 1 z)))
1.0ms
(* x (/ 1 z))

series27.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

19.0ms
(* y (* x (/ 1 z)))
9.0ms
(* x (/ 1 z))

simplify49.0ms

Counts
11 → 31
Calls

11 calls. Slowest were:

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

prune312.0ms

Pruning

8 alts after pruning (5 fresh and 3 done)

Merged error: 0.0b

regimes465.0ms

Accuracy

62.4% (2.2b remaining)

Error of 2.2b against oracle of 0.0b and baseline of 5.7b

bsearch4.0ms

end0.0ms

sample1.5s

Algorithm
intervals