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

    1. Initial program 39.1

      \[\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.3

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

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

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{1 \cdot \left(\left(\frac{2}{3} \cdot {x}^{3} + 2\right) \cdot \left(\frac{2}{3} \cdot {x}^{3} + 2\right) - {x}^{2} \cdot {x}^{2}\right)}}{1 \cdot \left(\left(\frac{2}{3} \cdot {x}^{3} + 2\right) + {x}^{2}\right)}}{2}\]
    10. Applied times-frac1.3

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

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

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

    if 415.8757977460435 < x

    1. Initial program 0.1

      \[\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-cbrt-cube0.1

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

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

Reproduce

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

start931.0ms

Algorithm
intervals

setup234.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 28.1b

localize81.0ms

Local error

Found 4 expressions with local error:

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

rewrite80.0ms

Algorithm
rewrite-expression-head
Counts
4 → 159
Calls

4 calls. Slowest were:

25.0ms
(- (* (+ 1 (/ 1 eps)) (exp (- (* (- 1 eps) x)))) (* (- (/ 1 eps) 1) (exp (- (* (+ 1 eps) x)))))
21.0ms
(* (- (/ 1 eps) 1) (exp (- (* (+ 1 eps) x))))
21.0ms
(* (+ 1 (/ 1 eps)) (exp (- (* (- 1 eps) x))))

series215.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

122.0ms
(- (* (+ 1 (/ 1 eps)) (exp (- (* (- 1 eps) x)))) (* (- (/ 1 eps) 1) (exp (- (* (+ 1 eps) x)))))
37.0ms
(* (- (/ 1 eps) 1) (exp (- (* (+ 1 eps) x))))
31.0ms
(* (+ 1 (/ 1 eps)) (exp (- (* (- 1 eps) x))))
24.0ms
(* (- 1 eps) x)

simplify53.9s

Counts
222 → 171
Calls

222 calls. Slowest were:

1.0s
(sqrt (exp (- (* (- 1 eps) x))))
704.0ms
(* (* (* (+ 1 (/ 1 eps)) (+ 1 (/ 1 eps))) (+ 1 (/ 1 eps))) (* (* (exp (- (* (- 1 eps) x))) (exp (- (* (- 1 eps) x)))) (exp (- (* (- 1 eps) x)))))
602.0ms
(- (* (* (- (* 1 1) (* (/ 1 eps) (/ 1 eps))) 1) (* (+ (/ 1 eps) 1) (exp (* (+ 1 eps) x)))) (* (* (- 1 (/ 1 eps)) (exp (* (- 1 eps) x))) (* (- (* (/ 1 eps) (/ 1 eps)) (* 1 1)) (exp 0))))

prune3.3s

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.2b

localize34.0ms

Local error

Found 2 expressions with local error:

6.8b
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))
0.3b
(* 2/3 (pow x 3))

rewrite25.0ms

Algorithm
rewrite-expression-head
Counts
2 → 29
Calls

2 calls. Slowest were:

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

series52.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify535.0ms

Counts
17 → 35
Calls

17 calls. Slowest were:

131.0ms
(/ (exp (+ (* 2/3 (pow x 3)) 2)) (exp (pow x 2)))
86.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))
62.0ms
(- (+ (* 2/3 (pow x 3)) 2) (pow x 2))

prune535.0ms

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.2b

localize31.0ms

Local error

Found 4 expressions with local error:

11.1b
(/ (- (* (+ (* 2/3 (pow x 3)) 2) (+ (* 2/3 (pow x 3)) 2)) (* (pow x 2) (pow x 2))) (+ (+ (* 2/3 (pow x 3)) 2) (pow x 2)))
10.0b
(- (* (+ (* 2/3 (pow x 3)) 2) (+ (* 2/3 (pow x 3)) 2)) (* (pow x 2) (pow x 2)))
0.3b
(* 2/3 (pow x 3))
0.3b
(* 2/3 (pow x 3))

rewrite69.0ms

Algorithm
rewrite-expression-head
Counts
4 → 82
Calls

4 calls. Slowest were:

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

series125.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

48.0ms
(/ (- (* (+ (* 2/3 (pow x 3)) 2) (+ (* 2/3 (pow x 3)) 2)) (* (pow x 2) (pow x 2))) (+ (+ (* 2/3 (pow x 3)) 2) (pow x 2)))
28.0ms
(* 2/3 (pow x 3))
26.0ms
(* 2/3 (pow x 3))
22.0ms
(- (* (+ (* 2/3 (pow x 3)) 2) (+ (* 2/3 (pow x 3)) 2)) (* (pow x 2) (pow x 2)))

simplify8.5s

Counts
71 → 94
Calls

71 calls. Slowest were:

508.0ms
(/ (* (+ (* 2/3 (pow x 3)) 2) (+ (* 2/3 (pow x 3)) 2)) (+ (+ (* 2/3 (pow x 3)) 2) (pow x 2)))
315.0ms
(+ (* (+ (* 2/3 (pow x 3)) 2) (+ (* 2/3 (pow x 3)) 2)) (- (* (pow x 2) (pow x 2)) (* (+ (* 2/3 (pow x 3)) 2) (pow x 2))))
297.0ms
(* (cbrt (- (* (+ (* 2/3 (pow x 3)) 2) (+ (* 2/3 (pow x 3)) 2)) (* (pow x 2) (pow x 2)))) (cbrt (- (* (+ (* 2/3 (pow x 3)) 2) (+ (* 2/3 (pow x 3)) 2)) (* (pow x 2) (pow x 2)))))

prune1.5s

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.2b

localize19.0ms

Local error

Found 4 expressions with local error:

12.4b
(/ (- (+ (* 8/3 (pow x 3)) 4) (pow x 4)) (+ (+ (* 2/3 (pow x 3)) 2) (pow x 2)))
11.0b
(- (+ (* 8/3 (pow x 3)) 4) (pow x 4))
0.3b
(* 2/3 (pow x 3))
0.1b
(* 8/3 (pow x 3))

rewrite63.0ms

Algorithm
rewrite-expression-head
Counts
4 → 87
Calls

4 calls. Slowest were:

43.0ms
(/ (- (+ (* 8/3 (pow x 3)) 4) (pow x 4)) (+ (+ (* 2/3 (pow x 3)) 2) (pow x 2)))
16.0ms
(- (+ (* 8/3 (pow x 3)) 4) (pow x 4))
1.0ms
(* 2/3 (pow x 3))

series86.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

27.0ms
(/ (- (+ (* 8/3 (pow x 3)) 4) (pow x 4)) (+ (+ (* 2/3 (pow x 3)) 2) (pow x 2)))
20.0ms
(- (+ (* 8/3 (pow x 3)) 4) (pow x 4))
20.0ms
(* 8/3 (pow x 3))
18.0ms
(* 2/3 (pow x 3))

simplify5.5s

Counts
79 → 99
Calls

79 calls. Slowest were:

346.0ms
(+ (* (+ (* 2/3 (pow x 3)) 2) (+ (* 2/3 (pow x 3)) 2)) (- (* (pow x 2) (pow x 2)) (* (+ (* 2/3 (pow x 3)) 2) (pow x 2))))
237.0ms
(- (pow (+ (* 8/3 (pow x 3)) 4) 3) (pow (pow x 4) 3))
210.0ms
(/ (* (* (- (+ (* 8/3 (pow x 3)) 4) (pow x 4)) (- (+ (* 8/3 (pow x 3)) 4) (pow x 4))) (- (+ (* 8/3 (pow x 3)) 4) (pow x 4))) (* (* (+ (+ (* 2/3 (pow x 3)) 2) (pow x 2)) (+ (+ (* 2/3 (pow x 3)) 2) (pow x 2))) (+ (+ (* 2/3 (pow x 3)) 2) (pow x 2))))

prune2.0s

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.2b

regimes140.0ms

Accuracy

96.1% (0.6b remaining)

Error of 1.0b against oracle of 0.4b and baseline of 16.2b

bsearch998.0ms