Average Error: 42.4 → 9.7
Time: 37.2s
Precision: 64
Internal Precision: 128
\[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\]
\[\begin{array}{l} \mathbf{if}\;t \le -6.654487547109705 \cdot 10^{+20}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{t}{x \cdot x}\right) \cdot \left(\frac{1}{\sqrt{2}} - \frac{2}{\sqrt{2}}\right) + \left((\left(\frac{2}{x}\right) \cdot \left(\frac{-t}{\sqrt{2}}\right) + \left(\left(-t\right) \cdot \sqrt{2}\right))_*\right))_*}\\ \mathbf{elif}\;t \le 4.889623337220024 \cdot 10^{+113}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\left(4 \cdot t\right) \cdot \frac{t}{x}\right))_*}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{2}{\sqrt{2}}\right) \cdot \left(\frac{t}{x \cdot x} + \frac{t}{x}\right) + \left((\left(\frac{-1}{\sqrt{2}}\right) \cdot \left(\frac{t}{x \cdot x}\right) + \left(\sqrt{2} \cdot t\right))_*\right))_*}\\ \end{array}\]

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 3 regimes
  2. if t < -6.654487547109705e+20

    1. Initial program 42.4

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\]
    2. Taylor expanded around -inf 4.9

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}} - \left(2 \cdot \frac{t}{\sqrt{2} \cdot {x}^{2}} + \left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)\right)}}\]
    3. Simplified4.9

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{(\left(\frac{t}{x \cdot x}\right) \cdot \left(\frac{1}{\sqrt{2}} - \frac{2}{\sqrt{2}}\right) + \left((\left(\frac{2}{x}\right) \cdot \left(\frac{-t}{\sqrt{2}}\right) + \left(\left(-t\right) \cdot \sqrt{2}\right))_*\right))_*}}\]

    if -6.654487547109705e+20 < t < 4.889623337220024e+113

    1. Initial program 39.1

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\]
    2. Taylor expanded around inf 18.6

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot {t}^{2} + \left(2 \cdot \frac{{\ell}^{2}}{x} + 4 \cdot \frac{{t}^{2}}{x}\right)}}}\]
    3. Simplified14.4

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}}\]
    4. Taylor expanded around -inf 18.6

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{2 \cdot {t}^{2} + \left(2 \cdot \frac{{\ell}^{2}}{x} + 4 \cdot \frac{{t}^{2}}{x}\right)}}}\]
    5. Simplified14.4

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\frac{t}{x} \cdot \left(t \cdot 4\right)\right))_*}}}\]

    if 4.889623337220024e+113 < t

    1. Initial program 52.1

      \[\frac{\sqrt{2} \cdot t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}\]
    2. Taylor expanded around inf 2.9

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{\left(2 \cdot \frac{t}{\sqrt{2} \cdot {x}^{2}} + \left(t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}\right)\right) - 2 \cdot \frac{t}{{\left(\sqrt{2}\right)}^{3} \cdot {x}^{2}}}}\]
    3. Simplified2.9

      \[\leadsto \frac{\sqrt{2} \cdot t}{\color{blue}{(\left(\frac{2}{\sqrt{2}}\right) \cdot \left(\frac{t}{x} + \frac{t}{x \cdot x}\right) + \left((\left(\frac{-1}{\sqrt{2}}\right) \cdot \left(\frac{t}{x \cdot x}\right) + \left(\sqrt{2} \cdot t\right))_*\right))_*}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification9.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -6.654487547109705 \cdot 10^{+20}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{t}{x \cdot x}\right) \cdot \left(\frac{1}{\sqrt{2}} - \frac{2}{\sqrt{2}}\right) + \left((\left(\frac{2}{x}\right) \cdot \left(\frac{-t}{\sqrt{2}}\right) + \left(\left(-t\right) \cdot \sqrt{2}\right))_*\right))_*}\\ \mathbf{elif}\;t \le 4.889623337220024 \cdot 10^{+113}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\left(4 \cdot t\right) \cdot \frac{t}{x}\right))_*}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{2}{\sqrt{2}}\right) \cdot \left(\frac{t}{x \cdot x} + \frac{t}{x}\right) + \left((\left(\frac{-1}{\sqrt{2}}\right) \cdot \left(\frac{t}{x \cdot x}\right) + \left(\sqrt{2} \cdot t\right))_*\right))_*}\\ \end{array}\]

Reproduce

herbie shell --seed 2019008 +o rules:numerics
(FPCore (x l t)
  :name "Toniolo and Linder, Equation (7)"
  (/ (* (sqrt 2) t) (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))))

Details

Time bar (total: 35.7s)Debug log

sample483.0ms

Algorithm
intervals

simplify542.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

541.0ms
(/ (* (sqrt 2) t) (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))))

prune39.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 43.6b

localize70.0ms

Local error

Found 4 expressions with local error:

22.9b
(sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))
12.6b
(- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))
0.4b
(* (sqrt 2) t)
0.0b
(/ (* (sqrt 2) t) (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))))

rewrite75.0ms

Algorithm
rewrite-expression-head
Counts
4 → 76
Calls

4 calls. Slowest were:

38.0ms
(/ (* (sqrt 2) t) (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))))
17.0ms
(- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))
13.0ms
(sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))

series1.3s

Counts
4 → 12
Calls

4 calls. Slowest were:

863.0ms
(sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))
280.0ms
(/ (* (sqrt 2) t) (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))))
119.0ms
(- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))
32.0ms
(* (sqrt 2) t)

simplify13.6s

Counts
49 → 88
Calls

49 calls. Slowest were:

974.0ms
(sqrt (+ (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))
543.0ms
(/ (sqrt 2) (sqrt (* (cbrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))) (cbrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))))))
533.0ms
(/ (sqrt 2) (* (cbrt (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))) (cbrt (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))))))

prune1.2s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 3.2b

localize45.0ms

Local error

Found 4 expressions with local error:

29.0b
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))
4.8b
(fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))
0.4b
(* (sqrt 2) t)
0.1b
(* (/ t x) (* t 4))

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

7.0ms
(* (/ t x) (* t 4))
4.0ms
(* (sqrt 2) t)
2.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))

series396.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

294.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))
49.0ms
(fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))
41.0ms
(* (sqrt 2) t)
12.0ms
(* (/ t x) (* t 4))

simplify1.3s

Counts
24 → 68
Calls

24 calls. Slowest were:

571.0ms
(* (* (* (/ t x) (/ t x)) (/ t x)) (* (* (* t 4) (* t 4)) (* t 4)))
105.0ms
(sqrt (* (cbrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))) (cbrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))))
100.0ms
(+ (* 2 (pow t 2)) (+ (* 2 (/ (pow l 2) x)) (* 4 (/ (pow t 2) x))))

prune964.0ms

Pruning

11 alts after pruning (11 fresh and 0 done)

Merged error: 3.1b

localize1.0ms

Local error

Found 4 expressions with local error:

29.0b
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))
4.8b
(fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))
0.4b
(* (sqrt 2) t)
0.1b
(* (/ t x) (* t 4))

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

6.0ms
(* (/ t x) (* t 4))
2.0ms
(* (sqrt 2) t)
1.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))

series325.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

247.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))
41.0ms
(fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))
24.0ms
(* (sqrt 2) t)
12.0ms
(* (/ t x) (* t 4))

simplify1.5s

Counts
24 → 68
Calls

24 calls. Slowest were:

635.0ms
(* (* (* (/ t x) (/ t x)) (/ t x)) (* (* (* t 4) (* t 4)) (* t 4)))
149.0ms
(sqrt (sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))))
136.0ms
(+ (* 2 (pow t 2)) (+ (* 2 (/ (pow l 2) x)) (* 4 (/ (pow t 2) x))))

prune1.0s

Pruning

11 alts after pruning (10 fresh and 1 done)

Merged error: 3.1b

localize22.0ms

Local error

Found 4 expressions with local error:

29.0b
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))
4.8b
(fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))
0.4b
(* (sqrt (sqrt 2)) (* (sqrt (sqrt 2)) t))
0.2b
(* (sqrt (sqrt 2)) t)

rewrite26.0ms

Algorithm
rewrite-expression-head
Counts
4 → 60
Calls

4 calls. Slowest were:

17.0ms
(* (sqrt (sqrt 2)) (* (sqrt (sqrt 2)) t))
6.0ms
(* (sqrt (sqrt 2)) t)
2.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))

series394.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

264.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))
54.0ms
(fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))
50.0ms
(* (sqrt (sqrt 2)) t)
25.0ms
(* (sqrt (sqrt 2)) (* (sqrt (sqrt 2)) t))

simplify937.0ms

Counts
29 → 72
Calls

29 calls. Slowest were:

312.0ms
(* (* (* (sqrt (sqrt 2)) (sqrt (sqrt 2))) (sqrt (sqrt 2))) (* (* (* (sqrt (sqrt 2)) t) (* (sqrt (sqrt 2)) t)) (* (sqrt (sqrt 2)) t)))
116.0ms
(sqrt (sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))))
106.0ms
(+ (* 2 (pow t 2)) (+ (* 2 (/ (pow l 2) x)) (* 4 (/ (pow t 2) x))))

prune951.0ms

Pruning

9 alts after pruning (8 fresh and 1 done)

Merged error: 3.1b

regimes813.0ms

Accuracy

75.5% (5.7b remaining)

Error of 9.7b against oracle of 4.0b and baseline of 27.3b

bsearch917.0ms

end0.0ms

sample8.8s

Algorithm
intervals