Average Error: 14.4 → 0.4
Time: 4.1s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.3785674582659613 \cdot 10^{+282}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.902965997773762 \cdot 10^{-220}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 9.942043039681236 \cdot 10^{-228}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 4.102524940417053 \cdot 10^{+144}:\\ \;\;\;\;\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) < -1.3785674582659613e+282 or -1.902965997773762e-220 < (/ y z) < 9.942043039681236e-228

    1. Initial program 22.4

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

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

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

    if -1.3785674582659613e+282 < (/ y z) < -1.902965997773762e-220 or 9.942043039681236e-228 < (/ y z) < 4.102524940417053e+144

    1. Initial program 8.5

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

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

      \[\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 4.102524940417053e+144 < (/ y z)

    1. Initial program 31.7

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -1.3785674582659613 \cdot 10^{+282}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.902965997773762 \cdot 10^{-220}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{elif}\;\frac{y}{z} \le 9.942043039681236 \cdot 10^{-228}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 4.102524940417053 \cdot 10^{+144}:\\ \;\;\;\;\frac{y}{z} \cdot x\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{z} \cdot y\\ \end{array}\]

Reproduce

herbie shell --seed 2019007 
(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.3s)Debug log

sample58.0ms

Algorithm
intervals

simplify338.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune10.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.8b

localize7.0ms

Local error

Found 1 expressions with local error:

6.3b
(* y (/ x z))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

1.0ms
(* y (/ x z))

series19.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

19.0ms
(* y (/ x z))

simplify29.0ms

Counts
7 → 16
Calls

7 calls. Slowest were:

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

prune181.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0.0b

localize10.0ms

Local error

Found 1 expressions with local error:

6.8b
(/ (* y x) z)

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
1 → 11
Calls

1 calls. Slowest were:

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

prune173.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 1 expressions with local error:

6.6b
(/ 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))

simplify43.0ms

Counts
7 → 18
Calls

7 calls. Slowest were:

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

prune192.0ms

Pruning

8 alts after pruning (5 fresh and 3 done)

Merged error: 0b

localize10.0ms

Local error

Found 1 expressions with local error:

6.1b
(* (/ y z) x)

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

4.0ms
(* (/ y z) x)

series22.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

22.0ms
(* (/ y z) x)

simplify25.0ms

Counts
6 → 16
Calls

6 calls. Slowest were:

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

prune141.0ms

Pruning

8 alts after pruning (4 fresh and 4 done)

Merged error: 0b

regimes486.0ms

Accuracy

93.8% (0.4b remaining)

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

bsearch8.0ms

end0.0ms

sample1.5s

Algorithm
intervals