| Alternative 1 | |
|---|---|
| Accuracy | 79.4% |
| Cost | 14792 |

(FPCore (x l t) :precision binary64 (/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))
(FPCore (x l t)
:precision binary64
(let* ((t_1 (sqrt (/ (+ x -1.0) (+ x 1.0)))) (t_2 (/ (* l l) x)))
(if (<= t -1.2e-196)
(- t_1)
(if (<= t 2e-112)
(*
t
(/
(sqrt 2.0)
(sqrt (+ t_2 (+ t_2 (* 2.0 (+ (* t t) (/ (* t t) x))))))))
t_1))))double code(double x, double l, double t) {
return (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
double code(double x, double l, double t) {
double t_1 = sqrt(((x + -1.0) / (x + 1.0)));
double t_2 = (l * l) / x;
double tmp;
if (t <= -1.2e-196) {
tmp = -t_1;
} else if (t <= 2e-112) {
tmp = t * (sqrt(2.0) / sqrt((t_2 + (t_2 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
code = (sqrt(2.0d0) * t) / sqrt(((((x + 1.0d0) / (x - 1.0d0)) * ((l * l) + (2.0d0 * (t * t)))) - (l * l)))
end function
real(8) function code(x, l, t)
real(8), intent (in) :: x
real(8), intent (in) :: l
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(((x + (-1.0d0)) / (x + 1.0d0)))
t_2 = (l * l) / x
if (t <= (-1.2d-196)) then
tmp = -t_1
else if (t <= 2d-112) then
tmp = t * (sqrt(2.0d0) / sqrt((t_2 + (t_2 + (2.0d0 * ((t * t) + ((t * t) / x)))))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double l, double t) {
return (Math.sqrt(2.0) * t) / Math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)));
}
public static double code(double x, double l, double t) {
double t_1 = Math.sqrt(((x + -1.0) / (x + 1.0)));
double t_2 = (l * l) / x;
double tmp;
if (t <= -1.2e-196) {
tmp = -t_1;
} else if (t <= 2e-112) {
tmp = t * (Math.sqrt(2.0) / Math.sqrt((t_2 + (t_2 + (2.0 * ((t * t) + ((t * t) / x)))))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, l, t): return (math.sqrt(2.0) * t) / math.sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l)))
def code(x, l, t): t_1 = math.sqrt(((x + -1.0) / (x + 1.0))) t_2 = (l * l) / x tmp = 0 if t <= -1.2e-196: tmp = -t_1 elif t <= 2e-112: tmp = t * (math.sqrt(2.0) / math.sqrt((t_2 + (t_2 + (2.0 * ((t * t) + ((t * t) / x))))))) else: tmp = t_1 return tmp
function code(x, l, t) return Float64(Float64(sqrt(2.0) * t) / sqrt(Float64(Float64(Float64(Float64(x + 1.0) / Float64(x - 1.0)) * Float64(Float64(l * l) + Float64(2.0 * Float64(t * t)))) - Float64(l * l)))) end
function code(x, l, t) t_1 = sqrt(Float64(Float64(x + -1.0) / Float64(x + 1.0))) t_2 = Float64(Float64(l * l) / x) tmp = 0.0 if (t <= -1.2e-196) tmp = Float64(-t_1); elseif (t <= 2e-112) tmp = Float64(t * Float64(sqrt(2.0) / sqrt(Float64(t_2 + Float64(t_2 + Float64(2.0 * Float64(Float64(t * t) + Float64(Float64(t * t) / x)))))))); else tmp = t_1; end return tmp end
function tmp = code(x, l, t) tmp = (sqrt(2.0) * t) / sqrt(((((x + 1.0) / (x - 1.0)) * ((l * l) + (2.0 * (t * t)))) - (l * l))); end
function tmp_2 = code(x, l, t) t_1 = sqrt(((x + -1.0) / (x + 1.0))); t_2 = (l * l) / x; tmp = 0.0; if (t <= -1.2e-196) tmp = -t_1; elseif (t <= 2e-112) tmp = t * (sqrt(2.0) / sqrt((t_2 + (t_2 + (2.0 * ((t * t) + ((t * t) / x))))))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, l_, t_] := N[(N[(N[Sqrt[2.0], $MachinePrecision] * t), $MachinePrecision] / N[Sqrt[N[(N[(N[(N[(x + 1.0), $MachinePrecision] / N[(x - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] + N[(2.0 * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(l * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_, l_, t_] := Block[{t$95$1 = N[Sqrt[N[(N[(x + -1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(l * l), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t, -1.2e-196], (-t$95$1), If[LessEqual[t, 2e-112], N[(t * N[(N[Sqrt[2.0], $MachinePrecision] / N[Sqrt[N[(t$95$2 + N[(t$95$2 + N[(2.0 * N[(N[(t * t), $MachinePrecision] + N[(N[(t * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$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}}
\begin{array}{l}
t_1 := \sqrt{\frac{x + -1}{x + 1}}\\
t_2 := \frac{\ell \cdot \ell}{x}\\
\mathbf{if}\;t \leq -1.2 \cdot 10^{-196}:\\
\;\;\;\;-t_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-112}:\\
\;\;\;\;t \cdot \frac{\sqrt{2}}{\sqrt{t_2 + \left(t_2 + 2 \cdot \left(t \cdot t + \frac{t \cdot t}{x}\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
Results
if t < -1.2000000000000001e-196Initial program 32.9%
Simplified32.9%
[Start]32.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}}
\] |
|---|---|
associate-*r/ [<=]32.9% | \[ \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}}
\] |
fma-neg [=>]32.9% | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \ell \cdot \ell + 2 \cdot \left(t \cdot t\right), -\ell \cdot \ell\right)}}}
\] |
sub-neg [=>]32.9% | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{\color{blue}{x + \left(-1\right)}}, \ell \cdot \ell + 2 \cdot \left(t \cdot t\right), -\ell \cdot \ell\right)}}
\] |
metadata-eval [=>]32.9% | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + \color{blue}{-1}}, \ell \cdot \ell + 2 \cdot \left(t \cdot t\right), -\ell \cdot \ell\right)}}
\] |
+-commutative [=>]32.9% | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \color{blue}{2 \cdot \left(t \cdot t\right) + \ell \cdot \ell}, -\ell \cdot \ell\right)}}
\] |
fma-def [=>]32.9% | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}, -\ell \cdot \ell\right)}}
\] |
distribute-rgt-neg-in [=>]32.9% | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \color{blue}{\ell \cdot \left(-\ell\right)}\right)}}
\] |
Applied egg-rr73.7%
[Start]32.9% | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}
\] |
|---|---|
associate-*r/ [=>]32.9% | \[ \color{blue}{\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}}
\] |
metadata-eval [<=]32.9% | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + \color{blue}{\left(-1\right)}}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}
\] |
sub-neg [<=]32.9% | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{\color{blue}{x - 1}}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}
\] |
fma-udef [=>]32.9% | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \color{blue}{2 \cdot \left(t \cdot t\right) + \ell \cdot \ell}, \ell \cdot \left(-\ell\right)\right)}}
\] |
+-commutative [<=]32.9% | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \color{blue}{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}, \ell \cdot \left(-\ell\right)\right)}}
\] |
distribute-rgt-neg-out [=>]32.9% | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \ell \cdot \ell + 2 \cdot \left(t \cdot t\right), \color{blue}{-\ell \cdot \ell}\right)}}
\] |
fma-neg [<=]32.9% | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}}
\] |
*-commutative [=>]32.9% | \[ \frac{\color{blue}{t \cdot \sqrt{2}}}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
fma-neg [=>]32.9% | \[ \frac{t \cdot \sqrt{2}}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \ell \cdot \ell + 2 \cdot \left(t \cdot t\right), -\ell \cdot \ell\right)}}}
\] |
Taylor expanded in t around -inf 83.0%
Simplified83.0%
[Start]83.0% | \[ -1 \cdot \sqrt{\frac{x - 1}{1 + x}}
\] |
|---|---|
mul-1-neg [=>]83.0% | \[ \color{blue}{-\sqrt{\frac{x - 1}{1 + x}}}
\] |
sub-neg [=>]83.0% | \[ -\sqrt{\frac{\color{blue}{x + \left(-1\right)}}{1 + x}}
\] |
metadata-eval [=>]83.0% | \[ -\sqrt{\frac{x + \color{blue}{-1}}{1 + x}}
\] |
+-commutative [=>]83.0% | \[ -\sqrt{\frac{x + -1}{\color{blue}{x + 1}}}
\] |
+-commutative [<=]83.0% | \[ -\sqrt{\frac{x + -1}{\color{blue}{1 + x}}}
\] |
if -1.2000000000000001e-196 < t < 1.9999999999999999e-112Initial program 7.2%
Simplified7.2%
[Start]7.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}}
\] |
|---|---|
associate-*l/ [<=]7.2% | \[ \color{blue}{\frac{\sqrt{2}}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}} \cdot t}
\] |
Taylor expanded in x around inf 71.4%
Simplified71.4%
[Start]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\left(\frac{{\ell}^{2}}{x} + \left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right)\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}}} \cdot t
\] |
|---|---|
associate--l+ [=>]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\color{blue}{\frac{{\ell}^{2}}{x} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}}} \cdot t
\] |
unpow2 [=>]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\frac{\color{blue}{\ell \cdot \ell}}{x} + \left(\left(2 \cdot \frac{{t}^{2}}{x} + 2 \cdot {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
distribute-lft-out [=>]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(\color{blue}{2 \cdot \left(\frac{{t}^{2}}{x} + {t}^{2}\right)} - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
unpow2 [=>]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{\color{blue}{t \cdot t}}{x} + {t}^{2}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
unpow2 [=>]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + \color{blue}{t \cdot t}\right) - -1 \cdot \frac{{\ell}^{2} + 2 \cdot {t}^{2}}{x}\right)}} \cdot t
\] |
associate-*r/ [=>]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \color{blue}{\frac{-1 \cdot \left({\ell}^{2} + 2 \cdot {t}^{2}\right)}{x}}\right)}} \cdot t
\] |
mul-1-neg [=>]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \frac{\color{blue}{-\left({\ell}^{2} + 2 \cdot {t}^{2}\right)}}{x}\right)}} \cdot t
\] |
unpow2 [=>]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \frac{-\left(\color{blue}{\ell \cdot \ell} + 2 \cdot {t}^{2}\right)}{x}\right)}} \cdot t
\] |
fma-udef [<=]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \frac{-\color{blue}{\mathsf{fma}\left(\ell, \ell, 2 \cdot {t}^{2}\right)}}{x}\right)}} \cdot t
\] |
unpow2 [=>]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \frac{-\mathsf{fma}\left(\ell, \ell, 2 \cdot \color{blue}{\left(t \cdot t\right)}\right)}{x}\right)}} \cdot t
\] |
Taylor expanded in l around inf 71.4%
Simplified71.4%
[Start]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - -1 \cdot \frac{{\ell}^{2}}{x}\right)}} \cdot t
\] |
|---|---|
associate-*r/ [=>]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \color{blue}{\frac{-1 \cdot {\ell}^{2}}{x}}\right)}} \cdot t
\] |
mul-1-neg [=>]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \frac{\color{blue}{-{\ell}^{2}}}{x}\right)}} \cdot t
\] |
unpow2 [=>]71.4% | \[ \frac{\sqrt{2}}{\sqrt{\frac{\ell \cdot \ell}{x} + \left(2 \cdot \left(\frac{t \cdot t}{x} + t \cdot t\right) - \frac{-\color{blue}{\ell \cdot \ell}}{x}\right)}} \cdot t
\] |
if 1.9999999999999999e-112 < t Initial program 45.8%
Simplified45.7%
[Start]45.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}}
\] |
|---|---|
associate-*r/ [<=]45.7% | \[ \color{blue}{\sqrt{2} \cdot \frac{t}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}}
\] |
fma-neg [=>]45.7% | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \ell \cdot \ell + 2 \cdot \left(t \cdot t\right), -\ell \cdot \ell\right)}}}
\] |
sub-neg [=>]45.7% | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{\color{blue}{x + \left(-1\right)}}, \ell \cdot \ell + 2 \cdot \left(t \cdot t\right), -\ell \cdot \ell\right)}}
\] |
metadata-eval [=>]45.7% | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + \color{blue}{-1}}, \ell \cdot \ell + 2 \cdot \left(t \cdot t\right), -\ell \cdot \ell\right)}}
\] |
+-commutative [=>]45.7% | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \color{blue}{2 \cdot \left(t \cdot t\right) + \ell \cdot \ell}, -\ell \cdot \ell\right)}}
\] |
fma-def [=>]45.7% | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \color{blue}{\mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right)}, -\ell \cdot \ell\right)}}
\] |
distribute-rgt-neg-in [=>]45.7% | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \color{blue}{\ell \cdot \left(-\ell\right)}\right)}}
\] |
Applied egg-rr84.6%
[Start]45.7% | \[ \sqrt{2} \cdot \frac{t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}
\] |
|---|---|
associate-*r/ [=>]45.8% | \[ \color{blue}{\frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + -1}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}}
\] |
metadata-eval [<=]45.8% | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x + \color{blue}{\left(-1\right)}}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}
\] |
sub-neg [<=]45.8% | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{\color{blue}{x - 1}}, \mathsf{fma}\left(2, t \cdot t, \ell \cdot \ell\right), \ell \cdot \left(-\ell\right)\right)}}
\] |
fma-udef [=>]45.8% | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \color{blue}{2 \cdot \left(t \cdot t\right) + \ell \cdot \ell}, \ell \cdot \left(-\ell\right)\right)}}
\] |
+-commutative [<=]45.8% | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \color{blue}{\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)}, \ell \cdot \left(-\ell\right)\right)}}
\] |
distribute-rgt-neg-out [=>]45.8% | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \ell \cdot \ell + 2 \cdot \left(t \cdot t\right), \color{blue}{-\ell \cdot \ell}\right)}}
\] |
fma-neg [<=]45.8% | \[ \frac{\sqrt{2} \cdot t}{\sqrt{\color{blue}{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}}
\] |
*-commutative [=>]45.8% | \[ \frac{\color{blue}{t \cdot \sqrt{2}}}{\sqrt{\frac{x + 1}{x - 1} \cdot \left(\ell \cdot \ell + 2 \cdot \left(t \cdot t\right)\right) - \ell \cdot \ell}}
\] |
fma-neg [=>]45.8% | \[ \frac{t \cdot \sqrt{2}}{\sqrt{\color{blue}{\mathsf{fma}\left(\frac{x + 1}{x - 1}, \ell \cdot \ell + 2 \cdot \left(t \cdot t\right), -\ell \cdot \ell\right)}}}
\] |
Taylor expanded in t around inf 91.8%
Final simplification84.3%
| Alternative 1 | |
|---|---|
| Accuracy | 79.4% |
| Cost | 14792 |
| Alternative 2 | |
|---|---|
| Accuracy | 78.7% |
| Cost | 14024 |
| Alternative 3 | |
|---|---|
| Accuracy | 78.0% |
| Cost | 13768 |
| Alternative 4 | |
|---|---|
| Accuracy | 77.7% |
| Cost | 7112 |
| Alternative 5 | |
|---|---|
| Accuracy | 78.1% |
| Cost | 7112 |
| Alternative 6 | |
|---|---|
| Accuracy | 77.5% |
| Cost | 7048 |
| Alternative 7 | |
|---|---|
| Accuracy | 75.7% |
| Cost | 6984 |
| Alternative 8 | |
|---|---|
| Accuracy | 76.2% |
| Cost | 968 |
| Alternative 9 | |
|---|---|
| Accuracy | 76.2% |
| Cost | 968 |
| Alternative 10 | |
|---|---|
| Accuracy | 75.8% |
| Cost | 452 |
| Alternative 11 | |
|---|---|
| Accuracy | 76.2% |
| Cost | 452 |
| Alternative 12 | |
|---|---|
| Accuracy | 75.5% |
| Cost | 196 |
| Alternative 13 | |
|---|---|
| Accuracy | 38.0% |
| Cost | 64 |
herbie shell --seed 2023256
(FPCore (x l t)
:name "Toniolo and Linder, Equation (7)"
:precision binary64
(/ (* (sqrt 2.0) t) (sqrt (- (* (/ (+ x 1.0) (- x 1.0)) (+ (* l l) (* 2.0 (* t t)))) (* l l)))))