Average Error: 13.3 → 0.2
Time: 41.5s
Precision: 64
Internal Precision: 128
\[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
\[\begin{array}{l} \mathbf{if}\;F \le -2.7343291591323734 \cdot 10^{+73}:\\ \;\;\;\;\left(\frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right) - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 13133.831615333233:\\ \;\;\;\;\left({\left(2 \cdot x + \left(2 + F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F\right) \cdot \frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{x}{\tan B}\\ \end{array}\]

Error

Bits error versus F

Bits error versus B

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if F < -2.7343291591323734e+73

    1. Initial program 29.5

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
    2. Initial simplification29.5

      \[\leadsto {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\]
    3. Using strategy rm
    4. Applied div-inv29.5

      \[\leadsto {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} - \frac{x}{\tan B}\]
    5. Applied associate-*r*23.8

      \[\leadsto \color{blue}{\left({\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F\right) \cdot \frac{1}{\sin B}} - \frac{x}{\tan B}\]
    6. Taylor expanded around -inf 0.1

      \[\leadsto \color{blue}{\left(\frac{1}{{F}^{2} \cdot \sin B} - \frac{1}{\sin B}\right)} - \frac{x}{\tan B}\]

    if -2.7343291591323734e+73 < F < 13133.831615333233

    1. Initial program 0.6

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
    2. Initial simplification0.5

      \[\leadsto {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\]
    3. Using strategy rm
    4. Applied div-inv0.5

      \[\leadsto {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} - \frac{x}{\tan B}\]
    5. Applied associate-*r*0.3

      \[\leadsto \color{blue}{\left({\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F\right) \cdot \frac{1}{\sin B}} - \frac{x}{\tan B}\]
    6. Using strategy rm
    7. Applied tan-quot0.3

      \[\leadsto \left({\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F\right) \cdot \frac{1}{\sin B} - \frac{x}{\color{blue}{\frac{\sin B}{\cos B}}}\]
    8. Applied associate-/r/0.3

      \[\leadsto \left({\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F\right) \cdot \frac{1}{\sin B} - \color{blue}{\frac{x}{\sin B} \cdot \cos B}\]

    if 13133.831615333233 < F

    1. Initial program 24.2

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\]
    2. Initial simplification24.2

      \[\leadsto {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\]
    3. Using strategy rm
    4. Applied div-inv24.2

      \[\leadsto {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} - \frac{x}{\tan B}\]
    5. Applied associate-*r*19.6

      \[\leadsto \color{blue}{\left({\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\frac{-1}{2}} \cdot F\right) \cdot \frac{1}{\sin B}} - \frac{x}{\tan B}\]
    6. Taylor expanded around inf 0.1

      \[\leadsto \color{blue}{\left(\frac{1}{\sin B} - \frac{1}{{F}^{2} \cdot \sin B}\right)} - \frac{x}{\tan B}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \le -2.7343291591323734 \cdot 10^{+73}:\\ \;\;\;\;\left(\frac{1}{\sin B \cdot {F}^{2}} - \frac{1}{\sin B}\right) - \frac{x}{\tan B}\\ \mathbf{elif}\;F \le 13133.831615333233:\\ \;\;\;\;\left({\left(2 \cdot x + \left(2 + F \cdot F\right)\right)}^{\frac{-1}{2}} \cdot F\right) \cdot \frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right) - \frac{x}{\tan B}\\ \end{array}\]

Reproduce

herbie shell --seed 2018360 
(FPCore (F B x)
  :name "VandenBroeck and Keller, Equation (23)"
  (+ (- (* x (/ 1 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2) (* 2 x)) (- (/ 1 2))))))

Details

Time bar (total: 17.0s)Debug log

start1.2s

Algorithm
intervals

setup187.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 11.8b

localize58.0ms

Local error

Found 4 expressions with local error:

14.7b
(pow (+ (+ 2 (* F F)) (* 2 x)) -1/2)
5.3b
(* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) (/ F (sin B)))
0.2b
(/ x (tan B))
0.1b
(/ F (sin B))

rewrite34.0ms

Algorithm
rewrite-expression-head
Counts
4 → 63
Calls

4 calls. Slowest were:

19.0ms
(* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) (/ F (sin B)))
10.0ms
(pow (+ (+ 2 (* F F)) (* 2 x)) -1/2)
1.0ms
(/ x (tan B))

series518.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

176.0ms
(* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) (/ F (sin B)))
169.0ms
(/ x (tan B))
107.0ms
(pow (+ (+ 2 (* F F)) (* 2 x)) -1/2)
65.0ms
(/ F (sin B))

simplify1.4s

Counts
38 → 75
Calls

38 calls. Slowest were:

246.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (* 1/2 (/ (* (pow F 3) (sqrt 1/8)) B)) (* 1/4 (/ (* x F) (* B (sqrt 1/2))))))
243.0ms
(- (pow 2 -1/2) (+ (* 1/2 (* (pow F 2) (sqrt 1/8))) (* 1/2 (* x (sqrt 1/2)))))
211.0ms
(* (* (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2)) (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2)) (* (* (/ F (sin B)) (/ F (sin B))) (/ F (sin B))))

prune1.4s

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 0.0b

localize27.0ms

Local error

Found 4 expressions with local error:

14.7b
(pow (+ (+ 2 (* F F)) (* 2 x)) -1/2)
0.4b
(* (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F) (/ 1 (sin B)))
0.3b
(* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)
0.2b
(/ x (tan B))

rewrite63.0ms

Algorithm
rewrite-expression-head
Counts
4 → 60
Calls

4 calls. Slowest were:

34.0ms
(* (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F) (/ 1 (sin B)))
19.0ms
(* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)
8.0ms
(pow (+ (+ 2 (* F F)) (* 2 x)) -1/2)

series409.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

143.0ms
(/ x (tan B))
128.0ms
(* (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F) (/ 1 (sin B)))
76.0ms
(pow (+ (+ 2 (* F F)) (* 2 x)) -1/2)
62.0ms
(* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)

simplify1.8s

Counts
37 → 72
Calls

37 calls. Slowest were:

403.0ms
(* (* (* (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F) (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)) (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)) (* (* (/ 1 (sin B)) (/ 1 (sin B))) (/ 1 (sin B))))
245.0ms
(- (* F (sqrt 1/2)) (+ (* 1/4 (/ (* x F) (sqrt 1/2))) (* 1/2 (* (pow F 3) (sqrt 1/8)))))
237.0ms
(- (pow 2 -1/2) (+ (* 1/2 (* (pow F 2) (sqrt 1/8))) (* 1/2 (* x (sqrt 1/2)))))

prune1.4s

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 0.0b

localize12.0ms

Local error

Found 4 expressions with local error:

14.7b
(pow (+ (+ 2 (* F F)) (* 2 x)) -1/2)
0.4b
(* (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F) (/ 1 (sin B)))
0.3b
(* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)
0.2b
(* (/ x (sin B)) (cos B))

rewrite54.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

21.0ms
(* (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F) (/ 1 (sin B)))
18.0ms
(* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)
10.0ms
(* (/ x (sin B)) (cos B))

series346.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

136.0ms
(* (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F) (/ 1 (sin B)))
107.0ms
(* (/ x (sin B)) (cos B))
62.0ms
(pow (+ (+ 2 (* F F)) (* 2 x)) -1/2)
41.0ms
(* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)

simplify1.8s

Counts
42 → 77
Calls

42 calls. Slowest were:

408.0ms
(* (* (* (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F) (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)) (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)) (* (* (/ 1 (sin B)) (/ 1 (sin B))) (/ 1 (sin B))))
266.0ms
(- (* F (sqrt 1/2)) (+ (* 1/4 (/ (* x F) (sqrt 1/2))) (* 1/2 (* (pow F 3) (sqrt 1/8)))))
210.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (* 1/2 (/ (* (pow F 3) (sqrt 1/8)) B)) (* 1/4 (/ (* x F) (* B (sqrt 1/2))))))

prune1.5s

Pruning

11 alts after pruning (10 fresh and 1 done)

Merged error: 0.0b

localize13.0ms

Local error

Found 4 expressions with local error:

14.7b
(pow (+ (+ 2 (* F F)) (* 2 x)) -1/2)
0.4b
(* (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F) (/ 1 (sin B)))
0.3b
(* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)
0.3b
(* x (* (/ 1 (sin B)) (cos B)))

rewrite60.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

29.0ms
(* (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F) (/ 1 (sin B)))
19.0ms
(* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)
7.0ms
(* x (* (/ 1 (sin B)) (cos B)))

series368.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

168.0ms
(* (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F) (/ 1 (sin B)))
102.0ms
(* x (* (/ 1 (sin B)) (cos B)))
60.0ms
(pow (+ (+ 2 (* F F)) (* 2 x)) -1/2)
38.0ms
(* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)

simplify1.7s

Counts
35 → 68
Calls

35 calls. Slowest were:

337.0ms
(* (* (* (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F) (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)) (* (pow (+ (+ 2 (* F F)) (* 2 x)) -1/2) F)) (* (* (/ 1 (sin B)) (/ 1 (sin B))) (/ 1 (sin B))))
248.0ms
(- (/ (* F (sqrt 1/2)) B) (+ (* 1/2 (/ (* (pow F 3) (sqrt 1/8)) B)) (* 1/4 (/ (* x F) (* B (sqrt 1/2))))))
206.0ms
(- (* F (sqrt 1/2)) (+ (* 1/4 (/ (* x F) (sqrt 1/2))) (* 1/2 (* (pow F 3) (sqrt 1/8)))))

prune1.3s

Pruning

11 alts after pruning (9 fresh and 2 done)

Merged error: 0.0b

regimes350.0ms

Accuracy

98.2% (0.2b remaining)

Error of 0.2b against oracle of 0.0b and baseline of 10.6b

bsearch1.0s