Average Error: 59.6 → 0.7
Time: 2.0m
Precision: 64
Internal Precision: 128
\[-\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{e^{\frac{\pi}{4} \cdot f} - e^{-\frac{\pi}{4} \cdot f}}\right)\]
\[-\frac{\log \left(\frac{e^{\left(-f\right) \cdot \frac{\pi}{4}} + e^{\frac{\pi}{\frac{4}{f}}}}{\left(\left(f \cdot \pi\right) \cdot \left(f \cdot \pi\right)\right) \cdot \left(\left(f \cdot \pi\right) \cdot \frac{1}{192}\right) + \left(\left({\pi}^{5} \cdot \frac{1}{61440}\right) \cdot {f}^{5} + \left(f \cdot \frac{1}{2}\right) \cdot \pi\right)}\right)}{\frac{\pi}{4}}\]

Error

Bits error versus f

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 59.6

    \[-\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{e^{\frac{\pi}{4} \cdot f} - e^{-\frac{\pi}{4} \cdot f}}\right)\]
  2. Taylor expanded around 0 0.8

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\color{blue}{\frac{1}{2} \cdot \left(f \cdot \pi\right) + \left(\frac{1}{192} \cdot \left({f}^{3} \cdot {\pi}^{3}\right) + \frac{1}{61440} \cdot \left({f}^{5} \cdot {\pi}^{5}\right)\right)}}\right)\]
  3. Using strategy rm
  4. Applied add-exp-log0.8

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{\color{blue}{e^{\log \left(\frac{1}{2} \cdot \left(f \cdot \pi\right) + \left(\frac{1}{192} \cdot \left({f}^{3} \cdot {\pi}^{3}\right) + \frac{1}{61440} \cdot \left({f}^{5} \cdot {\pi}^{5}\right)\right)\right)}}}\right)\]
  5. Applied add-exp-log0.8

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{\color{blue}{e^{\log \left(e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}\right)}}}{e^{\log \left(\frac{1}{2} \cdot \left(f \cdot \pi\right) + \left(\frac{1}{192} \cdot \left({f}^{3} \cdot {\pi}^{3}\right) + \frac{1}{61440} \cdot \left({f}^{5} \cdot {\pi}^{5}\right)\right)\right)}}\right)\]
  6. Applied div-exp0.8

    \[\leadsto -\frac{1}{\frac{\pi}{4}} \cdot \log \color{blue}{\left(e^{\log \left(e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}\right) - \log \left(\frac{1}{2} \cdot \left(f \cdot \pi\right) + \left(\frac{1}{192} \cdot \left({f}^{3} \cdot {\pi}^{3}\right) + \frac{1}{61440} \cdot \left({f}^{5} \cdot {\pi}^{5}\right)\right)\right)}\right)}\]
  7. Using strategy rm
  8. Applied associate-*l/0.7

    \[\leadsto -\color{blue}{\frac{1 \cdot \log \left(e^{\log \left(e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}\right) - \log \left(\frac{1}{2} \cdot \left(f \cdot \pi\right) + \left(\frac{1}{192} \cdot \left({f}^{3} \cdot {\pi}^{3}\right) + \frac{1}{61440} \cdot \left({f}^{5} \cdot {\pi}^{5}\right)\right)\right)}\right)}{\frac{\pi}{4}}}\]
  9. Simplified0.7

    \[\leadsto -\frac{\color{blue}{\log \left(\frac{e^{\left(-f\right) \cdot \frac{\pi}{4}} + e^{\frac{\pi}{\frac{4}{f}}}}{\left(\left(\pi \cdot f\right) \cdot \frac{1}{192}\right) \cdot \left(\left(\pi \cdot f\right) \cdot \left(\pi \cdot f\right)\right) + \left({f}^{5} \cdot \left({\pi}^{5} \cdot \frac{1}{61440}\right) + \pi \cdot \left(\frac{1}{2} \cdot f\right)\right)}\right)}}{\frac{\pi}{4}}\]
  10. Final simplification0.7

    \[\leadsto -\frac{\log \left(\frac{e^{\left(-f\right) \cdot \frac{\pi}{4}} + e^{\frac{\pi}{\frac{4}{f}}}}{\left(\left(f \cdot \pi\right) \cdot \left(f \cdot \pi\right)\right) \cdot \left(\left(f \cdot \pi\right) \cdot \frac{1}{192}\right) + \left(\left({\pi}^{5} \cdot \frac{1}{61440}\right) \cdot {f}^{5} + \left(f \cdot \frac{1}{2}\right) \cdot \pi\right)}\right)}{\frac{\pi}{4}}\]

Reproduce

herbie shell --seed 2018360 
(FPCore (f)
  :name "VandenBroeck and Keller, Equation (20)"
  (- (* (/ 1 (/ PI 4)) (log (/ (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f)))) (- (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f)))))))))

Details

Time bar (total: 53.0s)Debug log

start2.6s

Algorithm
intervals

setup326.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 59.9b

localize51.0ms

Local error

Found 4 expressions with local error:

4.9b
(- (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f))))
0.3b
(* (/ PI 4) f)
0.3b
(* (/ PI 4) f)
0.3b
(* (/ PI 4) f)

rewrite25.0ms

Algorithm
rewrite-expression-head
Counts
4 → 53
Calls

4 calls. Slowest were:

11.0ms
(- (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f))))
4.0ms
(* (/ PI 4) f)
4.0ms
(* (/ PI 4) f)

series370.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

142.0ms
(- (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f))))
81.0ms
(* (/ PI 4) f)
74.0ms
(* (/ PI 4) f)
73.0ms
(* (/ PI 4) f)

simplify610.0ms

Counts
25 → 65
Calls

25 calls. Slowest were:

315.0ms
(+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5)))))
60.0ms
(- (exp (* 1/4 (* PI f))) (exp (- (* 1/4 (* PI f)))))
35.0ms
(- (exp (* 1/4 (* PI f))) (exp (* -1/4 (* PI f))))

prune1.1s

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.4b

localize95.0ms

Local error

Found 4 expressions with local error:

1.0b
(pow PI 3)
1.0b
(pow PI 5)
0.4b
(* (/ 1 (/ PI 4)) (log (/ (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f)))) (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))))))
0.3b
(/ (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f)))) (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))))

rewrite54.0ms

Algorithm
rewrite-expression-head
Counts
4 → 111
Calls

4 calls. Slowest were:

31.0ms
(/ (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f)))) (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))))
21.0ms
(* (/ 1 (/ PI 4)) (log (/ (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f)))) (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))))))
0.0ms
(pow PI 3)

series755.0ms

Counts
4 → 8
Calls

4 calls. Slowest were:

463.0ms
(* (/ 1 (/ PI 4)) (log (/ (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f)))) (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))))))
292.0ms
(/ (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f)))) (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))))
0.0ms
(pow PI 3)
0.0ms
(pow PI 5)

simplify22.2s

Counts
91 → 119
Calls

91 calls. Slowest were:

828.0ms
(* (/ 1 (/ PI 4)) (log (/ (cbrt (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f))))) (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))))))
511.0ms
(* (* (* (/ 1 (/ PI 4)) (/ 1 (/ PI 4))) (/ 1 (/ PI 4))) (* (* (log (/ (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f)))) (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))))) (log (/ (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f)))) (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5)))))))) (log (/ (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f)))) (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5)))))))))
449.0ms
(/ (cbrt (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f))))) (sqrt (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5)))))))

prune4.1s

Pruning

8 alts after pruning (8 fresh and 0 done)

Merged error: 0.0b

localize40.0ms

Local error

Found 4 expressions with local error:

5.7b
(exp (- (log (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f))))) (log (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))))))
1.0b
(pow PI 3)
1.0b
(pow PI 5)
0.4b
(* (/ 1 (/ PI 4)) (log (exp (- (log (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f))))) (log (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))))))))

rewrite68.0ms

Algorithm
rewrite-expression-head
Counts
4 → 96
Calls

4 calls. Slowest were:

45.0ms
(* (/ 1 (/ PI 4)) (log (exp (- (log (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f))))) (log (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))))))))
19.0ms
(exp (- (log (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f))))) (log (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))))))
0.0ms
(pow PI 3)

series1.1s

Counts
4 → 8
Calls

4 calls. Slowest were:

534.0ms
(exp (- (log (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f))))) (log (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))))))
534.0ms
(* (/ 1 (/ PI 4)) (log (exp (- (log (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f))))) (log (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))))))))
0.0ms
(pow PI 3)
0.0ms
(pow PI 5)

simplify13.4s

Counts
69 → 104
Calls

69 calls. Slowest were:

613.0ms
(* (log (exp (log (+ (* (* 1/2 (* f PI)) (* 1/2 (* f PI))) (- (* (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5)))) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5))))) (* (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5)))))))))) (/ 1 (/ PI 4)))
452.0ms
(- (log (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f))))) (log (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5)))))))
430.0ms
(exp (sqrt (- (log (+ (exp (* (/ PI 4) f)) (exp (- (* (/ PI 4) f))))) (log (+ (* 1/2 (* f PI)) (+ (* 1/192 (* (pow f 3) (pow PI 3))) (* 1/61440 (* (pow f 5) (pow PI 5)))))))))

prune3.2s

Pruning

7 alts after pruning (6 fresh and 1 done)

Merged error: 0.0b

localize92.0ms

Local error

Found 4 expressions with local error:

1.0b
(pow PI 5)
0.5b
(/ PI (/ 4 f))
0.4b
(* (* PI f) 1/192)
0.3b
(* (* PI f) (* PI f))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 48
Calls

4 calls. Slowest were:

4.0ms
(* (* PI f) (* PI f))
2.0ms
(* (* PI f) 1/192)
0.0ms
(/ PI (/ 4 f))

series148.0ms

Counts
4 → 10
Calls

4 calls. Slowest were:

51.0ms
(* (* PI f) (* PI f))
49.0ms
(* (* PI f) 1/192)
48.0ms
(/ PI (/ 4 f))
0.0ms
(pow PI 5)

simplify881.0ms

Counts
20 → 58
Calls

20 calls. Slowest were:

618.0ms
(* (* (* (* PI f) (* PI f)) (* PI f)) (* (* (* PI f) (* PI f)) (* PI f)))
182.0ms
(- (/ (log (/ (+ (exp (* (- f) (/ PI 4))) (exp (/ PI (/ 4 f)))) (+ (* (* (* PI f) 1/192) (* (* PI f) (* PI f))) (+ (* (pow f 5) (* (pow PI 5) 1/61440)) (* PI (* 1/2 f)))))) (/ PI 4)))
11.0ms
(+ (log (* PI f)) (log (* PI f)))

prune1.5s

Pruning

7 alts after pruning (5 fresh and 2 done)

Merged error: 0.0b

regimes292.0ms

Accuracy

0% (0.5b remaining)

Error of 0.7b against oracle of 0.1b and baseline of 0.7b

bsearch7.0ms