Average Error: 31.1 → 0.0
Time: 26.5s
Precision: 64
Internal Precision: 128
\[\frac{x - \sin x}{x - \tan x}\]
\[\begin{array}{l} \mathbf{if}\;x \le -0.02783012588450388:\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\ \mathbf{elif}\;x \le 0.028560118651481507:\\ \;\;\;\;\left(\frac{9}{40} \cdot {x}^{2} - \frac{27}{2800} \cdot {x}^{4}\right) - \frac{1}{2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\left(\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\right) \cdot \left(\left(\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\right) \cdot \left(\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\right)\right)}\\ \end{array}\]

Error

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 x < -0.02783012588450388

    1. Initial program 0.0

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied div-sub0.0

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\]

    if -0.02783012588450388 < x < 0.028560118651481507

    1. Initial program 62.8

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied div-sub62.7

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\]
    4. Taylor expanded around 0 0.0

      \[\leadsto \color{blue}{\frac{9}{40} \cdot {x}^{2} - \left(\frac{27}{2800} \cdot {x}^{4} + \frac{1}{2}\right)}\]
    5. Using strategy rm
    6. Applied associate--r+0.0

      \[\leadsto \color{blue}{\left(\frac{9}{40} \cdot {x}^{2} - \frac{27}{2800} \cdot {x}^{4}\right) - \frac{1}{2}}\]

    if 0.028560118651481507 < x

    1. Initial program 0.1

      \[\frac{x - \sin x}{x - \tan x}\]
    2. Using strategy rm
    3. Applied div-sub0.0

      \[\leadsto \color{blue}{\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}}\]
    4. Using strategy rm
    5. Applied add-cbrt-cube0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -0.02783012588450388:\\ \;\;\;\;\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\\ \mathbf{elif}\;x \le 0.028560118651481507:\\ \;\;\;\;\left(\frac{9}{40} \cdot {x}^{2} - \frac{27}{2800} \cdot {x}^{4}\right) - \frac{1}{2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\left(\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\right) \cdot \left(\left(\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\right) \cdot \left(\frac{x}{x - \tan x} - \frac{\sin x}{x - \tan x}\right)\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2019004 
(FPCore (x)
  :name "sintan (problem 3.4.5)"
  (/ (- x (sin x)) (- x (tan x))))

Details

Time bar (total: 25.9s)Debug log

sample660.0ms

Algorithm
intervals

simplify14.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

14.0ms
(/ (- x (sin x)) (- x (tan x)))

prune6.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 27.6b

localize18.0ms

Local error

Found 3 expressions with local error:

2.2b
(- x (sin x))
2.1b
(- x (tan x))
0.0b
(/ (- x (sin x)) (- x (tan x)))

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
3 → 54
Calls

3 calls. Slowest were:

6.0ms
(/ (- x (sin x)) (- x (tan x)))
2.0ms
(- x (sin x))
1.0ms
(- x (tan x))

series619.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

441.0ms
(/ (- x (sin x)) (- x (tan x)))
91.0ms
(- x (tan x))
87.0ms
(- x (sin x))

simplify1.1s

Counts
39 → 63
Calls

39 calls. Slowest were:

206.0ms
(- (+ 1 (+ (/ (pow (sin x) 2) (* (pow (cos x) 2) (pow x 2))) (/ (sin x) (* (cos x) x)))) (+ (/ (sin x) x) (/ (pow (sin x) 2) (* (cos x) (pow x 2)))))
193.0ms
(- (+ 1 (+ (/ (pow (sin x) 2) (* (pow (cos x) 2) (pow x 2))) (/ (sin x) (* (cos x) x)))) (+ (/ (sin x) x) (/ (pow (sin x) 2) (* (cos x) (pow x 2)))))
170.0ms
(/ (* (* (- x (sin x)) (- x (sin x))) (- x (sin x))) (* (* (- x (tan x)) (- x (tan x))) (- x (tan x))))

prune487.0ms

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.1b

localize8.0ms

Local error

Found 4 expressions with local error:

2.1b
(- x (tan x))
2.1b
(- x (tan x))
1.8b
(- (/ x (- x (tan x))) (/ (sin x) (- x (tan x))))
0.1b
(/ (sin x) (- x (tan x)))

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
4 → 71
Calls

4 calls. Slowest were:

6.0ms
(- (/ x (- x (tan x))) (/ (sin x) (- x (tan x))))
3.0ms
(/ (sin x) (- x (tan x)))
0.0ms
(- x (tan x))

series492.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

263.0ms
(- (/ x (- x (tan x))) (/ (sin x) (- x (tan x))))
80.0ms
(/ (sin x) (- x (tan x)))
75.0ms
(- x (tan x))
73.0ms
(- x (tan x))

simplify2.3s

Counts
55 → 83
Calls

55 calls. Slowest were:

336.0ms
(/ (* (* (sin x) (sin x)) (sin x)) (* (* (- x (tan x)) (- x (tan x))) (- x (tan x))))
261.0ms
(- (* x (- x (tan x))) (* (- x (tan x)) (sin x)))
211.0ms
(- (+ 1 (+ (/ (pow (sin x) 2) (* (pow (cos x) 2) (pow x 2))) (/ (sin x) (* (cos x) x)))) (+ (/ (sin x) x) (/ (pow (sin x) 2) (* (cos x) (pow x 2)))))

prune786.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.1b

localize11.0ms

Local error

Found 4 expressions with local error:

2.1b
(- x (tan x))
2.1b
(- x (tan x))
2.1b
(- x (tan x))
2.1b
(- x (tan x))

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
4 → 44
Calls

4 calls. Slowest were:

1.0ms
(- x (tan x))
0.0ms
(- x (tan x))
0.0ms
(- x (tan x))

series221.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

58.0ms
(- x (tan x))
56.0ms
(- x (tan x))
55.0ms
(- x (tan x))
52.0ms
(- x (tan x))

simplify543.0ms

Counts
12 → 56
Calls

12 calls. Slowest were:

152.0ms
(- (+ (* 1/3 (pow x 3)) (+ (* 2/15 (pow x 5)) (* 17/315 (pow x 7)))))
125.0ms
(- (+ (* 1/3 (pow x 3)) (+ (* 2/15 (pow x 5)) (* 17/315 (pow x 7)))))
112.0ms
(- (+ (* 1/3 (pow x 3)) (+ (* 2/15 (pow x 5)) (* 17/315 (pow x 7)))))

prune612.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.1b

localize41.0ms

Local error

Found 3 expressions with local error:

19.0b
(- (* 9/40 (pow x 2)) (+ (* 27/2800 (pow x 4)) 1/2))
0.1b
(* 9/40 (pow x 2))
0.1b
(* 27/2800 (pow x 4))

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
3 → 36
Calls

3 calls. Slowest were:

9.0ms
(- (* 9/40 (pow x 2)) (+ (* 27/2800 (pow x 4)) 1/2))
2.0ms
(* 9/40 (pow x 2))
2.0ms
(* 27/2800 (pow x 4))

series77.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

36.0ms
(- (* 9/40 (pow x 2)) (+ (* 27/2800 (pow x 4)) 1/2))
22.0ms
(* 27/2800 (pow x 4))
19.0ms
(* 9/40 (pow x 2))

simplify330.0ms

Counts
16 → 45
Calls

16 calls. Slowest were:

100.0ms
(/ (exp (* 9/40 (pow x 2))) (exp (+ (* 27/2800 (pow x 4)) 1/2)))
78.0ms
(- (* 9/40 (pow x 2)) (+ (* 27/2800 (pow x 4)) 1/2))
71.0ms
(- (* 9/40 (pow x 2)) (+ (* 27/2800 (pow x 4)) 1/2))

prune346.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.1b

regimes68.0ms

Accuracy

100% (0.0b remaining)

Error of 0.0b against oracle of 0.0b and baseline of 31.1b

bsearch123.0ms

end0.0ms

sample17.1s

Algorithm
intervals