
(FPCore (x y z)
:precision binary64
(/
(*
(- x 2.0)
(+
(*
(+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y)
x)
z))
(+
(* (+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894) x)
47.066876606)))
double code(double x, double y, double z) {
return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x - 2.0d0) * ((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)
end function
public static double code(double x, double y, double z) {
return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
def code(x, y, z): return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)
function code(x, y, z) return Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) end
function tmp = code(x, y, z) tmp = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606); end
code[x_, y_, z_] := N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z)
:precision binary64
(/
(*
(- x 2.0)
(+
(*
(+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y)
x)
z))
(+
(* (+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894) x)
47.066876606)))
double code(double x, double y, double z) {
return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = ((x - 2.0d0) * ((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z)) / (((((((x + 43.3400022514d0) * x) + 263.505074721d0) * x) + 313.399215894d0) * x) + 47.066876606d0)
end function
public static double code(double x, double y, double z) {
return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606);
}
def code(x, y, z): return ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)
function code(x, y, z) return Float64(Float64(Float64(x - 2.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)) end
function tmp = code(x, y, z) tmp = ((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606); end
code[x_, y_, z_] := N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x), $MachinePrecision] + 263.505074721), $MachinePrecision] * x), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514\right) \cdot x + 263.505074721\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606}
\end{array}
(FPCore (x y z)
:precision binary64
(if (<=
(/
(*
(- x 2.0)
(+
(*
x
(+
(* x (+ (* x (+ (* x 4.16438922228) 78.6994924154)) 137.519416416))
y))
z))
(+
47.066876606
(*
x
(+ 313.399215894 (* x (+ 263.505074721 (* x (+ x 43.3400022514))))))))
INFINITY)
(*
(+ x -2.0)
(/
(fma
x
(fma x (fma x (fma x 4.16438922228 78.6994924154) 137.519416416) y)
z)
(fma
x
(fma x (fma x (+ x 43.3400022514) 263.505074721) 313.399215894)
47.066876606)))
(/ (+ x -2.0) 0.24013125253755718)))
double code(double x, double y, double z) {
double tmp;
if ((((x - 2.0) * ((x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))))) <= ((double) INFINITY)) {
tmp = (x + -2.0) * (fma(x, fma(x, fma(x, fma(x, 4.16438922228, 78.6994924154), 137.519416416), y), z) / fma(x, fma(x, fma(x, (x + 43.3400022514), 263.505074721), 313.399215894), 47.066876606));
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (Float64(Float64(Float64(x - 2.0) * Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514)))))))) <= Inf) tmp = Float64(Float64(x + -2.0) * Float64(fma(x, fma(x, fma(x, fma(x, 4.16438922228, 78.6994924154), 137.519416416), y), z) / fma(x, fma(x, fma(x, Float64(x + 43.3400022514), 263.505074721), 313.399215894), 47.066876606))); else tmp = Float64(Float64(x + -2.0) / 0.24013125253755718); end return tmp end
code[x_, y_, z_] := If[LessEqual[N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(x * N[(N[(x * N[(N[(x * N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision]), $MachinePrecision] + 137.519416416), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(x * N[(x * N[(x * N[(x * 4.16438922228 + 78.6994924154), $MachinePrecision] + 137.519416416), $MachinePrecision] + y), $MachinePrecision] + z), $MachinePrecision] / N[(x * N[(x * N[(x * N[(x + 43.3400022514), $MachinePrecision] + 263.505074721), $MachinePrecision] + 313.399215894), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] / 0.24013125253755718), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right) + z\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)} \leq \infty:\\
\;\;\;\;\left(x + -2\right) \cdot \frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), 137.519416416\right), y\right), z\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, x + 43.3400022514, 263.505074721\right), 313.399215894\right), 47.066876606\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + -2}{0.24013125253755718}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x 2) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x 216700011257/5000000000) x) 263505074721/1000000000) x) 156699607947/500000000) x) 23533438303/500000000)) < +inf.0Initial program 92.0%
*-commutative92.0%
associate-*l/99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
if +inf.0 < (/.f64 (*.f64 (-.f64 x 2) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x 216700011257/5000000000) x) 263505074721/1000000000) x) 156699607947/500000000) x) 23533438303/500000000)) Initial program 0.0%
associate-/l*0.0%
sub-neg0.0%
metadata-eval0.0%
fma-def0.0%
fma-def0.0%
fma-def0.0%
fma-def0.0%
fma-def0.0%
fma-def0.0%
fma-def0.0%
Simplified0.0%
Taylor expanded in x around inf 99.7%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
47.066876606
(*
x
(+
313.399215894
(* x (+ 263.505074721 (* x (+ x 43.3400022514))))))))
(t_1
(*
x
(+
(* x (+ (* x (+ (* x 4.16438922228) 78.6994924154)) 137.519416416))
y)))
(t_2 (/ (* (- x 2.0) (+ t_1 z)) t_0)))
(if (<= t_2 (- INFINITY))
(/ (+ x -2.0) (/ t_0 t_1))
(if (<= t_2 1e+262)
t_2
(+ (* x 4.16438922228) (* z (- (/ x t_0) (/ 2.0 t_0))))))))
double code(double x, double y, double z) {
double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
double t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y);
double t_2 = ((x - 2.0) * (t_1 + z)) / t_0;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (x + -2.0) / (t_0 / t_1);
} else if (t_2 <= 1e+262) {
tmp = t_2;
} else {
tmp = (x * 4.16438922228) + (z * ((x / t_0) - (2.0 / t_0)));
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
double t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y);
double t_2 = ((x - 2.0) * (t_1 + z)) / t_0;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (x + -2.0) / (t_0 / t_1);
} else if (t_2 <= 1e+262) {
tmp = t_2;
} else {
tmp = (x * 4.16438922228) + (z * ((x / t_0) - (2.0 / t_0)));
}
return tmp;
}
def code(x, y, z): t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))) t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y) t_2 = ((x - 2.0) * (t_1 + z)) / t_0 tmp = 0 if t_2 <= -math.inf: tmp = (x + -2.0) / (t_0 / t_1) elif t_2 <= 1e+262: tmp = t_2 else: tmp = (x * 4.16438922228) + (z * ((x / t_0) - (2.0 / t_0))) return tmp
function code(x, y, z) t_0 = Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514))))))) t_1 = Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) t_2 = Float64(Float64(Float64(x - 2.0) * Float64(t_1 + z)) / t_0) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(x + -2.0) / Float64(t_0 / t_1)); elseif (t_2 <= 1e+262) tmp = t_2; else tmp = Float64(Float64(x * 4.16438922228) + Float64(z * Float64(Float64(x / t_0) - Float64(2.0 / t_0)))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))); t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y); t_2 = ((x - 2.0) * (t_1 + z)) / t_0; tmp = 0.0; if (t_2 <= -Inf) tmp = (x + -2.0) / (t_0 / t_1); elseif (t_2 <= 1e+262) tmp = t_2; else tmp = (x * 4.16438922228) + (z * ((x / t_0) - (2.0 / t_0))); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(N[(x * N[(N[(x * N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision]), $MachinePrecision] + 137.519416416), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x - 2.0), $MachinePrecision] * N[(t$95$1 + z), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(x + -2.0), $MachinePrecision] / N[(t$95$0 / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+262], t$95$2, N[(N[(x * 4.16438922228), $MachinePrecision] + N[(z * N[(N[(x / t$95$0), $MachinePrecision] - N[(2.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\
t_1 := x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right)\\
t_2 := \frac{\left(x - 2\right) \cdot \left(t_1 + z\right)}{t_0}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{x + -2}{\frac{t_0}{t_1}}\\
\mathbf{elif}\;t_2 \leq 10^{+262}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot 4.16438922228 + z \cdot \left(\frac{x}{t_0} - \frac{2}{t_0}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x 2) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x 216700011257/5000000000) x) 263505074721/1000000000) x) 156699607947/500000000) x) 23533438303/500000000)) < -inf.0Initial program 4.7%
associate-/l*98.4%
sub-neg98.4%
metadata-eval98.4%
fma-def98.4%
fma-def98.4%
fma-def98.4%
fma-def98.4%
fma-def98.4%
fma-def98.4%
fma-def98.4%
Simplified98.4%
Taylor expanded in z around 0 84.6%
if -inf.0 < (/.f64 (*.f64 (-.f64 x 2) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x 216700011257/5000000000) x) 263505074721/1000000000) x) 156699607947/500000000) x) 23533438303/500000000)) < 1e262Initial program 99.6%
if 1e262 < (/.f64 (*.f64 (-.f64 x 2) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x 216700011257/5000000000) x) 263505074721/1000000000) x) 156699607947/500000000) x) 23533438303/500000000)) Initial program 3.2%
*-commutative3.2%
associate-*l/8.8%
*-commutative8.8%
sub-neg8.8%
metadata-eval8.8%
Simplified8.8%
Taylor expanded in z around 0 5.1%
Taylor expanded in x around inf 98.2%
*-commutative98.2%
Simplified98.2%
pow198.2%
Applied egg-rr98.2%
unpow198.2%
Simplified98.2%
Final simplification98.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
47.066876606
(*
x
(+
313.399215894
(* x (+ 263.505074721 (* x (+ x 43.3400022514))))))))
(t_1
(*
x
(+
(* x (+ (* x (+ (* x 4.16438922228) 78.6994924154)) 137.519416416))
y)))
(t_2 (/ (* (- x 2.0) (+ t_1 z)) t_0)))
(if (<= t_2 (- INFINITY))
(/ (+ x -2.0) (/ t_0 t_1))
(if (<= t_2 5e+288) t_2 (/ (+ x -2.0) 0.24013125253755718)))))
double code(double x, double y, double z) {
double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
double t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y);
double t_2 = ((x - 2.0) * (t_1 + z)) / t_0;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (x + -2.0) / (t_0 / t_1);
} else if (t_2 <= 5e+288) {
tmp = t_2;
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
double t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y);
double t_2 = ((x - 2.0) * (t_1 + z)) / t_0;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (x + -2.0) / (t_0 / t_1);
} else if (t_2 <= 5e+288) {
tmp = t_2;
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
def code(x, y, z): t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))) t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y) t_2 = ((x - 2.0) * (t_1 + z)) / t_0 tmp = 0 if t_2 <= -math.inf: tmp = (x + -2.0) / (t_0 / t_1) elif t_2 <= 5e+288: tmp = t_2 else: tmp = (x + -2.0) / 0.24013125253755718 return tmp
function code(x, y, z) t_0 = Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514))))))) t_1 = Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) t_2 = Float64(Float64(Float64(x - 2.0) * Float64(t_1 + z)) / t_0) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(x + -2.0) / Float64(t_0 / t_1)); elseif (t_2 <= 5e+288) tmp = t_2; else tmp = Float64(Float64(x + -2.0) / 0.24013125253755718); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))); t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y); t_2 = ((x - 2.0) * (t_1 + z)) / t_0; tmp = 0.0; if (t_2 <= -Inf) tmp = (x + -2.0) / (t_0 / t_1); elseif (t_2 <= 5e+288) tmp = t_2; else tmp = (x + -2.0) / 0.24013125253755718; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(N[(x * N[(N[(x * N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision]), $MachinePrecision] + 137.519416416), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x - 2.0), $MachinePrecision] * N[(t$95$1 + z), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(x + -2.0), $MachinePrecision] / N[(t$95$0 / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+288], t$95$2, N[(N[(x + -2.0), $MachinePrecision] / 0.24013125253755718), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\
t_1 := x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right)\\
t_2 := \frac{\left(x - 2\right) \cdot \left(t_1 + z\right)}{t_0}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;\frac{x + -2}{\frac{t_0}{t_1}}\\
\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+288}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x + -2}{0.24013125253755718}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x 2) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x 216700011257/5000000000) x) 263505074721/1000000000) x) 156699607947/500000000) x) 23533438303/500000000)) < -inf.0Initial program 4.7%
associate-/l*98.4%
sub-neg98.4%
metadata-eval98.4%
fma-def98.4%
fma-def98.4%
fma-def98.4%
fma-def98.4%
fma-def98.4%
fma-def98.4%
fma-def98.4%
Simplified98.4%
Taylor expanded in z around 0 84.6%
if -inf.0 < (/.f64 (*.f64 (-.f64 x 2) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x 216700011257/5000000000) x) 263505074721/1000000000) x) 156699607947/500000000) x) 23533438303/500000000)) < 5.0000000000000003e288Initial program 99.6%
if 5.0000000000000003e288 < (/.f64 (*.f64 (-.f64 x 2) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x 216700011257/5000000000) x) 263505074721/1000000000) x) 156699607947/500000000) x) 23533438303/500000000)) Initial program 0.3%
associate-/l*6.0%
sub-neg6.0%
metadata-eval6.0%
fma-def6.0%
fma-def6.0%
fma-def6.0%
fma-def6.0%
fma-def6.0%
fma-def6.0%
fma-def6.0%
Simplified6.0%
Taylor expanded in x around inf 96.6%
Final simplification98.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(+
47.066876606
(*
x
(+
313.399215894
(* x (+ 263.505074721 (* x (+ x 43.3400022514))))))))
(t_1
(*
x
(+
(* x (+ (* x (+ (* x 4.16438922228) 78.6994924154)) 137.519416416))
y))))
(if (<= (/ (* (- x 2.0) (+ t_1 z)) t_0) INFINITY)
(* (+ x -2.0) (+ (/ z t_0) (/ t_1 t_0)))
(/ (+ x -2.0) 0.24013125253755718))))
double code(double x, double y, double z) {
double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
double t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y);
double tmp;
if ((((x - 2.0) * (t_1 + z)) / t_0) <= ((double) INFINITY)) {
tmp = (x + -2.0) * ((z / t_0) + (t_1 / t_0));
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))));
double t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y);
double tmp;
if ((((x - 2.0) * (t_1 + z)) / t_0) <= Double.POSITIVE_INFINITY) {
tmp = (x + -2.0) * ((z / t_0) + (t_1 / t_0));
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
def code(x, y, z): t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))) t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y) tmp = 0 if (((x - 2.0) * (t_1 + z)) / t_0) <= math.inf: tmp = (x + -2.0) * ((z / t_0) + (t_1 / t_0)) else: tmp = (x + -2.0) / 0.24013125253755718 return tmp
function code(x, y, z) t_0 = Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514))))))) t_1 = Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) tmp = 0.0 if (Float64(Float64(Float64(x - 2.0) * Float64(t_1 + z)) / t_0) <= Inf) tmp = Float64(Float64(x + -2.0) * Float64(Float64(z / t_0) + Float64(t_1 / t_0))); else tmp = Float64(Float64(x + -2.0) / 0.24013125253755718); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))); t_1 = x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y); tmp = 0.0; if ((((x - 2.0) * (t_1 + z)) / t_0) <= Inf) tmp = (x + -2.0) * ((z / t_0) + (t_1 / t_0)); else tmp = (x + -2.0) / 0.24013125253755718; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(N[(x * N[(N[(x * N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision]), $MachinePrecision] + 137.519416416), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - 2.0), $MachinePrecision] * N[(t$95$1 + z), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], Infinity], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(z / t$95$0), $MachinePrecision] + N[(t$95$1 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] / 0.24013125253755718), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)\\
t_1 := x \cdot \left(x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\right)\\
\mathbf{if}\;\frac{\left(x - 2\right) \cdot \left(t_1 + z\right)}{t_0} \leq \infty:\\
\;\;\;\;\left(x + -2\right) \cdot \left(\frac{z}{t_0} + \frac{t_1}{t_0}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + -2}{0.24013125253755718}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x 2) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x 216700011257/5000000000) x) 263505074721/1000000000) x) 156699607947/500000000) x) 23533438303/500000000)) < +inf.0Initial program 92.0%
*-commutative92.0%
associate-*l/99.5%
*-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 99.5%
if +inf.0 < (/.f64 (*.f64 (-.f64 x 2) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x 216700011257/5000000000) x) 263505074721/1000000000) x) 156699607947/500000000) x) 23533438303/500000000)) Initial program 0.0%
associate-/l*0.0%
sub-neg0.0%
metadata-eval0.0%
fma-def0.0%
fma-def0.0%
fma-def0.0%
fma-def0.0%
fma-def0.0%
fma-def0.0%
fma-def0.0%
Simplified0.0%
Taylor expanded in x around inf 99.7%
Final simplification99.6%
(FPCore (x y z)
:precision binary64
(if (or (<= x -6.4e+38) (not (<= x 4.4e+48)))
(/ (+ x -2.0) 0.24013125253755718)
(/
(* (- x 2.0) (+ z (* x (+ y (* x 137.519416416)))))
(+
47.066876606
(*
x
(+ 313.399215894 (* x (+ 263.505074721 (* x (+ x 43.3400022514))))))))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -6.4e+38) || !(x <= 4.4e+48)) {
tmp = (x + -2.0) / 0.24013125253755718;
} else {
tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-6.4d+38)) .or. (.not. (x <= 4.4d+48))) then
tmp = (x + (-2.0d0)) / 0.24013125253755718d0
else
tmp = ((x - 2.0d0) * (z + (x * (y + (x * 137.519416416d0))))) / (47.066876606d0 + (x * (313.399215894d0 + (x * (263.505074721d0 + (x * (x + 43.3400022514d0)))))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -6.4e+38) || !(x <= 4.4e+48)) {
tmp = (x + -2.0) / 0.24013125253755718;
} else {
tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514)))))));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -6.4e+38) or not (x <= 4.4e+48): tmp = (x + -2.0) / 0.24013125253755718 else: tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))))) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -6.4e+38) || !(x <= 4.4e+48)) tmp = Float64(Float64(x + -2.0) / 0.24013125253755718); else tmp = Float64(Float64(Float64(x - 2.0) * Float64(z + Float64(x * Float64(y + Float64(x * 137.519416416))))) / Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * Float64(263.505074721 + Float64(x * Float64(x + 43.3400022514)))))))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -6.4e+38) || ~((x <= 4.4e+48))) tmp = (x + -2.0) / 0.24013125253755718; else tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / (47.066876606 + (x * (313.399215894 + (x * (263.505074721 + (x * (x + 43.3400022514))))))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -6.4e+38], N[Not[LessEqual[x, 4.4e+48]], $MachinePrecision]], N[(N[(x + -2.0), $MachinePrecision] / 0.24013125253755718), $MachinePrecision], N[(N[(N[(x - 2.0), $MachinePrecision] * N[(z + N[(x * N[(y + N[(x * 137.519416416), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * N[(263.505074721 + N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.4 \cdot 10^{+38} \lor \neg \left(x \leq 4.4 \cdot 10^{+48}\right):\\
\;\;\;\;\frac{x + -2}{0.24013125253755718}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{47.066876606 + x \cdot \left(313.399215894 + x \cdot \left(263.505074721 + x \cdot \left(x + 43.3400022514\right)\right)\right)}\\
\end{array}
\end{array}
if x < -6.3999999999999997e38 or 4.3999999999999999e48 < x Initial program 8.4%
associate-/l*16.1%
sub-neg16.1%
metadata-eval16.1%
fma-def16.1%
fma-def16.1%
fma-def16.1%
fma-def16.1%
fma-def16.1%
fma-def16.1%
fma-def16.1%
Simplified16.1%
Taylor expanded in x around inf 97.1%
if -6.3999999999999997e38 < x < 4.3999999999999999e48Initial program 97.1%
Taylor expanded in x around 0 94.2%
*-commutative94.2%
Simplified94.2%
Final simplification95.4%
(FPCore (x y z)
:precision binary64
(if (<= x -30000000000000.0)
(/ (+ x -2.0) (+ 0.24013125253755718 (/ 5.86923874282773 x)))
(if (<= x 0.16)
(*
(+ x -2.0)
(+
(* z 0.0212463641547976)
(+
(* x (- (* y 0.0212463641547976) (* z 0.14147091005106402)))
(* x (* x (+ 2.9217875995295866 (* y -0.14147091005106402)))))))
(/ (+ x -2.0) 0.24013125253755718))))
double code(double x, double y, double z) {
double tmp;
if (x <= -30000000000000.0) {
tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x));
} else if (x <= 0.16) {
tmp = (x + -2.0) * ((z * 0.0212463641547976) + ((x * ((y * 0.0212463641547976) - (z * 0.14147091005106402))) + (x * (x * (2.9217875995295866 + (y * -0.14147091005106402))))));
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-30000000000000.0d0)) then
tmp = (x + (-2.0d0)) / (0.24013125253755718d0 + (5.86923874282773d0 / x))
else if (x <= 0.16d0) then
tmp = (x + (-2.0d0)) * ((z * 0.0212463641547976d0) + ((x * ((y * 0.0212463641547976d0) - (z * 0.14147091005106402d0))) + (x * (x * (2.9217875995295866d0 + (y * (-0.14147091005106402d0)))))))
else
tmp = (x + (-2.0d0)) / 0.24013125253755718d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -30000000000000.0) {
tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x));
} else if (x <= 0.16) {
tmp = (x + -2.0) * ((z * 0.0212463641547976) + ((x * ((y * 0.0212463641547976) - (z * 0.14147091005106402))) + (x * (x * (2.9217875995295866 + (y * -0.14147091005106402))))));
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -30000000000000.0: tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x)) elif x <= 0.16: tmp = (x + -2.0) * ((z * 0.0212463641547976) + ((x * ((y * 0.0212463641547976) - (z * 0.14147091005106402))) + (x * (x * (2.9217875995295866 + (y * -0.14147091005106402)))))) else: tmp = (x + -2.0) / 0.24013125253755718 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -30000000000000.0) tmp = Float64(Float64(x + -2.0) / Float64(0.24013125253755718 + Float64(5.86923874282773 / x))); elseif (x <= 0.16) tmp = Float64(Float64(x + -2.0) * Float64(Float64(z * 0.0212463641547976) + Float64(Float64(x * Float64(Float64(y * 0.0212463641547976) - Float64(z * 0.14147091005106402))) + Float64(x * Float64(x * Float64(2.9217875995295866 + Float64(y * -0.14147091005106402))))))); else tmp = Float64(Float64(x + -2.0) / 0.24013125253755718); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -30000000000000.0) tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x)); elseif (x <= 0.16) tmp = (x + -2.0) * ((z * 0.0212463641547976) + ((x * ((y * 0.0212463641547976) - (z * 0.14147091005106402))) + (x * (x * (2.9217875995295866 + (y * -0.14147091005106402)))))); else tmp = (x + -2.0) / 0.24013125253755718; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -30000000000000.0], N[(N[(x + -2.0), $MachinePrecision] / N[(0.24013125253755718 + N[(5.86923874282773 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.16], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(z * 0.0212463641547976), $MachinePrecision] + N[(N[(x * N[(N[(y * 0.0212463641547976), $MachinePrecision] - N[(z * 0.14147091005106402), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * N[(2.9217875995295866 + N[(y * -0.14147091005106402), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] / 0.24013125253755718), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -30000000000000:\\
\;\;\;\;\frac{x + -2}{0.24013125253755718 + \frac{5.86923874282773}{x}}\\
\mathbf{elif}\;x \leq 0.16:\\
\;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 + \left(x \cdot \left(y \cdot 0.0212463641547976 - z \cdot 0.14147091005106402\right) + x \cdot \left(x \cdot \left(2.9217875995295866 + y \cdot -0.14147091005106402\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + -2}{0.24013125253755718}\\
\end{array}
\end{array}
if x < -3e13Initial program 19.0%
associate-/l*28.5%
sub-neg28.5%
metadata-eval28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
Simplified28.5%
Taylor expanded in x around inf 89.7%
associate-*r/89.7%
metadata-eval89.7%
Simplified89.7%
if -3e13 < x < 0.160000000000000003Initial program 99.7%
*-commutative99.7%
associate-*l/99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 97.0%
Taylor expanded in z around 0 97.0%
unpow297.0%
associate-*l*96.9%
sub-neg96.9%
*-commutative96.9%
distribute-rgt-neg-in96.9%
metadata-eval96.9%
Simplified96.9%
if 0.160000000000000003 < x Initial program 14.4%
associate-/l*24.2%
sub-neg24.2%
metadata-eval24.2%
fma-def24.2%
fma-def24.2%
fma-def24.2%
fma-def24.2%
fma-def24.2%
fma-def24.2%
fma-def24.2%
Simplified24.2%
Taylor expanded in x around inf 86.2%
Final simplification92.6%
(FPCore (x y z)
:precision binary64
(if (<= x -30000000000000.0)
(/ (+ x -2.0) (+ 0.24013125253755718 (/ 5.86923874282773 x)))
(if (<= x 550000000000.0)
(*
(+ x -2.0)
(+
(* z 0.0212463641547976)
(* x (- (* y 0.0212463641547976) (* z 0.14147091005106402)))))
(/ (+ x -2.0) 0.24013125253755718))))
double code(double x, double y, double z) {
double tmp;
if (x <= -30000000000000.0) {
tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x));
} else if (x <= 550000000000.0) {
tmp = (x + -2.0) * ((z * 0.0212463641547976) + (x * ((y * 0.0212463641547976) - (z * 0.14147091005106402))));
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-30000000000000.0d0)) then
tmp = (x + (-2.0d0)) / (0.24013125253755718d0 + (5.86923874282773d0 / x))
else if (x <= 550000000000.0d0) then
tmp = (x + (-2.0d0)) * ((z * 0.0212463641547976d0) + (x * ((y * 0.0212463641547976d0) - (z * 0.14147091005106402d0))))
else
tmp = (x + (-2.0d0)) / 0.24013125253755718d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -30000000000000.0) {
tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x));
} else if (x <= 550000000000.0) {
tmp = (x + -2.0) * ((z * 0.0212463641547976) + (x * ((y * 0.0212463641547976) - (z * 0.14147091005106402))));
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -30000000000000.0: tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x)) elif x <= 550000000000.0: tmp = (x + -2.0) * ((z * 0.0212463641547976) + (x * ((y * 0.0212463641547976) - (z * 0.14147091005106402)))) else: tmp = (x + -2.0) / 0.24013125253755718 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -30000000000000.0) tmp = Float64(Float64(x + -2.0) / Float64(0.24013125253755718 + Float64(5.86923874282773 / x))); elseif (x <= 550000000000.0) tmp = Float64(Float64(x + -2.0) * Float64(Float64(z * 0.0212463641547976) + Float64(x * Float64(Float64(y * 0.0212463641547976) - Float64(z * 0.14147091005106402))))); else tmp = Float64(Float64(x + -2.0) / 0.24013125253755718); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -30000000000000.0) tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x)); elseif (x <= 550000000000.0) tmp = (x + -2.0) * ((z * 0.0212463641547976) + (x * ((y * 0.0212463641547976) - (z * 0.14147091005106402)))); else tmp = (x + -2.0) / 0.24013125253755718; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -30000000000000.0], N[(N[(x + -2.0), $MachinePrecision] / N[(0.24013125253755718 + N[(5.86923874282773 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 550000000000.0], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(z * 0.0212463641547976), $MachinePrecision] + N[(x * N[(N[(y * 0.0212463641547976), $MachinePrecision] - N[(z * 0.14147091005106402), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] / 0.24013125253755718), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -30000000000000:\\
\;\;\;\;\frac{x + -2}{0.24013125253755718 + \frac{5.86923874282773}{x}}\\
\mathbf{elif}\;x \leq 550000000000:\\
\;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 + x \cdot \left(y \cdot 0.0212463641547976 - z \cdot 0.14147091005106402\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + -2}{0.24013125253755718}\\
\end{array}
\end{array}
if x < -3e13Initial program 19.0%
associate-/l*28.5%
sub-neg28.5%
metadata-eval28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
Simplified28.5%
Taylor expanded in x around inf 89.7%
associate-*r/89.7%
metadata-eval89.7%
Simplified89.7%
if -3e13 < x < 5.5e11Initial program 99.0%
*-commutative99.0%
associate-*l/99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 87.8%
if 5.5e11 < x Initial program 11.4%
associate-/l*20.1%
sub-neg20.1%
metadata-eval20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
Simplified20.1%
Taylor expanded in x around inf 90.9%
Final simplification89.0%
(FPCore (x y z)
:precision binary64
(if (<= x -0.35)
(/ (+ x -2.0) (+ 0.24013125253755718 (/ 5.86923874282773 x)))
(if (<= x 550000000000.0)
(*
(+ x -2.0)
(+
(* z 0.0212463641547976)
(/ (* x y) (+ 47.066876606 (* x 313.399215894)))))
(/ (+ x -2.0) 0.24013125253755718))))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.35) {
tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x));
} else if (x <= 550000000000.0) {
tmp = (x + -2.0) * ((z * 0.0212463641547976) + ((x * y) / (47.066876606 + (x * 313.399215894))));
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-0.35d0)) then
tmp = (x + (-2.0d0)) / (0.24013125253755718d0 + (5.86923874282773d0 / x))
else if (x <= 550000000000.0d0) then
tmp = (x + (-2.0d0)) * ((z * 0.0212463641547976d0) + ((x * y) / (47.066876606d0 + (x * 313.399215894d0))))
else
tmp = (x + (-2.0d0)) / 0.24013125253755718d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -0.35) {
tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x));
} else if (x <= 550000000000.0) {
tmp = (x + -2.0) * ((z * 0.0212463641547976) + ((x * y) / (47.066876606 + (x * 313.399215894))));
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.35: tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x)) elif x <= 550000000000.0: tmp = (x + -2.0) * ((z * 0.0212463641547976) + ((x * y) / (47.066876606 + (x * 313.399215894)))) else: tmp = (x + -2.0) / 0.24013125253755718 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.35) tmp = Float64(Float64(x + -2.0) / Float64(0.24013125253755718 + Float64(5.86923874282773 / x))); elseif (x <= 550000000000.0) tmp = Float64(Float64(x + -2.0) * Float64(Float64(z * 0.0212463641547976) + Float64(Float64(x * y) / Float64(47.066876606 + Float64(x * 313.399215894))))); else tmp = Float64(Float64(x + -2.0) / 0.24013125253755718); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.35) tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x)); elseif (x <= 550000000000.0) tmp = (x + -2.0) * ((z * 0.0212463641547976) + ((x * y) / (47.066876606 + (x * 313.399215894)))); else tmp = (x + -2.0) / 0.24013125253755718; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.35], N[(N[(x + -2.0), $MachinePrecision] / N[(0.24013125253755718 + N[(5.86923874282773 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 550000000000.0], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(z * 0.0212463641547976), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] / N[(47.066876606 + N[(x * 313.399215894), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] / 0.24013125253755718), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.35:\\
\;\;\;\;\frac{x + -2}{0.24013125253755718 + \frac{5.86923874282773}{x}}\\
\mathbf{elif}\;x \leq 550000000000:\\
\;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 + \frac{x \cdot y}{47.066876606 + x \cdot 313.399215894}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + -2}{0.24013125253755718}\\
\end{array}
\end{array}
if x < -0.34999999999999998Initial program 21.3%
associate-/l*30.5%
sub-neg30.5%
metadata-eval30.5%
fma-def30.5%
fma-def30.5%
fma-def30.5%
fma-def30.5%
fma-def30.5%
fma-def30.5%
fma-def30.5%
Simplified30.5%
Taylor expanded in x around inf 87.3%
associate-*r/87.3%
metadata-eval87.3%
Simplified87.3%
if -0.34999999999999998 < x < 5.5e11Initial program 99.0%
*-commutative99.0%
associate-*l/99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around 0 98.2%
Taylor expanded in y around inf 91.2%
Taylor expanded in x around 0 89.9%
*-commutative89.9%
Simplified89.9%
if 5.5e11 < x Initial program 11.4%
associate-/l*20.1%
sub-neg20.1%
metadata-eval20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
Simplified20.1%
Taylor expanded in x around inf 90.9%
Final simplification89.4%
(FPCore (x y z)
:precision binary64
(if (<= x -30000000000000.0)
(/ (+ x -2.0) (+ 0.24013125253755718 (/ 5.86923874282773 x)))
(if (<= x 550000000000.0)
(* (+ x -2.0) (+ (* z 0.0212463641547976) (* 0.0212463641547976 (* x y))))
(/ (+ x -2.0) 0.24013125253755718))))
double code(double x, double y, double z) {
double tmp;
if (x <= -30000000000000.0) {
tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x));
} else if (x <= 550000000000.0) {
tmp = (x + -2.0) * ((z * 0.0212463641547976) + (0.0212463641547976 * (x * y)));
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-30000000000000.0d0)) then
tmp = (x + (-2.0d0)) / (0.24013125253755718d0 + (5.86923874282773d0 / x))
else if (x <= 550000000000.0d0) then
tmp = (x + (-2.0d0)) * ((z * 0.0212463641547976d0) + (0.0212463641547976d0 * (x * y)))
else
tmp = (x + (-2.0d0)) / 0.24013125253755718d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -30000000000000.0) {
tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x));
} else if (x <= 550000000000.0) {
tmp = (x + -2.0) * ((z * 0.0212463641547976) + (0.0212463641547976 * (x * y)));
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -30000000000000.0: tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x)) elif x <= 550000000000.0: tmp = (x + -2.0) * ((z * 0.0212463641547976) + (0.0212463641547976 * (x * y))) else: tmp = (x + -2.0) / 0.24013125253755718 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -30000000000000.0) tmp = Float64(Float64(x + -2.0) / Float64(0.24013125253755718 + Float64(5.86923874282773 / x))); elseif (x <= 550000000000.0) tmp = Float64(Float64(x + -2.0) * Float64(Float64(z * 0.0212463641547976) + Float64(0.0212463641547976 * Float64(x * y)))); else tmp = Float64(Float64(x + -2.0) / 0.24013125253755718); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -30000000000000.0) tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x)); elseif (x <= 550000000000.0) tmp = (x + -2.0) * ((z * 0.0212463641547976) + (0.0212463641547976 * (x * y))); else tmp = (x + -2.0) / 0.24013125253755718; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -30000000000000.0], N[(N[(x + -2.0), $MachinePrecision] / N[(0.24013125253755718 + N[(5.86923874282773 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 550000000000.0], N[(N[(x + -2.0), $MachinePrecision] * N[(N[(z * 0.0212463641547976), $MachinePrecision] + N[(0.0212463641547976 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] / 0.24013125253755718), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -30000000000000:\\
\;\;\;\;\frac{x + -2}{0.24013125253755718 + \frac{5.86923874282773}{x}}\\
\mathbf{elif}\;x \leq 550000000000:\\
\;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976 + 0.0212463641547976 \cdot \left(x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + -2}{0.24013125253755718}\\
\end{array}
\end{array}
if x < -3e13Initial program 19.0%
associate-/l*28.5%
sub-neg28.5%
metadata-eval28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
fma-def28.5%
Simplified28.5%
Taylor expanded in x around inf 89.7%
associate-*r/89.7%
metadata-eval89.7%
Simplified89.7%
if -3e13 < x < 5.5e11Initial program 99.0%
*-commutative99.0%
associate-*l/99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around 0 97.5%
Taylor expanded in x around 0 87.8%
if 5.5e11 < x Initial program 11.4%
associate-/l*20.1%
sub-neg20.1%
metadata-eval20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
Simplified20.1%
Taylor expanded in x around inf 90.9%
Final simplification89.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -1e-5) (not (<= x 550000000000.0))) (/ (+ x -2.0) 0.24013125253755718) (* (+ x -2.0) (* z 0.0212463641547976))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1e-5) || !(x <= 550000000000.0)) {
tmp = (x + -2.0) / 0.24013125253755718;
} else {
tmp = (x + -2.0) * (z * 0.0212463641547976);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1d-5)) .or. (.not. (x <= 550000000000.0d0))) then
tmp = (x + (-2.0d0)) / 0.24013125253755718d0
else
tmp = (x + (-2.0d0)) * (z * 0.0212463641547976d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1e-5) || !(x <= 550000000000.0)) {
tmp = (x + -2.0) / 0.24013125253755718;
} else {
tmp = (x + -2.0) * (z * 0.0212463641547976);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1e-5) or not (x <= 550000000000.0): tmp = (x + -2.0) / 0.24013125253755718 else: tmp = (x + -2.0) * (z * 0.0212463641547976) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1e-5) || !(x <= 550000000000.0)) tmp = Float64(Float64(x + -2.0) / 0.24013125253755718); else tmp = Float64(Float64(x + -2.0) * Float64(z * 0.0212463641547976)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1e-5) || ~((x <= 550000000000.0))) tmp = (x + -2.0) / 0.24013125253755718; else tmp = (x + -2.0) * (z * 0.0212463641547976); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1e-5], N[Not[LessEqual[x, 550000000000.0]], $MachinePrecision]], N[(N[(x + -2.0), $MachinePrecision] / 0.24013125253755718), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] * N[(z * 0.0212463641547976), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-5} \lor \neg \left(x \leq 550000000000\right):\\
\;\;\;\;\frac{x + -2}{0.24013125253755718}\\
\mathbf{else}:\\
\;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976\right)\\
\end{array}
\end{array}
if x < -1.00000000000000008e-5 or 5.5e11 < x Initial program 17.7%
associate-/l*26.6%
sub-neg26.6%
metadata-eval26.6%
fma-def26.6%
fma-def26.6%
fma-def26.6%
fma-def26.6%
fma-def26.6%
fma-def26.6%
fma-def26.6%
Simplified26.6%
Taylor expanded in x around inf 88.1%
if -1.00000000000000008e-5 < x < 5.5e11Initial program 99.0%
*-commutative99.0%
associate-*l/99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 66.6%
Final simplification77.2%
(FPCore (x y z)
:precision binary64
(if (<= x -0.175)
(/ (+ x -2.0) (+ 0.24013125253755718 (/ 5.86923874282773 x)))
(if (<= x 550000000000.0)
(* (+ x -2.0) (* z 0.0212463641547976))
(/ (+ x -2.0) 0.24013125253755718))))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.175) {
tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x));
} else if (x <= 550000000000.0) {
tmp = (x + -2.0) * (z * 0.0212463641547976);
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-0.175d0)) then
tmp = (x + (-2.0d0)) / (0.24013125253755718d0 + (5.86923874282773d0 / x))
else if (x <= 550000000000.0d0) then
tmp = (x + (-2.0d0)) * (z * 0.0212463641547976d0)
else
tmp = (x + (-2.0d0)) / 0.24013125253755718d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -0.175) {
tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x));
} else if (x <= 550000000000.0) {
tmp = (x + -2.0) * (z * 0.0212463641547976);
} else {
tmp = (x + -2.0) / 0.24013125253755718;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.175: tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x)) elif x <= 550000000000.0: tmp = (x + -2.0) * (z * 0.0212463641547976) else: tmp = (x + -2.0) / 0.24013125253755718 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.175) tmp = Float64(Float64(x + -2.0) / Float64(0.24013125253755718 + Float64(5.86923874282773 / x))); elseif (x <= 550000000000.0) tmp = Float64(Float64(x + -2.0) * Float64(z * 0.0212463641547976)); else tmp = Float64(Float64(x + -2.0) / 0.24013125253755718); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.175) tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x)); elseif (x <= 550000000000.0) tmp = (x + -2.0) * (z * 0.0212463641547976); else tmp = (x + -2.0) / 0.24013125253755718; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.175], N[(N[(x + -2.0), $MachinePrecision] / N[(0.24013125253755718 + N[(5.86923874282773 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 550000000000.0], N[(N[(x + -2.0), $MachinePrecision] * N[(z * 0.0212463641547976), $MachinePrecision]), $MachinePrecision], N[(N[(x + -2.0), $MachinePrecision] / 0.24013125253755718), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.175:\\
\;\;\;\;\frac{x + -2}{0.24013125253755718 + \frac{5.86923874282773}{x}}\\
\mathbf{elif}\;x \leq 550000000000:\\
\;\;\;\;\left(x + -2\right) \cdot \left(z \cdot 0.0212463641547976\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + -2}{0.24013125253755718}\\
\end{array}
\end{array}
if x < -0.17499999999999999Initial program 21.3%
associate-/l*30.5%
sub-neg30.5%
metadata-eval30.5%
fma-def30.5%
fma-def30.5%
fma-def30.5%
fma-def30.5%
fma-def30.5%
fma-def30.5%
fma-def30.5%
Simplified30.5%
Taylor expanded in x around inf 87.3%
associate-*r/87.3%
metadata-eval87.3%
Simplified87.3%
if -0.17499999999999999 < x < 5.5e11Initial program 99.0%
*-commutative99.0%
associate-*l/99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 66.1%
if 5.5e11 < x Initial program 11.4%
associate-/l*20.1%
sub-neg20.1%
metadata-eval20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
fma-def20.1%
Simplified20.1%
Taylor expanded in x around inf 90.9%
Final simplification77.2%
(FPCore (x y z) :precision binary64 (if (or (<= x -1e-5) (not (<= x 1.1))) (/ (+ x -2.0) 0.24013125253755718) (* z -0.0424927283095952)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1e-5) || !(x <= 1.1)) {
tmp = (x + -2.0) / 0.24013125253755718;
} else {
tmp = z * -0.0424927283095952;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1d-5)) .or. (.not. (x <= 1.1d0))) then
tmp = (x + (-2.0d0)) / 0.24013125253755718d0
else
tmp = z * (-0.0424927283095952d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1e-5) || !(x <= 1.1)) {
tmp = (x + -2.0) / 0.24013125253755718;
} else {
tmp = z * -0.0424927283095952;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1e-5) or not (x <= 1.1): tmp = (x + -2.0) / 0.24013125253755718 else: tmp = z * -0.0424927283095952 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1e-5) || !(x <= 1.1)) tmp = Float64(Float64(x + -2.0) / 0.24013125253755718); else tmp = Float64(z * -0.0424927283095952); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1e-5) || ~((x <= 1.1))) tmp = (x + -2.0) / 0.24013125253755718; else tmp = z * -0.0424927283095952; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1e-5], N[Not[LessEqual[x, 1.1]], $MachinePrecision]], N[(N[(x + -2.0), $MachinePrecision] / 0.24013125253755718), $MachinePrecision], N[(z * -0.0424927283095952), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-5} \lor \neg \left(x \leq 1.1\right):\\
\;\;\;\;\frac{x + -2}{0.24013125253755718}\\
\mathbf{else}:\\
\;\;\;\;z \cdot -0.0424927283095952\\
\end{array}
\end{array}
if x < -1.00000000000000008e-5 or 1.1000000000000001 < x Initial program 18.9%
associate-/l*28.3%
sub-neg28.3%
metadata-eval28.3%
fma-def28.3%
fma-def28.3%
fma-def28.3%
fma-def28.3%
fma-def28.3%
fma-def28.3%
fma-def28.3%
Simplified28.3%
Taylor expanded in x around inf 86.1%
if -1.00000000000000008e-5 < x < 1.1000000000000001Initial program 99.7%
*-commutative99.7%
associate-*l/99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 68.1%
*-commutative68.1%
Simplified68.1%
Final simplification77.2%
(FPCore (x y z) :precision binary64 (if (<= x -1e-5) (* x 4.16438922228) (if (<= x 2.0) (* z -0.0424927283095952) (* x 4.16438922228))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1e-5) {
tmp = x * 4.16438922228;
} else if (x <= 2.0) {
tmp = z * -0.0424927283095952;
} else {
tmp = x * 4.16438922228;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1d-5)) then
tmp = x * 4.16438922228d0
else if (x <= 2.0d0) then
tmp = z * (-0.0424927283095952d0)
else
tmp = x * 4.16438922228d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1e-5) {
tmp = x * 4.16438922228;
} else if (x <= 2.0) {
tmp = z * -0.0424927283095952;
} else {
tmp = x * 4.16438922228;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1e-5: tmp = x * 4.16438922228 elif x <= 2.0: tmp = z * -0.0424927283095952 else: tmp = x * 4.16438922228 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1e-5) tmp = Float64(x * 4.16438922228); elseif (x <= 2.0) tmp = Float64(z * -0.0424927283095952); else tmp = Float64(x * 4.16438922228); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1e-5) tmp = x * 4.16438922228; elseif (x <= 2.0) tmp = z * -0.0424927283095952; else tmp = x * 4.16438922228; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1e-5], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, 2.0], N[(z * -0.0424927283095952), $MachinePrecision], N[(x * 4.16438922228), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-5}:\\
\;\;\;\;x \cdot 4.16438922228\\
\mathbf{elif}\;x \leq 2:\\
\;\;\;\;z \cdot -0.0424927283095952\\
\mathbf{else}:\\
\;\;\;\;x \cdot 4.16438922228\\
\end{array}
\end{array}
if x < -1.00000000000000008e-5 or 2 < x Initial program 18.9%
*-commutative18.9%
associate-*l/28.4%
*-commutative28.4%
sub-neg28.4%
metadata-eval28.4%
Simplified28.4%
Taylor expanded in x around inf 85.7%
Taylor expanded in x around inf 85.6%
*-commutative85.6%
Simplified85.6%
if -1.00000000000000008e-5 < x < 2Initial program 99.7%
*-commutative99.7%
associate-*l/99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 68.1%
*-commutative68.1%
Simplified68.1%
Final simplification76.9%
(FPCore (x y z) :precision binary64 (if (<= x -1e-5) (- (* x 4.16438922228) 110.1139242984811) (if (<= x 2.0) (* z -0.0424927283095952) (* x 4.16438922228))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1e-5) {
tmp = (x * 4.16438922228) - 110.1139242984811;
} else if (x <= 2.0) {
tmp = z * -0.0424927283095952;
} else {
tmp = x * 4.16438922228;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-1d-5)) then
tmp = (x * 4.16438922228d0) - 110.1139242984811d0
else if (x <= 2.0d0) then
tmp = z * (-0.0424927283095952d0)
else
tmp = x * 4.16438922228d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1e-5) {
tmp = (x * 4.16438922228) - 110.1139242984811;
} else if (x <= 2.0) {
tmp = z * -0.0424927283095952;
} else {
tmp = x * 4.16438922228;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1e-5: tmp = (x * 4.16438922228) - 110.1139242984811 elif x <= 2.0: tmp = z * -0.0424927283095952 else: tmp = x * 4.16438922228 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1e-5) tmp = Float64(Float64(x * 4.16438922228) - 110.1139242984811); elseif (x <= 2.0) tmp = Float64(z * -0.0424927283095952); else tmp = Float64(x * 4.16438922228); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1e-5) tmp = (x * 4.16438922228) - 110.1139242984811; elseif (x <= 2.0) tmp = z * -0.0424927283095952; else tmp = x * 4.16438922228; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1e-5], N[(N[(x * 4.16438922228), $MachinePrecision] - 110.1139242984811), $MachinePrecision], If[LessEqual[x, 2.0], N[(z * -0.0424927283095952), $MachinePrecision], N[(x * 4.16438922228), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-5}:\\
\;\;\;\;x \cdot 4.16438922228 - 110.1139242984811\\
\mathbf{elif}\;x \leq 2:\\
\;\;\;\;z \cdot -0.0424927283095952\\
\mathbf{else}:\\
\;\;\;\;x \cdot 4.16438922228\\
\end{array}
\end{array}
if x < -1.00000000000000008e-5Initial program 22.4%
*-commutative22.4%
associate-*l/31.6%
*-commutative31.6%
sub-neg31.6%
metadata-eval31.6%
Simplified31.6%
Taylor expanded in x around inf 85.6%
if -1.00000000000000008e-5 < x < 2Initial program 99.7%
*-commutative99.7%
associate-*l/99.7%
*-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 68.1%
*-commutative68.1%
Simplified68.1%
if 2 < x Initial program 14.4%
*-commutative14.4%
associate-*l/24.3%
*-commutative24.3%
sub-neg24.3%
metadata-eval24.3%
Simplified24.3%
Taylor expanded in x around inf 85.8%
Taylor expanded in x around inf 85.8%
*-commutative85.8%
Simplified85.8%
Final simplification77.0%
(FPCore (x y z) :precision binary64 (* x -0.3407596943375357))
double code(double x, double y, double z) {
return x * -0.3407596943375357;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (-0.3407596943375357d0)
end function
public static double code(double x, double y, double z) {
return x * -0.3407596943375357;
}
def code(x, y, z): return x * -0.3407596943375357
function code(x, y, z) return Float64(x * -0.3407596943375357) end
function tmp = code(x, y, z) tmp = x * -0.3407596943375357; end
code[x_, y_, z_] := N[(x * -0.3407596943375357), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -0.3407596943375357
\end{array}
Initial program 59.0%
associate-/l*63.6%
sub-neg63.6%
metadata-eval63.6%
fma-def63.6%
fma-def63.6%
fma-def63.6%
fma-def63.6%
fma-def63.6%
fma-def63.6%
fma-def63.6%
Simplified63.6%
Taylor expanded in x around inf 45.1%
associate-*r/45.1%
metadata-eval45.1%
Simplified45.1%
Taylor expanded in x around 0 2.3%
*-commutative2.3%
Simplified2.3%
Final simplification2.3%
(FPCore (x y z) :precision binary64 (* x 4.16438922228))
double code(double x, double y, double z) {
return x * 4.16438922228;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * 4.16438922228d0
end function
public static double code(double x, double y, double z) {
return x * 4.16438922228;
}
def code(x, y, z): return x * 4.16438922228
function code(x, y, z) return Float64(x * 4.16438922228) end
function tmp = code(x, y, z) tmp = x * 4.16438922228; end
code[x_, y_, z_] := N[(x * 4.16438922228), $MachinePrecision]
\begin{array}{l}
\\
x \cdot 4.16438922228
\end{array}
Initial program 59.0%
*-commutative59.0%
associate-*l/63.7%
*-commutative63.7%
sub-neg63.7%
metadata-eval63.7%
Simplified63.8%
Taylor expanded in x around inf 44.6%
Taylor expanded in x around inf 44.9%
*-commutative44.9%
Simplified44.9%
Final simplification44.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (+ (/ y (* x x)) (* 4.16438922228 x)) 110.1139242984811)))
(if (< x -3.326128725870005e+62)
t_0
(if (< x 9.429991714554673e+55)
(*
(/ (- x 2.0) 1.0)
(/
(+
(*
(+
(* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x)
y)
x)
z)
(+
(*
(+
(+ (* 263.505074721 x) (+ (* 43.3400022514 (* x x)) (* x (* x x))))
313.399215894)
x)
47.066876606)))
t_0))))
double code(double x, double y, double z) {
double t_0 = ((y / (x * x)) + (4.16438922228 * x)) - 110.1139242984811;
double tmp;
if (x < -3.326128725870005e+62) {
tmp = t_0;
} else if (x < 9.429991714554673e+55) {
tmp = ((x - 2.0) / 1.0) * (((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z) / (((((263.505074721 * x) + ((43.3400022514 * (x * x)) + (x * (x * x)))) + 313.399215894) * x) + 47.066876606));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = ((y / (x * x)) + (4.16438922228d0 * x)) - 110.1139242984811d0
if (x < (-3.326128725870005d+62)) then
tmp = t_0
else if (x < 9.429991714554673d+55) then
tmp = ((x - 2.0d0) / 1.0d0) * (((((((((x * 4.16438922228d0) + 78.6994924154d0) * x) + 137.519416416d0) * x) + y) * x) + z) / (((((263.505074721d0 * x) + ((43.3400022514d0 * (x * x)) + (x * (x * x)))) + 313.399215894d0) * x) + 47.066876606d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = ((y / (x * x)) + (4.16438922228 * x)) - 110.1139242984811;
double tmp;
if (x < -3.326128725870005e+62) {
tmp = t_0;
} else if (x < 9.429991714554673e+55) {
tmp = ((x - 2.0) / 1.0) * (((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z) / (((((263.505074721 * x) + ((43.3400022514 * (x * x)) + (x * (x * x)))) + 313.399215894) * x) + 47.066876606));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((y / (x * x)) + (4.16438922228 * x)) - 110.1139242984811 tmp = 0 if x < -3.326128725870005e+62: tmp = t_0 elif x < 9.429991714554673e+55: tmp = ((x - 2.0) / 1.0) * (((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z) / (((((263.505074721 * x) + ((43.3400022514 * (x * x)) + (x * (x * x)))) + 313.399215894) * x) + 47.066876606)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(Float64(y / Float64(x * x)) + Float64(4.16438922228 * x)) - 110.1139242984811) tmp = 0.0 if (x < -3.326128725870005e+62) tmp = t_0; elseif (x < 9.429991714554673e+55) tmp = Float64(Float64(Float64(x - 2.0) / 1.0) * Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z) / Float64(Float64(Float64(Float64(Float64(263.505074721 * x) + Float64(Float64(43.3400022514 * Float64(x * x)) + Float64(x * Float64(x * x)))) + 313.399215894) * x) + 47.066876606))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((y / (x * x)) + (4.16438922228 * x)) - 110.1139242984811; tmp = 0.0; if (x < -3.326128725870005e+62) tmp = t_0; elseif (x < 9.429991714554673e+55) tmp = ((x - 2.0) / 1.0) * (((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z) / (((((263.505074721 * x) + ((43.3400022514 * (x * x)) + (x * (x * x)))) + 313.399215894) * x) + 47.066876606)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(4.16438922228 * x), $MachinePrecision]), $MachinePrecision] - 110.1139242984811), $MachinePrecision]}, If[Less[x, -3.326128725870005e+62], t$95$0, If[Less[x, 9.429991714554673e+55], N[(N[(N[(x - 2.0), $MachinePrecision] / 1.0), $MachinePrecision] * N[(N[(N[(N[(N[(N[(N[(N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision] * x), $MachinePrecision] + 137.519416416), $MachinePrecision] * x), $MachinePrecision] + y), $MachinePrecision] * x), $MachinePrecision] + z), $MachinePrecision] / N[(N[(N[(N[(N[(263.505074721 * x), $MachinePrecision] + N[(N[(43.3400022514 * N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 313.399215894), $MachinePrecision] * x), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\frac{y}{x \cdot x} + 4.16438922228 \cdot x\right) - 110.1139242984811\\
\mathbf{if}\;x < -3.326128725870005 \cdot 10^{+62}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x < 9.429991714554673 \cdot 10^{+55}:\\
\;\;\;\;\frac{x - 2}{1} \cdot \frac{\left(\left(\left(x \cdot 4.16438922228 + 78.6994924154\right) \cdot x + 137.519416416\right) \cdot x + y\right) \cdot x + z}{\left(\left(263.505074721 \cdot x + \left(43.3400022514 \cdot \left(x \cdot x\right) + x \cdot \left(x \cdot x\right)\right)\right) + 313.399215894\right) \cdot x + 47.066876606}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
herbie shell --seed 2023293
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, C"
:precision binary64
:herbie-target
(if (< x -3.326128725870005e+62) (- (+ (/ y (* x x)) (* 4.16438922228 x)) 110.1139242984811) (if (< x 9.429991714554673e+55) (* (/ (- x 2.0) 1.0) (/ (+ (* (+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y) x) z) (+ (* (+ (+ (* 263.505074721 x) (+ (* 43.3400022514 (* x x)) (* x (* x x)))) 313.399215894) x) 47.066876606))) (- (+ (/ y (* x x)) (* 4.16438922228 x)) 110.1139242984811)))
(/ (* (- x 2.0) (+ (* (+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y) x) z)) (+ (* (+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894) x) 47.066876606)))