Average Error: 42.5 → 8.9
Time: 37.3s
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 -2.2874138410422343 \cdot 10^{+108}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{2} \cdot \left(-t\right) + \frac{t}{x \cdot \sqrt{2}} \cdot -2}\\ \mathbf{elif}\;t \le -8.041252291456426 \cdot 10^{-183}:\\ \;\;\;\;\frac{\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))_*}}\\ \mathbf{elif}\;t \le -2.492446204657259 \cdot 10^{-241}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{2} \cdot \left(-t\right) + \frac{t}{x \cdot \sqrt{2}} \cdot -2}\\ \mathbf{elif}\;t \le 1.0624348547098087 \cdot 10^{+57}:\\ \;\;\;\;\frac{\sqrt[3]{\sqrt{2}} \cdot \left(t \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\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))_*}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{\frac{2}{x}}{\sqrt{2}}\right) \cdot t + \left(\sqrt{2} \cdot t\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 < -2.2874138410422343e+108 or -8.041252291456426e-183 < t < -2.492446204657259e-241

    1. Initial program 54.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. Simplified54.0

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

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

    if -2.2874138410422343e+108 < t < -8.041252291456426e-183

    1. Initial program 28.6

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

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

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

      \[\leadsto \frac{t \cdot \sqrt{2}}{\sqrt{\color{blue}{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\left(t \cdot 4\right) \cdot \frac{t}{x}\right))_*}}}\]
    5. Using strategy rm
    6. Applied add-sqr-sqrt6.5

      \[\leadsto \frac{t \cdot \color{blue}{\left(\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}\right)}}{\sqrt{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\left(t \cdot 4\right) \cdot \frac{t}{x}\right))_*}}\]
    7. Applied associate-*r*6.4

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

    if -2.492446204657259e-241 < t < 1.0624348547098087e+57

    1. Initial program 42.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. Simplified42.9

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

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

      \[\leadsto \frac{t \cdot \sqrt{2}}{\sqrt{\color{blue}{(2 \cdot \left((\left(\frac{\ell}{x}\right) \cdot \ell + \left(t \cdot t\right))_*\right) + \left(\left(t \cdot 4\right) \cdot \frac{t}{x}\right))_*}}}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt16.5

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

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

    if 1.0624348547098087e+57 < t

    1. Initial program 44.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. Simplified44.1

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

      \[\leadsto \frac{t \cdot \sqrt{2}}{\color{blue}{t \cdot \sqrt{2} + 2 \cdot \frac{t}{\sqrt{2} \cdot x}}}\]
    4. Simplified3.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.2874138410422343 \cdot 10^{+108}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{2} \cdot \left(-t\right) + \frac{t}{x \cdot \sqrt{2}} \cdot -2}\\ \mathbf{elif}\;t \le -8.041252291456426 \cdot 10^{-183}:\\ \;\;\;\;\frac{\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))_*}}\\ \mathbf{elif}\;t \le -2.492446204657259 \cdot 10^{-241}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{2} \cdot \left(-t\right) + \frac{t}{x \cdot \sqrt{2}} \cdot -2}\\ \mathbf{elif}\;t \le 1.0624348547098087 \cdot 10^{+57}:\\ \;\;\;\;\frac{\sqrt[3]{\sqrt{2}} \cdot \left(t \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\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))_*}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{(\left(\frac{\frac{2}{x}}{\sqrt{2}}\right) \cdot t + \left(\sqrt{2} \cdot t\right))_*}\\ \end{array}\]

Reproduce

herbie shell --seed 2019005 +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.8s)Debug log

sample387.0ms

Algorithm
intervals

simplify932.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune30.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 39.8b

localize76.0ms

Local error

Found 4 expressions with local error:

16.7b
(sqrt (fma (fma (* 2 t) t (* l l)) (/ (+ 1 x) (+ -1 x)) (* l (- l))))
11.7b
(fma (fma (* 2 t) t (* l l)) (/ (+ 1 x) (+ -1 x)) (* l (- l)))
0.4b
(* t (sqrt 2))
0.1b
(/ (* t (sqrt 2)) (sqrt (fma (fma (* 2 t) t (* l l)) (/ (+ 1 x) (+ -1 x)) (* l (- l)))))

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
4 → 64
Calls

4 calls. Slowest were:

4.0ms
(/ (* t (sqrt 2)) (sqrt (fma (fma (* 2 t) t (* l l)) (/ (+ 1 x) (+ -1 x)) (* l (- l)))))
3.0ms
(sqrt (fma (fma (* 2 t) t (* l l)) (/ (+ 1 x) (+ -1 x)) (* l (- l))))
1.0ms
(* t (sqrt 2))

series615.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

340.0ms
(/ (* t (sqrt 2)) (sqrt (fma (fma (* 2 t) t (* l l)) (/ (+ 1 x) (+ -1 x)) (* l (- l)))))
158.0ms
(sqrt (fma (fma (* 2 t) t (* l l)) (/ (+ 1 x) (+ -1 x)) (* l (- l))))
80.0ms
(fma (fma (* 2 t) t (* l l)) (/ (+ 1 x) (+ -1 x)) (* l (- l)))
37.0ms
(* t (sqrt 2))

simplify11.8s

Counts
39 → 76
Calls

39 calls. Slowest were:

633.0ms
(sqrt (sqrt (fma (fma (* 2 t) t (* l l)) (/ (+ 1 x) (+ -1 x)) (* l (- l)))))
600.0ms
(/ (* (* (* t (sqrt 2)) (* t (sqrt 2))) (* t (sqrt 2))) (* (* (sqrt (fma (fma (* 2 t) t (* l l)) (/ (+ 1 x) (+ -1 x)) (* l (- l)))) (sqrt (fma (fma (* 2 t) t (* l l)) (/ (+ 1 x) (+ -1 x)) (* l (- l))))) (sqrt (fma (fma (* 2 t) t (* l l)) (/ (+ 1 x) (+ -1 x)) (* l (- l))))))
591.0ms
(sqrt (fma (fma (* 2 t) t (* l l)) (/ (+ 1 x) (+ -1 x)) (* l (- l))))

prune1.3s

Pruning

6 alts after pruning (6 fresh and 0 done)

Merged error: 4.2b

localize47.0ms

Local error

Found 4 expressions with local error:

23.0b
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x))))
2.6b
(fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x)))
0.4b
(* t (sqrt 2))
0.1b
(* (* t 4) (/ t x))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
4 → 56
Calls

4 calls. Slowest were:

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

series369.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

243.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x))))
67.0ms
(fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x)))
39.0ms
(* t (sqrt 2))
20.0ms
(* (* t 4) (/ t x))

simplify1.3s

Counts
26 → 68
Calls

26 calls. Slowest were:

463.0ms
(* (* (* (* t 4) (* t 4)) (* t 4)) (* (* (/ t x) (/ t x)) (/ t x)))
140.0ms
(+ (* 2 (pow t 2)) (+ (* 2 (/ (pow l 2) x)) (* 4 (/ (pow t 2) x))))
137.0ms
(+ (* 2 (pow t 2)) (+ (* 2 (/ (pow l 2) x)) (* 4 (/ (pow t 2) x))))

prune1.0s

Pruning

10 alts after pruning (10 fresh and 0 done)

Merged error: 4.1b

localize14.0ms

Local error

Found 4 expressions with local error:

23.0b
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x))))
2.6b
(fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x)))
0.3b
(* (* t (* (cbrt (sqrt 2)) (cbrt (sqrt 2)))) (cbrt (sqrt 2)))
0.1b
(* (* t 4) (/ t x))

rewrite18.0ms

Algorithm
rewrite-expression-head
Counts
4 → 63
Calls

4 calls. Slowest were:

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

series348.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

242.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x))))
62.0ms
(fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x)))
32.0ms
(* (* t (* (cbrt (sqrt 2)) (cbrt (sqrt 2)))) (cbrt (sqrt 2)))
12.0ms
(* (* t 4) (/ t x))

simplify1.7s

Counts
32 → 75
Calls

32 calls. Slowest were:

572.0ms
(* (* (* (* t 4) (* t 4)) (* t 4)) (* (* (/ t x) (/ t x)) (/ t x)))
207.0ms
(* (* (* (* t (* (cbrt (sqrt 2)) (cbrt (sqrt 2)))) (* t (* (cbrt (sqrt 2)) (cbrt (sqrt 2))))) (* t (* (cbrt (sqrt 2)) (cbrt (sqrt 2))))) (sqrt 2))
149.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x))))

prune1.2s

Pruning

10 alts after pruning (9 fresh and 1 done)

Merged error: 4.1b

localize20.0ms

Local error

Found 4 expressions with local error:

23.0b
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x))))
2.6b
(fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x)))
0.3b
(* (* t (sqrt (sqrt 2))) (sqrt (sqrt 2)))
0.2b
(* t (sqrt (sqrt 2)))

rewrite20.0ms

Algorithm
rewrite-expression-head
Counts
4 → 60
Calls

4 calls. Slowest were:

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

series394.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

256.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x))))
58.0ms
(fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x)))
50.0ms
(* t (sqrt (sqrt 2)))
29.0ms
(* (* t (sqrt (sqrt 2))) (sqrt (sqrt 2)))

simplify1.0s

Counts
31 → 72
Calls

31 calls. Slowest were:

364.0ms
(* (* (* (* t (sqrt (sqrt 2))) (* t (sqrt (sqrt 2)))) (* t (sqrt (sqrt 2)))) (* (* (sqrt (sqrt 2)) (sqrt (sqrt 2))) (sqrt (sqrt 2))))
122.0ms
(sqrt (fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x))))
116.0ms
(sqrt (sqrt (fma 2 (fma (/ l x) l (* t t)) (* (* t 4) (/ t x)))))

prune1.0s

Pruning

10 alts after pruning (8 fresh and 2 done)

Merged error: 4.1b

regimes318.0ms

Accuracy

77.8% (5.3b remaining)

Error of 8.9b against oracle of 3.6b and baseline of 27.5b

bsearch2.6s

end0.0ms

sample9.2s

Algorithm
intervals