Average Error: 29.7 → 1.1
Time: 1.3m
Precision: 64
Internal Precision: 128
\[\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}\]
\[\begin{array}{l} \mathbf{if}\;x \le 111.9247683550667:\\ \;\;\;\;\frac{\left(\left(x \cdot \frac{2}{3}\right) \cdot \left(x \cdot x\right) + 2\right) - x \cdot x}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{1}{\varepsilon} + 1\right) \cdot e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(\left(\sqrt[3]{e^{\left(1 + \varepsilon\right) \cdot \left(-x\right)}} \cdot \sqrt[3]{e^{\left(1 + \varepsilon\right) \cdot \left(-x\right)}}\right) \cdot \sqrt[3]{e^{\left(1 + \varepsilon\right) \cdot \left(-x\right)}}\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)}{2}\\ \end{array}\]

Error

Bits error versus x

Bits error versus eps

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if x < 111.9247683550667

    1. Initial program 39.6

      \[\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}\]
    2. Taylor expanded around 0 1.4

      \[\leadsto \frac{\color{blue}{\left(\frac{2}{3} \cdot {x}^{3} + 2\right) - {x}^{2}}}{2}\]
    3. Using strategy rm
    4. Applied flip-+1.4

      \[\leadsto \frac{\color{blue}{\frac{\left(\frac{2}{3} \cdot {x}^{3}\right) \cdot \left(\frac{2}{3} \cdot {x}^{3}\right) - 2 \cdot 2}{\frac{2}{3} \cdot {x}^{3} - 2}} - {x}^{2}}{2}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity1.4

      \[\leadsto \frac{\frac{\left(\frac{2}{3} \cdot {x}^{3}\right) \cdot \left(\frac{2}{3} \cdot {x}^{3}\right) - 2 \cdot 2}{\frac{2}{3} \cdot {x}^{3} - 2} - \color{blue}{1 \cdot {x}^{2}}}{2}\]
    7. Applied *-un-lft-identity1.4

      \[\leadsto \frac{\color{blue}{1 \cdot \frac{\left(\frac{2}{3} \cdot {x}^{3}\right) \cdot \left(\frac{2}{3} \cdot {x}^{3}\right) - 2 \cdot 2}{\frac{2}{3} \cdot {x}^{3} - 2}} - 1 \cdot {x}^{2}}{2}\]
    8. Applied distribute-lft-out--1.4

      \[\leadsto \frac{\color{blue}{1 \cdot \left(\frac{\left(\frac{2}{3} \cdot {x}^{3}\right) \cdot \left(\frac{2}{3} \cdot {x}^{3}\right) - 2 \cdot 2}{\frac{2}{3} \cdot {x}^{3} - 2} - {x}^{2}\right)}}{2}\]
    9. Simplified1.4

      \[\leadsto \frac{1 \cdot \color{blue}{\left(\left(2 + \left(x \cdot x\right) \cdot \left(\frac{2}{3} \cdot x\right)\right) - x \cdot x\right)}}{2}\]

    if 111.9247683550667 < x

    1. Initial program 0.2

      \[\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt0.2

      \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \color{blue}{\left(\left(\sqrt[3]{e^{-\left(1 + \varepsilon\right) \cdot x}} \cdot \sqrt[3]{e^{-\left(1 + \varepsilon\right) \cdot x}}\right) \cdot \sqrt[3]{e^{-\left(1 + \varepsilon\right) \cdot x}}\right)}}{2}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le 111.9247683550667:\\ \;\;\;\;\frac{\left(\left(x \cdot \frac{2}{3}\right) \cdot \left(x \cdot x\right) + 2\right) - x \cdot x}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\frac{1}{\varepsilon} + 1\right) \cdot e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(\left(\sqrt[3]{e^{\left(1 + \varepsilon\right) \cdot \left(-x\right)}} \cdot \sqrt[3]{e^{\left(1 + \varepsilon\right) \cdot \left(-x\right)}}\right) \cdot \sqrt[3]{e^{\left(1 + \varepsilon\right) \cdot \left(-x\right)}}\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)}{2}\\ \end{array}\]

Reproduce

herbie shell --seed 2019007 
(FPCore (x eps)
  :name "NMSE Section 6.1 mentioned, A"
  (/ (- (* (+ 1 (/ 1 eps)) (exp (- (* (- 1 eps) x)))) (* (- (/ 1 eps) 1) (exp (- (* (+ 1 eps) x))))) 2))

Details

Time bar (total: 1.2m)Debug log

sample481.0ms

Algorithm
intervals

simplify184.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

184.0ms
(/ (- (* (+ 1 (/ 1 eps)) (exp (- (* (- 1 eps) x)))) (* (- (/ 1 eps) 1) (exp (- (* (+ 1 eps) x))))) 2)

prune15.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 30.4b

localize43.0ms

Local error

Found 4 expressions with local error:

3.5b
(- (* (+ 1 (/ 1 eps)) (exp (- (* (- 1 eps) x)))) (* (- (/ 1 eps) 1) (exp (- (* (+ 1 eps) x)))))
0.0b
(exp (- (* (- 1 eps) x)))
0.0b
(exp (- (* (+ 1 eps) x)))
0.0b
(* (- 1 eps) x)

rewrite44.0ms

Algorithm
rewrite-expression-head
Counts
4 → 140
Calls

4 calls. Slowest were:

19.0ms
(- (* (+ 1 (/ 1 eps)) (exp (- (* (- 1 eps) x)))) (* (- (/ 1 eps) 1) (exp (- (* (+ 1 eps) x)))))
7.0ms
(exp (- (* (+ 1 eps) x)))
6.0ms
(exp (- (* (- 1 eps) x)))

series172.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

104.0ms
(- (* (+ 1 (/ 1 eps)) (exp (- (* (- 1 eps) x)))) (* (- (/ 1 eps) 1) (exp (- (* (+ 1 eps) x)))))
24.0ms
(exp (- (* (+ 1 eps) x)))
23.0ms
(* (- 1 eps) x)
22.0ms
(exp (- (* (- 1 eps) x)))

simplify43.9s

Counts
195 → 152
Calls

195 calls. Slowest were:

659.0ms
(* (+ (* 1 1) (- (* (/ 1 eps) (/ 1 eps)) (* 1 (/ 1 eps)))) (+ (* (/ 1 eps) (/ 1 eps)) (+ (* 1 1) (* (/ 1 eps) 1))))
574.0ms
(* (* (+ (* 1 1) (- (* (/ 1 eps) (/ 1 eps)) (* 1 (/ 1 eps)))) (exp (* (- 1 eps) x))) (* (+ (/ 1 eps) 1) (exp (* (+ 1 eps) x))))
562.0ms
(- (* (* (- (* 1 1) (* (/ 1 eps) (/ 1 eps))) (exp 0)) (* (+ (/ 1 eps) 1) (exp (* (+ 1 eps) x)))) (* (* (- 1 (/ 1 eps)) (exp (* (- 1 eps) x))) (* (- (* (/ 1 eps) (/ 1 eps)) (* 1 1)) 1)))

prune2.4s

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.6b

localize30.0ms

Local error

Found 3 expressions with local error:

7.4b
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))
0.1b
(* 2/3 (pow x 3))
0.0b
(+ (* 2/3 (pow x 3)) 2)

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
3 → 39
Calls

3 calls. Slowest were:

12.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))
2.0ms
(+ (* 2/3 (pow x 3)) 2)
1.0ms
(* 2/3 (pow x 3))

series85.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

37.0ms
(+ (* 2/3 (pow x 3)) 2)
25.0ms
(* 2/3 (pow x 3))
22.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))

simplify464.0ms

Counts
20 → 48
Calls

20 calls. Slowest were:

93.0ms
(/ (exp (+ (* 2/3 (pow x 3)) 2)) (exp (pow x 2)))
60.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))
57.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))

prune529.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.6b

localize24.0ms

Local error

Found 4 expressions with local error:

11.1b
(/ (- (* (* 2/3 (pow x 3)) (* 2/3 (pow x 3))) (* 2 2)) (- (* 2/3 (pow x 3)) 2))
7.4b
(- (/ (- (* (* 2/3 (pow x 3)) (* 2/3 (pow x 3))) (* 2 2)) (- (* 2/3 (pow x 3)) 2)) (pow x 2))
0.1b
(* 2/3 (pow x 3))
0.1b
(* 2/3 (pow x 3))

rewrite94.0ms

Algorithm
rewrite-expression-head
Counts
4 → 80
Calls

4 calls. Slowest were:

67.0ms
(- (/ (- (* (* 2/3 (pow x 3)) (* 2/3 (pow x 3))) (* 2 2)) (- (* 2/3 (pow x 3)) 2)) (pow x 2))
20.0ms
(/ (- (* (* 2/3 (pow x 3)) (* 2/3 (pow x 3))) (* 2 2)) (- (* 2/3 (pow x 3)) 2))
2.0ms
(* 2/3 (pow x 3))

series209.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

118.0ms
(/ (- (* (* 2/3 (pow x 3)) (* 2/3 (pow x 3))) (* 2 2)) (- (* 2/3 (pow x 3)) 2))
49.0ms
(- (/ (- (* (* 2/3 (pow x 3)) (* 2/3 (pow x 3))) (* 2 2)) (- (* 2/3 (pow x 3)) 2)) (pow x 2))
25.0ms
(* 2/3 (pow x 3))
15.0ms
(* 2/3 (pow x 3))

simplify10.3s

Counts
68 → 92
Calls

68 calls. Slowest were:

790.0ms
(- (pow (* (* 2/3 (pow x 3)) (* 2/3 (pow x 3))) 3) (pow (* 2 2) 3))
484.0ms
(/ (cbrt (- (* (* 2/3 (pow x 3)) (* 2/3 (pow x 3))) (* 2 2))) (sqrt (- (* 2/3 (pow x 3)) 2)))
456.0ms
(/ (sqrt (- (* (* 2/3 (pow x 3)) (* 2/3 (pow x 3))) (* 2 2))) (sqrt (- (* 2/3 (pow x 3)) 2)))

prune1.0s

Pruning

9 alts after pruning (9 fresh and 0 done)

Merged error: 0.6b

localize24.0ms

Local error

Found 4 expressions with local error:

7.4b
(- (+ 2 (* (* x x) (* 2/3 x))) (* x x))
0.4b
(* 2/3 x)
0.1b
(* (* x x) (* 2/3 x))
0.0b
(+ 2 (* (* x x) (* 2/3 x)))

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
4 → 45
Calls

4 calls. Slowest were:

7.0ms
(* (* x x) (* 2/3 x))
5.0ms
(- (+ 2 (* (* x x) (* 2/3 x))) (* x x))
2.0ms
(+ 2 (* (* x x) (* 2/3 x)))

series106.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

48.0ms
(+ 2 (* (* x x) (* 2/3 x)))
27.0ms
(* (* x x) (* 2/3 x))
18.0ms
(- (+ 2 (* (* x x) (* 2/3 x))) (* x x))
12.0ms
(* 2/3 x)

simplify819.0ms

Counts
18 → 57
Calls

18 calls. Slowest were:

395.0ms
(* (* (* (* x x) (* x x)) (* x x)) (* (* (* 2/3 x) (* 2/3 x)) (* 2/3 x)))
113.0ms
(/ (exp (+ 2 (* (* x x) (* 2/3 x)))) (exp (* x x)))
58.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))

prune467.0ms

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 0.6b

regimes171.0ms

Accuracy

96.2% (0.6b remaining)

Error of 1.1b against oracle of 0.5b and baseline of 16.9b

bsearch599.0ms

end0.0ms

sample12.7s

Algorithm
intervals