Average Error: 14.3 → 2.3
Time: 4.3s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -3.694776946594761 \cdot 10^{-162}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 0.0:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 1.4106232585641264 \cdot 10^{+84}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \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) < -3.694776946594761e-162 or 0.0 < (/ y z) < 1.4106232585641264e+84

    1. Initial program 10.5

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

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

      \[\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 -3.694776946594761e-162 < (/ y z) < 0.0

    1. Initial program 17.4

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

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

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

    if 1.4106232585641264e+84 < (/ y z)

    1. Initial program 27.4

      \[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
    2. Simplified4.6

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}}\]
    4. Using strategy rm
    5. Applied div-inv4.5

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{z}}\]
    6. Using strategy rm
    7. Applied pow14.5

      \[\leadsto \left(x \cdot y\right) \cdot \color{blue}{{\left(\frac{1}{z}\right)}^{1}}\]
    8. Applied pow14.5

      \[\leadsto \color{blue}{{\left(x \cdot y\right)}^{1}} \cdot {\left(\frac{1}{z}\right)}^{1}\]
    9. Applied pow-prod-down4.5

      \[\leadsto \color{blue}{{\left(\left(x \cdot y\right) \cdot \frac{1}{z}\right)}^{1}}\]
    10. Simplified4.5

      \[\leadsto {\color{blue}{\left(\frac{y}{\frac{z}{x}}\right)}}^{1}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification2.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -3.694776946594761 \cdot 10^{-162}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 0.0:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 1.4106232585641264 \cdot 10^{+84}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \end{array}\]

Reproduce

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

sample72.0ms

Algorithm
intervals

simplify335.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune13.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 → 15
Calls

1 calls. Slowest were:

1.0ms
(* y (/ x z))

series12.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

12.0ms
(* y (/ x z))

simplify34.0ms

Counts
7 → 18
Calls

7 calls. Slowest were:

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

prune139.0ms

Pruning

8 alts after pruning (7 fresh and 1 done)

Merged error: 0.0b

localize6.0ms

Local error

Found 1 expressions with local error:

4.2b
(/ (* x y) z)

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

2.0ms
(/ (* x y) z)

series16.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

16.0ms
(/ (* x y) z)

simplify24.0ms

Counts
3 → 16
Calls

3 calls. Slowest were:

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

prune136.0ms

Pruning

7 alts after pruning (5 fresh and 2 done)

Merged error: 0.0b

localize5.0ms

Local error

Found 1 expressions with local error:

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

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
1 → 20
Calls

1 calls. Slowest were:

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

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify613.0ms

Counts
10 → 23
Calls

10 calls. Slowest were:

509.0ms
(* (* (* (* x y) (* x y)) (* x y)) (* (* (/ 1 z) (/ 1 z)) (/ 1 z)))
33.0ms
(+ (log (* x y)) (log (/ 1 z)))
26.0ms
(* (* x y) (/ 1 z))

prune242.0ms

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0.0b

localize18.0ms

Local error

Found 1 expressions with local error:

4.7b
(/ y (/ z x))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 17
Calls

1 calls. Slowest were:

1.0ms
(/ y (/ z x))

series22.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

22.0ms
(/ y (/ z x))

simplify40.0ms

Counts
7 → 20
Calls

7 calls. Slowest were:

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

prune268.0ms

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0b

regimes255.0ms

Accuracy

60.3% (2.3b remaining)

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

bsearch3.0ms

end0.0ms

sample1.5s

Algorithm
intervals