Average Error: 14.0 → 6.1
Time: 4.3s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;x \le -6.527818448277319 \cdot 10^{-113}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;x \le 3.458399982184495 \cdot 10^{-126}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{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 x < -6.527818448277319e-113

    1. Initial program 15.2

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

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

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\frac{y}{\frac{z}{x}}\right)}}^{1}\]

    if -6.527818448277319e-113 < x < 3.458399982184495e-126

    1. Initial program 11.9

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

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

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

      \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot \frac{1}{z}}\]
    6. Taylor expanded around inf 7.0

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

    if 3.458399982184495e-126 < x

    1. Initial program 15.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -6.527818448277319 \cdot 10^{-113}:\\ \;\;\;\;\frac{y}{\frac{z}{x}}\\ \mathbf{elif}\;x \le 3.458399982184495 \cdot 10^{-126}:\\ \;\;\;\;\frac{y \cdot x}{z}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array}\]

Reproduce

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

sample32.0ms

Algorithm
intervals

simplify214.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune18.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.8b

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

series17.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

17.0ms
(* y (/ x z))

simplify19.0ms

Counts
7 → 16
Calls

7 calls. Slowest were:

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

prune109.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:

6.6b
(/ (* x y) z)

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
1 → 11
Calls

1 calls. Slowest were:

3.0ms
(/ (* x y) z)

series22.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

21.0ms
(/ (* x y) z)

simplify32.0ms

Counts
3 → 14
Calls

3 calls. Slowest were:

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

prune128.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.0b

localize5.0ms

Local error

Found 1 expressions with local error:

6.5b
(/ x (/ z y))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
Calls

1 calls. Slowest were:

0.0ms
(/ x (/ z y))

series14.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

14.0ms
(/ x (/ z y))

simplify39.0ms

Counts
7 → 18
Calls

7 calls. Slowest were:

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

prune171.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0.0b

localize6.0ms

Local error

Found 1 expressions with local error:

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

rewrite4.0ms

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

simplify482.0ms

Counts
10 → 21
Calls

10 calls. Slowest were:

400.0ms
(* (* (* (* x y) (* x y)) (* x y)) (* (* (/ 1 z) (/ 1 z)) (/ 1 z)))
45.0ms
(+ (log (* x y)) (log (/ 1 z)))
15.0ms
(* (* x y) (/ 1 z))

prune197.0ms

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0b

regimes284.0ms

Accuracy

-7.1% (6.1b remaining)

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

bsearch119.0ms

end0.0ms

sample1.8s

Algorithm
intervals