Average Error: 42.3 → 8.8
Time: 47.8s
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 -1.8991559974493062 \cdot 10^{+144}:\\ \;\;\;\;\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.2089599269622543 \cdot 10^{-219}:\\ \;\;\;\;\frac{\left(t \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)}{\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{elif}\;t \le 7.867224010792714 \cdot 10^{-163} \lor \neg \left(t \le 1.6408045629768685 \cdot 10^{+121}\right):\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\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))_*}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(\left|\sqrt[3]{\sqrt{2}}\right| \cdot \left(\sqrt{\sqrt[3]{\sqrt{2}}} \cdot t\right)\right)}{\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))_*}}\\ \end{array}\]

Error

Bits error versus x

Bits error versus l

Bits error versus t

Derivation

  1. Split input into 4 regimes
  2. if t < -1.8991559974493062e+144

    1. Initial program 60.0

      \[\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.0

      \[\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. Simplified2.0

      \[\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 -1.8991559974493062e+144 < t < 4.2089599269622543e-219

    1. Initial program 37.5

      \[\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.5

      \[\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. Using strategy rm
    5. Applied add-cube-cbrt14.5

      \[\leadsto \frac{\color{blue}{\left(\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \sqrt[3]{\sqrt{2}}\right)} \cdot t}{\sqrt{(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))_*}}\]
    6. Applied associate-*l*14.5

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot t\right)}}{\sqrt{(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.2089599269622543e-219 < t < 7.867224010792714e-163 or 1.6408045629768685e+121 < t

    1. Initial program 55.9

      \[\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 7.8

      \[\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. Simplified7.8

      \[\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))_*}}\]

    if 7.867224010792714e-163 < t < 1.6408045629768685e+121

    1. Initial program 25.2

      \[\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 10.1

      \[\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. Simplified4.9

      \[\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. Using strategy rm
    5. Applied add-sqr-sqrt5.1

      \[\leadsto \frac{\color{blue}{\left(\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}\right)} \cdot t}{\sqrt{(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))_*}}\]
    6. Applied associate-*l*5.0

      \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}}{\sqrt{(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))_*}}\]
    7. Using strategy rm
    8. Applied add-cube-cbrt5.0

      \[\leadsto \frac{\sqrt{\sqrt{2}} \cdot \left(\sqrt{\color{blue}{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \sqrt[3]{\sqrt{2}}}} \cdot t\right)}{\sqrt{(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))_*}}\]
    9. Applied sqrt-prod5.1

      \[\leadsto \frac{\sqrt{\sqrt{2}} \cdot \left(\color{blue}{\left(\sqrt{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}} \cdot \sqrt{\sqrt[3]{\sqrt{2}}}\right)} \cdot t\right)}{\sqrt{(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))_*}}\]
    10. Applied associate-*l*4.9

      \[\leadsto \frac{\sqrt{\sqrt{2}} \cdot \color{blue}{\left(\sqrt{\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}} \cdot \left(\sqrt{\sqrt[3]{\sqrt{2}}} \cdot t\right)\right)}}{\sqrt{(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))_*}}\]
    11. Simplified4.9

      \[\leadsto \frac{\sqrt{\sqrt{2}} \cdot \left(\color{blue}{\left|\sqrt[3]{\sqrt{2}}\right|} \cdot \left(\sqrt{\sqrt[3]{\sqrt{2}}} \cdot t\right)\right)}{\sqrt{(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))_*}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification8.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.8991559974493062 \cdot 10^{+144}:\\ \;\;\;\;\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.2089599269622543 \cdot 10^{-219}:\\ \;\;\;\;\frac{\left(t \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right)}{\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{elif}\;t \le 7.867224010792714 \cdot 10^{-163} \lor \neg \left(t \le 1.6408045629768685 \cdot 10^{+121}\right):\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\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))_*}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\sqrt{2}} \cdot \left(\left|\sqrt[3]{\sqrt{2}}\right| \cdot \left(\sqrt{\sqrt[3]{\sqrt{2}}} \cdot t\right)\right)}{\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))_*}}\\ \end{array}\]

Reproduce

herbie shell --seed 2018365 +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: 31.7s)Debug log

start1.1s

Algorithm
intervals

setup587.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 42.8b

localize76.0ms

Local error

Found 4 expressions with local error:

19.7b
(sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))
14.0b
(- (* (/ (+ 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))))

rewrite47.0ms

Algorithm
rewrite-expression-head
Counts
4 → 76
Calls

4 calls. Slowest were:

21.0ms
(/ (* (sqrt 2) t) (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))))
12.0ms
(sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))
8.0ms
(- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))

series1.3s

Counts
4 → 12
Calls

4 calls. Slowest were:

902.0ms
(sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))
261.0ms
(/ (* (sqrt 2) t) (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))))
113.0ms
(- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))
32.0ms
(* (sqrt 2) t)

simplify14.9s

Counts
49 → 88
Calls

49 calls. Slowest were:

671.0ms
(cbrt (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))))
640.0ms
(sqrt (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))))
600.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.7s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 3.1b

localize47.0ms

Local error

Found 4 expressions with local error:

26.5b
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))
3.8b
(fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))
0.4b
(* (sqrt 2) t)
0.2b
(* (/ t x) (* t 4))

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

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

series353.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

229.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))
64.0ms
(fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))
40.0ms
(* (sqrt 2) t)
20.0ms
(* (/ t x) (* t 4))

simplify1.7s

Counts
24 → 68
Calls

24 calls. Slowest were:

922.0ms
(* (* (* (/ t x) (/ t x)) (/ t x)) (* (* (* t 4) (* t 4)) (* t 4)))
116.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))
116.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))))))

prune1.1s

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 3.1b

localize26.0ms

Local error

Found 4 expressions with local error:

26.5b
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))
3.8b
(fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))
0.2b
(* (* (cbrt (sqrt 2)) (cbrt (sqrt 2))) (* (cbrt (sqrt 2)) t))
0.2b
(* (cbrt (sqrt 2)) t)

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
4 → 58
Calls

4 calls. Slowest were:

16.0ms
(* (* (cbrt (sqrt 2)) (cbrt (sqrt 2))) (* (cbrt (sqrt 2)) t))
3.0ms
(* (cbrt (sqrt 2)) t)
2.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))

series773.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

456.0ms
(* (cbrt (sqrt 2)) t)
216.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))
60.0ms
(fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))
41.0ms
(* (* (cbrt (sqrt 2)) (cbrt (sqrt 2))) (* (cbrt (sqrt 2)) t))

simplify1.4s

Counts
28 → 70
Calls

28 calls. Slowest were:

473.0ms
(* (* (* (* (cbrt (sqrt 2)) (cbrt (sqrt 2))) (* (cbrt (sqrt 2)) (cbrt (sqrt 2)))) (* (cbrt (sqrt 2)) (cbrt (sqrt 2)))) (* (* (* (cbrt (sqrt 2)) t) (* (cbrt (sqrt 2)) t)) (* (cbrt (sqrt 2)) t)))
267.0ms
(* (* (sqrt 2) (sqrt 2)) (* (* (* (cbrt (sqrt 2)) t) (* (cbrt (sqrt 2)) t)) (* (cbrt (sqrt 2)) t)))
118.0ms
(+ (* 2 (pow t 2)) (+ (* 2 (/ (pow l 2) x)) (* 4 (/ (pow t 2) x))))

prune1.3s

Pruning

11 alts after pruning (10 fresh and 1 done)

Merged error: 3.1b

localize20.0ms

Local error

Found 4 expressions with local error:

26.5b
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))
3.8b
(fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))
0.3b
(* (sqrt (sqrt 2)) (* (sqrt (sqrt 2)) t))
0.3b
(* (sqrt (sqrt 2)) t)

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
4 → 60
Calls

4 calls. Slowest were:

8.0ms
(* (sqrt (sqrt 2)) (* (sqrt (sqrt 2)) t))
3.0ms
(* (sqrt (sqrt 2)) t)
1.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))

series320.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

214.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4))))
42.0ms
(* (sqrt (sqrt 2)) t)
39.0ms
(fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))
25.0ms
(* (sqrt (sqrt 2)) (* (sqrt (sqrt 2)) t))

simplify1.1s

Counts
29 → 72
Calls

29 calls. Slowest were:

472.0ms
(* (* (* (sqrt (sqrt 2)) (sqrt (sqrt 2))) (sqrt (sqrt 2))) (* (* (* (sqrt (sqrt 2)) t) (* (sqrt (sqrt 2)) t)) (* (sqrt (sqrt 2)) t)))
122.0ms
(sqrt (sqrt (fma 2 (fma (/ l x) l (* t t)) (* (/ t x) (* t 4)))))
111.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))))))

prune1.1s

Pruning

10 alts after pruning (8 fresh and 2 done)

Merged error: 3.1b

regimes930.0ms

Accuracy

78.3% (5.0b remaining)

Error of 8.8b against oracle of 3.8b and baseline of 27.1b

bsearch1.8s