Average Error: 14.0 → 2.3
Time: 3.9s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.8334373322166774 \cdot 10^{-155}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 3.7429862945548285 \cdot 10^{-210}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{y}{z} \le 5.449273013695744 \cdot 10^{+147}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \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) < -1.8334373322166774e-155 or 3.7429862945548285e-210 < (/ y z) < 5.449273013695744e+147

    1. Initial program 10.4

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

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

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

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

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

    if -1.8334373322166774e-155 < (/ y z) < 3.7429862945548285e-210

    1. Initial program 16.6

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

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

    if 5.449273013695744e+147 < (/ y z)

    1. Initial program 31.6

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified3.1

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.8334373322166774 \cdot 10^{-155}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 3.7429862945548285 \cdot 10^{-210}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \mathbf{elif}\;\frac{y}{z} \le 5.449273013695744 \cdot 10^{+147}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019008 
(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

sample38.0ms

Algorithm
intervals

simplify292.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune14.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.3b

localize7.0ms

Local error

Found 1 expressions with local error:

8.1b
(* y (/ x z))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

1.0ms
(* y (/ x z))

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

13.0ms
(* y (/ x z))

simplify30.0ms

Counts
7 → 16
Calls

7 calls. Slowest were:

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

prune166.0ms

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0.0b

localize10.0ms

Local error

Found 1 expressions with local error:

7.5b
(/ (* y x) z)

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
1 → 11
Calls

1 calls. Slowest were:

6.0ms
(/ (* y x) z)

series21.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

21.0ms
(/ (* y x) z)

simplify32.0ms

Counts
3 → 14
Calls

3 calls. Slowest were:

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

prune184.0ms

Pruning

7 alts after pruning (5 fresh and 2 done)

Merged error: 0.0b

localize10.0ms

Local error

Found 1 expressions with local error:

7.4b
(/ y (/ z x))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
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))

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)

prune197.0ms

Pruning

7 alts after pruning (4 fresh and 3 done)

Merged error: 0b

localize11.0ms

Local error

Found 1 expressions with local error:

7.2b
(* (/ y z) x)

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

4.0ms
(* (/ y z) x)

series23.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

23.0ms
(* (/ y z) x)

simplify39.0ms

Counts
6 → 16
Calls

6 calls. Slowest were:

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

prune145.0ms

Pruning

7 alts after pruning (3 fresh and 4 done)

Merged error: 0b

regimes366.0ms

Accuracy

62.1% (2.3b remaining)

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

bsearch5.0ms

end0.0ms

sample1.5s

Algorithm
intervals