Average Error: 42.7 → 9.4
Time: 45.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 -7.956170804997953 \cdot 10^{+113}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}} - \frac{\frac{2}{x}}{\sqrt{2}} \cdot \left(\frac{t}{x} + t\right)\right) - \sqrt{2} \cdot t}\\ \mathbf{elif}\;t \le 1.9387688460025505 \cdot 10^{-287}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right) + \left(\ell \cdot 2\right) \cdot \frac{\ell}{x}}}\\ \mathbf{elif}\;t \le 1.400368300731661 \cdot 10^{-160} \lor \neg \left(t \le 2.2573280091762418 \cdot 10^{+30}\right):\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{t \cdot \left(\sqrt{2} + \frac{\frac{2}{x}}{\sqrt{2}}\right) + \frac{\frac{\frac{2}{x}}{\sqrt{2}}}{x} \cdot \left(t - \frac{t}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(\sqrt{\sqrt[3]{\sqrt{2}}} \cdot t\right) \cdot \left|\sqrt[3]{\sqrt{2}}\right|\right) \cdot \sqrt{\sqrt{2}}}{\sqrt{\left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right) + \left(\ell \cdot 2\right) \cdot \frac{\ell}{x}}}\\ \end{array}\]

Error

Bits error versus x

Bits error versus l

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 4 regimes
  2. if t < -7.956170804997953e+113

    1. Initial program 52.7

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

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

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

    if -7.956170804997953e+113 < t < 1.9387688460025505e-287

    1. Initial program 37.3

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

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

      \[\leadsto \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\frac{\ell}{x} \cdot \left(\ell \cdot 2\right) + \left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right)}}}\]
    4. Taylor expanded around 0 12.7

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

    if 1.9387688460025505e-287 < t < 1.400368300731661e-160 or 2.2573280091762418e+30 < t

    1. Initial program 47.8

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

      \[\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. Simplified12.4

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

    if 1.400368300731661e-160 < t < 2.2573280091762418e+30

    1. Initial program 29.7

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

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

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

      \[\leadsto \frac{\color{blue}{\left(\sqrt{\sqrt{2}} \cdot \sqrt{\sqrt{2}}\right)} \cdot t}{\sqrt{\frac{\ell}{x} \cdot \left(\ell \cdot 2\right) + \left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right)}}\]
    6. Applied associate-*l*4.3

      \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot t\right)}}{\sqrt{\frac{\ell}{x} \cdot \left(\ell \cdot 2\right) + \left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right)}}\]
    7. Using strategy rm
    8. Applied add-cube-cbrt4.3

      \[\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{\frac{\ell}{x} \cdot \left(\ell \cdot 2\right) + \left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right)}}\]
    9. Applied sqrt-prod4.5

      \[\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{\frac{\ell}{x} \cdot \left(\ell \cdot 2\right) + \left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right)}}\]
    10. Applied associate-*l*4.2

      \[\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{\frac{\ell}{x} \cdot \left(\ell \cdot 2\right) + \left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right)}}\]
    11. Simplified4.2

      \[\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{\frac{\ell}{x} \cdot \left(\ell \cdot 2\right) + \left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right)}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification9.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -7.956170804997953 \cdot 10^{+113}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\left(\frac{t}{\left(x \cdot x\right) \cdot \sqrt{2}} - \frac{\frac{2}{x}}{\sqrt{2}} \cdot \left(\frac{t}{x} + t\right)\right) - \sqrt{2} \cdot t}\\ \mathbf{elif}\;t \le 1.9387688460025505 \cdot 10^{-287}:\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{\sqrt{\left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right) + \left(\ell \cdot 2\right) \cdot \frac{\ell}{x}}}\\ \mathbf{elif}\;t \le 1.400368300731661 \cdot 10^{-160} \lor \neg \left(t \le 2.2573280091762418 \cdot 10^{+30}\right):\\ \;\;\;\;\frac{\sqrt{2} \cdot t}{t \cdot \left(\sqrt{2} + \frac{\frac{2}{x}}{\sqrt{2}}\right) + \frac{\frac{\frac{2}{x}}{\sqrt{2}}}{x} \cdot \left(t - \frac{t}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(\sqrt{\sqrt[3]{\sqrt{2}}} \cdot t\right) \cdot \left|\sqrt[3]{\sqrt{2}}\right|\right) \cdot \sqrt{\sqrt{2}}}{\sqrt{\left(2 + \frac{4}{x}\right) \cdot \left(t \cdot t\right) + \left(\ell \cdot 2\right) \cdot \frac{\ell}{x}}}\\ \end{array}\]

Reproduce

herbie shell --seed 2018360 
(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: 29.9s)Debug log

start783.0ms

Algorithm
intervals

setup291.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 44.4b

localize40.0ms

Local error

Found 4 expressions with local error:

19.7b
(sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))
14.5b
(- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))
0.5b
(* (sqrt 2) t)
0.0b
(/ (* (sqrt 2) t) (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))))

rewrite60.0ms

Algorithm
rewrite-expression-head
Counts
4 → 66
Calls

4 calls. Slowest were:

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

series1.3s

Counts
4 → 12
Calls

4 calls. Slowest were:

860.0ms
(sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))
302.0ms
(/ (* (sqrt 2) t) (sqrt (- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))))
154.0ms
(- (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l))
32.0ms
(* (sqrt 2) t)

simplify7.7s

Counts
46 → 78
Calls

46 calls. Slowest were:

408.0ms
(sqrt (+ (* (/ (+ x 1) (- x 1)) (+ (* l l) (* 2 (* t t)))) (* l l)))
359.0ms
(- (* (sqrt -2) t) (+ (* 2 (/ (* t x) (sqrt -2))) (+ (* 2 (/ (* t (pow x 2)) (sqrt -2))) (* 2 (/ (* t (pow x 2)) (pow (sqrt -2) 3))))))
348.0ms
(- (+ (* 2 (/ t (* (sqrt 2) (pow x 2)))) (+ (* t (sqrt 2)) (* 2 (/ t (* (sqrt 2) x))))) (* 2 (/ t (* (pow (sqrt 2) 3) (pow x 2)))))

prune1.3s

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 5.2b

localize52.0ms

Local error

Found 4 expressions with local error:

28.1b
(sqrt (+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t))))
0.5b
(* (sqrt 2) t)
0.2b
(+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t)))
0.1b
(* (/ l x) (* l 2))

rewrite35.0ms

Algorithm
rewrite-expression-head
Counts
4 → 57
Calls

4 calls. Slowest were:

13.0ms
(+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t)))
10.0ms
(sqrt (+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t))))
7.0ms
(* (/ l x) (* l 2))

series331.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

244.0ms
(sqrt (+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t))))
51.0ms
(+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t)))
23.0ms
(* (sqrt 2) t)
12.0ms
(* (/ l x) (* l 2))

simplify3.2s

Counts
33 → 69
Calls

33 calls. Slowest were:

658.0ms
(* (* (* (/ l x) (/ l x)) (/ l x)) (* (* (* l 2) (* l 2)) (* l 2)))
484.0ms
(sqrt (+ (* (* l (* l 2)) (- 2 (/ 4 x))) (* x (* (- (* 2 2) (* (/ 4 x) (/ 4 x))) (* t t)))))
392.0ms
(+ (* (* l (* l 2)) (- 2 (/ 4 x))) (* x (* (- (* 2 2) (* (/ 4 x) (/ 4 x))) (* t t))))

prune1.1s

Pruning

11 alts after pruning (10 fresh and 1 done)

Merged error: 4.0b

localize21.0ms

Local error

Found 4 expressions with local error:

28.1b
(sqrt (+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t))))
0.3b
(* (sqrt (sqrt 2)) (* (sqrt (sqrt 2)) t))
0.2b
(* (sqrt (sqrt 2)) t)
0.2b
(+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t)))

rewrite23.0ms

Algorithm
rewrite-expression-head
Counts
4 → 61
Calls

4 calls. Slowest were:

8.0ms
(* (sqrt (sqrt 2)) (* (sqrt (sqrt 2)) t))
6.0ms
(+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t)))
5.0ms
(sqrt (+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t))))

series448.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

278.0ms
(sqrt (+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t))))
68.0ms
(* (sqrt (sqrt 2)) t)
62.0ms
(+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t)))
40.0ms
(* (sqrt (sqrt 2)) (* (sqrt (sqrt 2)) t))

simplify2.9s

Counts
38 → 73
Calls

38 calls. Slowest were:

502.0ms
(sqrt (+ (* (* l (* l 2)) (- 2 (/ 4 x))) (* x (* (- (* 2 2) (* (/ 4 x) (/ 4 x))) (* t t)))))
413.0ms
(* (* (* (sqrt (sqrt 2)) (sqrt (sqrt 2))) (sqrt (sqrt 2))) (* (* (* (sqrt (sqrt 2)) t) (* (sqrt (sqrt 2)) t)) (* (sqrt (sqrt 2)) t)))
406.0ms
(+ (* (* l (* l 2)) (- 2 (/ 4 x))) (* x (* (- (* 2 2) (* (/ 4 x) (/ 4 x))) (* t t))))

prune1.3s

Pruning

11 alts after pruning (10 fresh and 1 done)

Merged error: 4.0b

localize33.0ms

Local error

Found 4 expressions with local error:

28.1b
(sqrt (+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t))))
0.3b
(* (sqrt (cbrt (sqrt 2))) t)
0.3b
(* (fabs (cbrt (sqrt 2))) (* (sqrt (cbrt (sqrt 2))) t))
0.3b
(* (sqrt (sqrt 2)) (* (fabs (cbrt (sqrt 2))) (* (sqrt (cbrt (sqrt 2))) t)))

rewrite60.0ms

Algorithm
rewrite-expression-head
Counts
4 → 69
Calls

4 calls. Slowest were:

29.0ms
(* (sqrt (sqrt 2)) (* (fabs (cbrt (sqrt 2))) (* (sqrt (cbrt (sqrt 2))) t)))
15.0ms
(* (fabs (cbrt (sqrt 2))) (* (sqrt (cbrt (sqrt 2))) t))
9.0ms
(sqrt (+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t))))

series1.8s

Counts
4 → 12
Calls

4 calls. Slowest were:

655.0ms
(* (sqrt (sqrt 2)) (* (fabs (cbrt (sqrt 2))) (* (sqrt (cbrt (sqrt 2))) t)))
520.0ms
(* (fabs (cbrt (sqrt 2))) (* (sqrt (cbrt (sqrt 2))) t))
415.0ms
(* (sqrt (cbrt (sqrt 2))) t)
206.0ms
(sqrt (+ (* (/ l x) (* l 2)) (* (+ 2 (/ 4 x)) (* t t))))

simplify1.8s

Counts
45 → 81
Calls

45 calls. Slowest were:

436.0ms
(sqrt (+ (* (* l (* l 2)) (- 2 (/ 4 x))) (* x (* (- (* 2 2) (* (/ 4 x) (/ 4 x))) (* t t)))))
262.0ms
(* (* (* (fabs (cbrt (sqrt 2))) (fabs (cbrt (sqrt 2)))) (fabs (cbrt (sqrt 2)))) (* (* (* (sqrt (cbrt (sqrt 2))) t) (* (sqrt (cbrt (sqrt 2))) t)) (* (sqrt (cbrt (sqrt 2))) t)))
121.0ms
(sqrt (+ (* (* l (* l 2)) (+ (* 2 2) (- (* (/ 4 x) (/ 4 x)) (* 2 (/ 4 x))))) (* x (* (+ (pow 2 3) (pow (/ 4 x) 3)) (* t t)))))

prune1.8s

Pruning

11 alts after pruning (9 fresh and 2 done)

Merged error: 4.0b

regimes1.1s

Accuracy

73.2% (6.4b remaining)

Error of 9.4b against oracle of 2.9b and baseline of 27.0b

bsearch2.2s