Average Error: 14.0 → 0.6
Time: 5.3s
Precision: 64
Internal Precision: 128
\[x \cdot \frac{\frac{y}{z} \cdot t}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -9.569205628693954 \cdot 10^{+253}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.5935633578943175 \cdot 10^{-185}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 1.616385694453041 \cdot 10^{-132}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 4.83810691466513 \cdot 10^{+250}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \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 (/ y z) < -9.569205628693954e+253 or 4.83810691466513e+250 < (/ y z)

    1. Initial program 46.0

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

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

    if -9.569205628693954e+253 < (/ y z) < -1.5935633578943175e-185 or 1.616385694453041e-132 < (/ y z) < 4.83810691466513e+250

    1. Initial program 8.1

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

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

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

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

    if -1.5935633578943175e-185 < (/ y z) < 1.616385694453041e-132

    1. Initial program 17.1

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

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

      \[\leadsto y \cdot \color{blue}{\left(x \cdot \frac{1}{z}\right)}\]
    5. Applied associate-*r*1.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y}{z} \le -9.569205628693954 \cdot 10^{+253}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;\frac{y}{z} \le -1.5935633578943175 \cdot 10^{-185}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;\frac{y}{z} \le 1.616385694453041 \cdot 10^{-132}:\\ \;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\ \mathbf{elif}\;\frac{y}{z} \le 4.83810691466513 \cdot 10^{+250}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \end{array}\]

Reproduce

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

sample43.0ms

Algorithm
intervals

simplify260.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune13.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.8b

localize8.0ms

Local error

Found 1 expressions with local error:

5.9b
(* y (/ x z))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
Calls

1 calls. Slowest were:

1.0ms
(* y (/ x z))

series25.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

25.0ms
(* y (/ x z))

simplify24.0ms

Counts
7 → 18
Calls

7 calls. Slowest were:

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

prune172.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 1 expressions with local error:

6.6b
(/ (* x y) z)

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

5.0ms
(/ (* x y) z)

series29.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

29.0ms
(/ (* x y) z)

simplify20.0ms

Counts
3 → 16
Calls

3 calls. Slowest were:

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

prune190.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.0b

localize10.0ms

Local error

Found 1 expressions with local error:

6.5b
(/ x (/ z y))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 17
Calls

1 calls. Slowest were:

1.0ms
(/ x (/ z y))

series24.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

24.0ms
(/ x (/ z y))

simplify41.0ms

Counts
7 → 20
Calls

7 calls. Slowest were:

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

prune150.0ms

Pruning

6 alts after pruning (4 fresh and 2 done)

Merged error: 0.0b

localize8.0ms

Local error

Found 1 expressions with local error:

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

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
1 → 20
Calls

1 calls. Slowest were:

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

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify540.0ms

Counts
10 → 23
Calls

10 calls. Slowest were:

440.0ms
(* (* (* (* y x) (* y x)) (* y x)) (* (* (/ 1 z) (/ 1 z)) (/ 1 z)))
60.0ms
(+ (log (* y x)) (log (/ 1 z)))
17.0ms
(* (* y x) (/ 1 z))

prune237.0ms

Pruning

7 alts after pruning (4 fresh and 3 done)

Merged error: 0b

regimes684.0ms

Accuracy

89.2% (0.6b remaining)

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

bsearch7.0ms

end0.0ms

sample1.9s

Algorithm
intervals