Average Error: 29.8 → 1.1
Time: 1.1m
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 310.8796801255867:\\ \;\;\;\;\frac{\left(2 - {x}^{2}\right) + \sqrt[3]{\frac{2}{3} \cdot {x}^{3}} \cdot \left(\sqrt[3]{\frac{2}{3} \cdot {x}^{3}} \cdot \sqrt[3]{\frac{2}{3} \cdot {x}^{3}}\right)}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{{e}^{\left(\left(-x\right) \cdot \left(1 - \varepsilon\right)\right)} \cdot \left(\frac{1}{\varepsilon} + 1\right) - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{\left(1 + \varepsilon\right) \cdot \left(-x\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 < 310.8796801255867

    1. Initial program 39.4

      \[\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 associate--l+1.4

      \[\leadsto \frac{\color{blue}{\frac{2}{3} \cdot {x}^{3} + \left(2 - {x}^{2}\right)}}{2}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt1.4

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

    if 310.8796801255867 < 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 *-un-lft-identity0.2

      \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{\color{blue}{1 \cdot \left(-\left(1 - \varepsilon\right) \cdot x\right)}} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}\]
    4. Applied exp-prod0.2

      \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \color{blue}{{\left(e^{1}\right)}^{\left(-\left(1 - \varepsilon\right) \cdot x\right)}} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}\]
    5. Simplified0.2

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

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

Reproduce

herbie shell --seed 2019008 
(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.1m)Debug log

sample419.0ms

Algorithm
intervals

simplify224.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune8.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 30.8b

localize66.0ms

Local error

Found 4 expressions with local error:

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

rewrite50.0ms

Algorithm
rewrite-expression-head
Counts
4 → 140
Calls

4 calls. Slowest were:

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

series158.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

107.0ms
(- (* (+ 1 (/ 1 eps)) (exp (- (* (- 1 eps) x)))) (* (- (/ 1 eps) 1) (exp (- (* (+ 1 eps) x)))))
18.0ms
(exp (- (* (- 1 eps) x)))
18.0ms
(exp (- (* (+ 1 eps) x)))
15.0ms
(* (- 1 eps) x)

simplify43.9s

Counts
195 → 152
Calls

195 calls. Slowest were:

614.0ms
(- (* (* (- (* 1 1) (* (/ 1 eps) (/ 1 eps))) 1) (+ (* (/ 1 eps) (/ 1 eps)) (+ (* 1 1) (* (/ 1 eps) 1)))) (* (* (- 1 (/ 1 eps)) (exp (* (- 1 eps) x))) (* (- (pow (/ 1 eps) 3) (pow 1 3)) (exp (- (* (+ 1 eps) x))))))
610.0ms
(* (- 1 (/ 1 eps)) (+ (* (/ 1 eps) (/ 1 eps)) (+ (* 1 1) (* (/ 1 eps) 1))))
608.0ms
(* (+ (* 1 1) (- (* (/ 1 eps) (/ 1 eps)) (* 1 (/ 1 eps)))) (+ (/ 1 eps) 1))

prune2.6s

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.6b

localize37.0ms

Local error

Found 2 expressions with local error:

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

rewrite27.0ms

Algorithm
rewrite-expression-head
Counts
2 → 29
Calls

2 calls. Slowest were:

24.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))
3.0ms
(* 2/3 (pow x 3))

series35.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

19.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))
17.0ms
(* 2/3 (pow x 3))

simplify480.0ms

Counts
17 → 35
Calls

17 calls. Slowest were:

90.0ms
(/ (exp (+ (* 2/3 (pow x 3)) 2)) (exp (pow x 2)))
79.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))
71.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))

prune391.0ms

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 0.5b

localize9.0ms

Local error

Found 2 expressions with local error:

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

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
2 → 27
Calls

2 calls. Slowest were:

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

series44.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

28.0ms
(* 2/3 (pow x 3))
17.0ms
(+ (* 2/3 (pow x 3)) (- 2 (pow x 2)))

simplify358.0ms

Counts
14 → 33
Calls

14 calls. Slowest were:

126.0ms
(* (exp (* 2/3 (pow x 3))) (exp (- 2 (pow x 2))))
87.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))
49.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))

prune421.0ms

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0.5b

localize19.0ms

Local error

Found 4 expressions with local error:

42.9b
(cbrt (* 2/3 (pow x 3)))
42.9b
(cbrt (* 2/3 (pow x 3)))
42.9b
(cbrt (* 2/3 (pow x 3)))
6.6b
(+ (* (* (cbrt (* 2/3 (pow x 3))) (cbrt (* 2/3 (pow x 3)))) (cbrt (* 2/3 (pow x 3)))) (- 2 (pow x 2)))

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
4 → 41
Calls

4 calls. Slowest were:

17.0ms
(+ (* (* (cbrt (* 2/3 (pow x 3))) (cbrt (* 2/3 (pow x 3)))) (cbrt (* 2/3 (pow x 3)))) (- 2 (pow x 2)))
1.0ms
(cbrt (* 2/3 (pow x 3)))
1.0ms
(cbrt (* 2/3 (pow x 3)))

series313.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

94.0ms
(cbrt (* 2/3 (pow x 3)))
88.0ms
(cbrt (* 2/3 (pow x 3)))
81.0ms
(cbrt (* 2/3 (pow x 3)))
50.0ms
(+ (* (* (cbrt (* 2/3 (pow x 3))) (cbrt (* 2/3 (pow x 3)))) (cbrt (* 2/3 (pow x 3)))) (- 2 (pow x 2)))

simplify410.0ms

Counts
19 → 53
Calls

19 calls. Slowest were:

126.0ms
(* (exp (* (* (cbrt (* 2/3 (pow x 3))) (cbrt (* 2/3 (pow x 3)))) (cbrt (* 2/3 (pow x 3))))) (exp (- 2 (pow x 2))))
78.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))
74.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))

prune649.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0.5b

regimes189.0ms

Accuracy

96.2% (0.6b remaining)

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

bsearch672.0ms

end0.0ms

sample12.6s

Algorithm
intervals