Average Error: 14.6 → 0.8
Time: 14.9s
Precision: 64
Internal Precision: 128
\[\frac{x}{x \cdot x + 1}\]
\[\left(\sqrt[3]{\frac{x}{\sqrt{1^2 + x^2}^*}} \cdot \sqrt[3]{\frac{x}{\sqrt{1^2 + x^2}^*}}\right) \cdot \frac{\sqrt[3]{\frac{x}{\sqrt{1^2 + x^2}^*}}}{\sqrt{1^2 + x^2}^*}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original14.6
Target0.1
Herbie0.8
\[\frac{1}{x + \frac{1}{x}}\]

Derivation

  1. Initial program 14.6

    \[\frac{x}{x \cdot x + 1}\]
  2. Initial simplification14.6

    \[\leadsto \frac{x}{(x \cdot x + 1)_*}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt14.6

    \[\leadsto \frac{x}{\color{blue}{\sqrt{(x \cdot x + 1)_*} \cdot \sqrt{(x \cdot x + 1)_*}}}\]
  5. Applied associate-/r*14.5

    \[\leadsto \color{blue}{\frac{\frac{x}{\sqrt{(x \cdot x + 1)_*}}}{\sqrt{(x \cdot x + 1)_*}}}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity14.5

    \[\leadsto \frac{\frac{x}{\sqrt{(x \cdot x + 1)_*}}}{\color{blue}{1 \cdot \sqrt{(x \cdot x + 1)_*}}}\]
  8. Applied add-cube-cbrt15.3

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\frac{x}{\sqrt{(x \cdot x + 1)_*}}} \cdot \sqrt[3]{\frac{x}{\sqrt{(x \cdot x + 1)_*}}}\right) \cdot \sqrt[3]{\frac{x}{\sqrt{(x \cdot x + 1)_*}}}}}{1 \cdot \sqrt{(x \cdot x + 1)_*}}\]
  9. Applied times-frac15.3

    \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{x}{\sqrt{(x \cdot x + 1)_*}}} \cdot \sqrt[3]{\frac{x}{\sqrt{(x \cdot x + 1)_*}}}}{1} \cdot \frac{\sqrt[3]{\frac{x}{\sqrt{(x \cdot x + 1)_*}}}}{\sqrt{(x \cdot x + 1)_*}}}\]
  10. Simplified15.3

    \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{x}{\sqrt{1^2 + x^2}^*}} \cdot \sqrt[3]{\frac{x}{\sqrt{1^2 + x^2}^*}}\right)} \cdot \frac{\sqrt[3]{\frac{x}{\sqrt{(x \cdot x + 1)_*}}}}{\sqrt{(x \cdot x + 1)_*}}\]
  11. Simplified0.8

    \[\leadsto \left(\sqrt[3]{\frac{x}{\sqrt{1^2 + x^2}^*}} \cdot \sqrt[3]{\frac{x}{\sqrt{1^2 + x^2}^*}}\right) \cdot \color{blue}{\frac{\sqrt[3]{\frac{x}{\sqrt{1^2 + x^2}^*}}}{\sqrt{1^2 + x^2}^*}}\]
  12. Final simplification0.8

    \[\leadsto \left(\sqrt[3]{\frac{x}{\sqrt{1^2 + x^2}^*}} \cdot \sqrt[3]{\frac{x}{\sqrt{1^2 + x^2}^*}}\right) \cdot \frac{\sqrt[3]{\frac{x}{\sqrt{1^2 + x^2}^*}}}{\sqrt{1^2 + x^2}^*}\]

Reproduce

herbie shell --seed 2018365 +o rules:numerics
(FPCore (x)
  :name "x / (x^2 + 1)"

  :herbie-target
  (/ 1 (+ x (/ 1 x)))

  (/ x (+ (* x x) 1)))

Details

Time bar (total: 12.9s)Debug log

start24.0ms

Algorithm
intervals

setup23.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 17.7b

localize14.0ms

Local error

Found 1 expressions with local error:

17.7b
(/ x (fma x x 1))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
Calls

1 calls. Slowest were:

1.0ms
(/ x (fma x x 1))

series38.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

38.0ms
(/ x (fma x x 1))

simplify171.0ms

Counts
6 → 18
Calls

6 calls. Slowest were:

62.0ms
(- (+ (/ 1 (pow x 5)) (/ 1 x)) (/ 1 (pow x 3)))
57.0ms
(- (+ (/ 1 (pow x 5)) (/ 1 x)) (/ 1 (pow x 3)))
42.0ms
(- (+ x (pow x 5)) (pow x 3))

prune144.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0b

localize7.0ms

Local error

Found 4 expressions with local error:

17.7b
(sqrt (fma x x 1))
17.7b
(sqrt (fma x x 1))
0.0b
(/ (/ x (sqrt (fma x x 1))) (sqrt (fma x x 1)))
0.0b
(/ x (sqrt (fma x x 1)))

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
4 → 95
Calls

4 calls. Slowest were:

9.0ms
(/ (/ x (sqrt (fma x x 1))) (sqrt (fma x x 1)))
1.0ms
(/ x (sqrt (fma x x 1)))
1.0ms
(sqrt (fma x x 1))

series160.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

50.0ms
(/ x (sqrt (fma x x 1)))
38.0ms
(sqrt (fma x x 1))
36.0ms
(/ (/ x (sqrt (fma x x 1))) (sqrt (fma x x 1)))
36.0ms
(sqrt (fma x x 1))

simplify2.5s

Counts
84 → 107
Calls

84 calls. Slowest were:

268.0ms
(- (* 1/8 (/ 1 (pow x 3))) (+ x (* 1/2 (/ 1 x))))
256.0ms
(/ (* (* (/ x (sqrt (fma x x 1))) (/ x (sqrt (fma x x 1)))) (/ x (sqrt (fma x x 1)))) (* (* (sqrt (fma x x 1)) (sqrt (fma x x 1))) (sqrt (fma x x 1))))
231.0ms
(- (+ x (* 1/2 (/ 1 x))) (* 1/8 (/ 1 (pow x 3))))

prune1.0s

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize15.0ms

Local error

Found 4 expressions with local error:

0.3b
(cbrt (/ x (hypot 1 x)))
0.3b
(cbrt (/ x (hypot 1 x)))
0.3b
(cbrt (/ x (hypot 1 x)))
0.2b
(* (cbrt (/ x (hypot 1 x))) (cbrt (/ x (hypot 1 x))))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 80
Calls

4 calls. Slowest were:

5.0ms
(* (cbrt (/ x (hypot 1 x))) (cbrt (/ x (hypot 1 x))))
1.0ms
(cbrt (/ x (hypot 1 x)))
1.0ms
(cbrt (/ x (hypot 1 x)))

series720.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

189.0ms
(cbrt (/ x (hypot 1 x)))
187.0ms
(* (cbrt (/ x (hypot 1 x))) (cbrt (/ x (hypot 1 x))))
183.0ms
(cbrt (/ x (hypot 1 x)))
161.0ms
(cbrt (/ x (hypot 1 x)))

simplify1.7s

Counts
53 → 92
Calls

53 calls. Slowest were:

263.0ms
(- (+ (* 2/9 (/ (pow (cbrt -1) 2) (pow x 4))) (pow (cbrt -1) 2)) (* 1/3 (/ (pow (cbrt -1) 2) (pow x 2))))
213.0ms
(- (+ (cbrt -1) (* 7/72 (/ (cbrt -1) (pow x 4)))) (* 1/6 (/ (cbrt -1) (pow x 2))))
177.0ms
(- (+ (cbrt -1) (* 7/72 (/ (cbrt -1) (pow x 4)))) (* 1/6 (/ (cbrt -1) (pow x 2))))

prune1.1s

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize12.0ms

Local error

Found 4 expressions with local error:

11.5b
(* (/ x (sqrt (hypot 1 x))) (/ (/ 1 (hypot 1 x)) (sqrt (hypot 1 x))))
0.3b
(/ x (sqrt (hypot 1 x)))
0.1b
(/ (/ 1 (hypot 1 x)) (sqrt (hypot 1 x)))
0.0b
(/ 1 (hypot 1 x))

rewrite27.0ms

Algorithm
rewrite-expression-head
Counts
4 → 139
Calls

4 calls. Slowest were:

12.0ms
(* (/ x (sqrt (hypot 1 x))) (/ (/ 1 (hypot 1 x)) (sqrt (hypot 1 x))))
8.0ms
(/ (/ 1 (hypot 1 x)) (sqrt (hypot 1 x)))
2.0ms
(/ 1 (hypot 1 x))

series179.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

54.0ms
(/ x (sqrt (hypot 1 x)))
43.0ms
(* (/ x (sqrt (hypot 1 x))) (/ (/ 1 (hypot 1 x)) (sqrt (hypot 1 x))))
42.0ms
(/ 1 (hypot 1 x))
40.0ms
(/ (/ 1 (hypot 1 x)) (sqrt (hypot 1 x)))

simplify3.4s

Counts
125 → 151
Calls

125 calls. Slowest were:

431.0ms
(/ (* (* (/ 1 (hypot 1 x)) (/ 1 (hypot 1 x))) (/ 1 (hypot 1 x))) (* (* (sqrt (hypot 1 x)) (sqrt (hypot 1 x))) (sqrt (hypot 1 x))))
426.0ms
(+ (log (/ x (sqrt (hypot 1 x)))) (log (/ (/ 1 (hypot 1 x)) (sqrt (hypot 1 x)))))
415.0ms
(+ (log (/ x (sqrt (hypot 1 x)))) (- (log (/ 1 (hypot 1 x))) (log (sqrt (hypot 1 x)))))

prune1.5s

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes28.0ms

Accuracy

0% (0.8b remaining)

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

bsearch2.0ms