
(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
(let* ((t_0
(+
(*
x
(+ (* x (+ (* x (+ x 43.3400022514)) 263.505074721)) 313.399215894))
47.066876606))
(t_1
(+
(* x (+ (* x (+ (* x 4.16438922228) 78.6994924154)) 137.519416416))
y))
(t_2 (/ (* (- x 2.0) (+ (* x t_1) z)) t_0)))
(if (or (<= t_2 (- INFINITY)) (not (<= t_2 2e+293)))
(-
(+
(/ (- y 130977.50649958357) (* x x))
(+ (* x 4.16438922228) (/ 3655.1204654076414 x)))
110.1139242984811)
(+ (/ (* x (* (- x 2.0) t_1)) t_0) (/ (* (- x 2.0) z) t_0)))))
double code(double x, double y, double z) {
double t_0 = (x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606;
double t_1 = (x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y;
double t_2 = ((x - 2.0) * ((x * t_1) + z)) / t_0;
double tmp;
if ((t_2 <= -((double) INFINITY)) || !(t_2 <= 2e+293)) {
tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811;
} else {
tmp = ((x * ((x - 2.0) * t_1)) / t_0) + (((x - 2.0) * z) / t_0);
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = (x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606;
double t_1 = (x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y;
double t_2 = ((x - 2.0) * ((x * t_1) + z)) / t_0;
double tmp;
if ((t_2 <= -Double.POSITIVE_INFINITY) || !(t_2 <= 2e+293)) {
tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811;
} else {
tmp = ((x * ((x - 2.0) * t_1)) / t_0) + (((x - 2.0) * z) / t_0);
}
return tmp;
}
def code(x, y, z): t_0 = (x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606 t_1 = (x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y t_2 = ((x - 2.0) * ((x * t_1) + z)) / t_0 tmp = 0 if (t_2 <= -math.inf) or not (t_2 <= 2e+293): tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811 else: tmp = ((x * ((x - 2.0) * t_1)) / t_0) + (((x - 2.0) * z) / t_0) return tmp
function code(x, y, z) t_0 = Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606) t_1 = 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(Float64(x * t_1) + z)) / t_0) tmp = 0.0 if ((t_2 <= Float64(-Inf)) || !(t_2 <= 2e+293)) tmp = Float64(Float64(Float64(Float64(y - 130977.50649958357) / Float64(x * x)) + Float64(Float64(x * 4.16438922228) + Float64(3655.1204654076414 / x))) - 110.1139242984811); else tmp = Float64(Float64(Float64(x * Float64(Float64(x - 2.0) * t_1)) / t_0) + Float64(Float64(Float64(x - 2.0) * z) / t_0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606; t_1 = (x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y; t_2 = ((x - 2.0) * ((x * t_1) + z)) / t_0; tmp = 0.0; if ((t_2 <= -Inf) || ~((t_2 <= 2e+293))) tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811; else tmp = ((x * ((x - 2.0) * t_1)) / t_0) + (((x - 2.0) * z) / t_0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * N[(N[(x * N[(N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision] + 263.505074721), $MachinePrecision]), $MachinePrecision] + 313.399215894), $MachinePrecision]), $MachinePrecision] + 47.066876606), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * N[(N[(x * N[(N[(x * 4.16438922228), $MachinePrecision] + 78.6994924154), $MachinePrecision]), $MachinePrecision] + 137.519416416), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x - 2.0), $MachinePrecision] * N[(N[(x * t$95$1), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]}, If[Or[LessEqual[t$95$2, (-Infinity)], N[Not[LessEqual[t$95$2, 2e+293]], $MachinePrecision]], N[(N[(N[(N[(y - 130977.50649958357), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 4.16438922228), $MachinePrecision] + N[(3655.1204654076414 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 110.1139242984811), $MachinePrecision], N[(N[(N[(x * N[(N[(x - 2.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(N[(N[(x - 2.0), $MachinePrecision] * z), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(x \cdot \left(x \cdot \left(x + 43.3400022514\right) + 263.505074721\right) + 313.399215894\right) + 47.066876606\\
t_1 := x \cdot \left(x \cdot \left(x \cdot 4.16438922228 + 78.6994924154\right) + 137.519416416\right) + y\\
t_2 := \frac{\left(x - 2\right) \cdot \left(x \cdot t_1 + z\right)}{t_0}\\
\mathbf{if}\;t_2 \leq -\infty \lor \neg \left(t_2 \leq 2 \cdot 10^{+293}\right):\\
\;\;\;\;\left(\frac{y - 130977.50649958357}{x \cdot x} + \left(x \cdot 4.16438922228 + \frac{3655.1204654076414}{x}\right)\right) - 110.1139242984811\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\left(x - 2\right) \cdot t_1\right)}{t_0} + \frac{\left(x - 2\right) \cdot z}{t_0}\\
\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.0 or 1.9999999999999998e293 < (/.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.5%
Simplified7.2%
Taylor expanded in x around -inf 98.8%
unpow298.8%
Applied egg-rr98.8%
Taylor expanded in x around 0 98.8%
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)) < 1.9999999999999998e293Initial program 99.7%
Simplified99.3%
Taylor expanded in z around inf 99.7%
Final simplification99.3%
(FPCore (x y z)
:precision binary64
(if (<=
(/
(*
(- x 2.0)
(+
(*
x
(+
(* x (+ (* x (+ (* x 4.16438922228) 78.6994924154)) 137.519416416))
y))
z))
(+
(*
x
(+ (* x (+ (* x (+ x 43.3400022514)) 263.505074721)) 313.399215894))
47.066876606))
2e+293)
(/
(+ x -2.0)
(/
(fma
(fma (fma (+ x 43.3400022514) x 263.505074721) x 313.399215894)
x
47.066876606)
(fma
(fma (fma (fma x 4.16438922228 78.6994924154) x 137.519416416) x y)
x
z)))
(-
(+
(/ (- y 130977.50649958357) (* x x))
(+ (* x 4.16438922228) (/ 3655.1204654076414 x)))
110.1139242984811)))
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)) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606)) <= 2e+293) {
tmp = (x + -2.0) / (fma(fma(fma((x + 43.3400022514), x, 263.505074721), x, 313.399215894), x, 47.066876606) / fma(fma(fma(fma(x, 4.16438922228, 78.6994924154), x, 137.519416416), x, y), x, z));
} else {
tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811;
}
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(Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606)) <= 2e+293) tmp = Float64(Float64(x + -2.0) / Float64(fma(fma(fma(Float64(x + 43.3400022514), x, 263.505074721), x, 313.399215894), x, 47.066876606) / fma(fma(fma(fma(x, 4.16438922228, 78.6994924154), x, 137.519416416), x, y), x, z))); else tmp = Float64(Float64(Float64(Float64(y - 130977.50649958357) / Float64(x * x)) + Float64(Float64(x * 4.16438922228) + Float64(3655.1204654076414 / x))) - 110.1139242984811); 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[(N[(x * N[(N[(x * N[(N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision] + 263.505074721), $MachinePrecision]), $MachinePrecision] + 313.399215894), $MachinePrecision]), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision], 2e+293], N[(N[(x + -2.0), $MachinePrecision] / N[(N[(N[(N[(N[(x + 43.3400022514), $MachinePrecision] * x + 263.505074721), $MachinePrecision] * x + 313.399215894), $MachinePrecision] * x + 47.066876606), $MachinePrecision] / N[(N[(N[(N[(x * 4.16438922228 + 78.6994924154), $MachinePrecision] * x + 137.519416416), $MachinePrecision] * x + y), $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y - 130977.50649958357), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 4.16438922228), $MachinePrecision] + N[(3655.1204654076414 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 110.1139242984811), $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)}{x \cdot \left(x \cdot \left(x \cdot \left(x + 43.3400022514\right) + 263.505074721\right) + 313.399215894\right) + 47.066876606} \leq 2 \cdot 10^{+293}:\\
\;\;\;\;\frac{x + -2}{\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x + 43.3400022514, x, 263.505074721\right), x, 313.399215894\right), x, 47.066876606\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 4.16438922228, 78.6994924154\right), x, 137.519416416\right), x, y\right), x, z\right)}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{y - 130977.50649958357}{x \cdot x} + \left(x \cdot 4.16438922228 + \frac{3655.1204654076414}{x}\right)\right) - 110.1139242984811\\
\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)) < 1.9999999999999998e293Initial program 95.2%
associate-/l*97.7%
sub-neg97.7%
metadata-eval97.7%
fma-def97.7%
fma-def97.7%
fma-def97.7%
fma-def97.7%
fma-def97.7%
fma-def97.7%
fma-def97.7%
Simplified97.7%
if 1.9999999999999998e293 < (/.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.2%
Simplified3.8%
Taylor expanded in x around -inf 98.7%
unpow298.7%
Applied egg-rr98.7%
Taylor expanded in x around 0 98.7%
Final simplification98.1%
(FPCore (x y z)
:precision binary64
(if (<=
(/
(*
(- x 2.0)
(+
(*
x
(+
(* x (+ (* x (+ (* x 4.16438922228) 78.6994924154)) 137.519416416))
y))
z))
(+
(*
x
(+ (* x (+ (* x (+ x 43.3400022514)) 263.505074721)) 313.399215894))
47.066876606))
2e+293)
(*
(fma
x
(fma x (fma x (fma x 4.16438922228 78.6994924154) 137.519416416) y)
z)
(/
(+ x -2.0)
(fma
x
(fma x (fma x (+ x 43.3400022514) 263.505074721) 313.399215894)
47.066876606)))
(-
(+
(/ (- y 130977.50649958357) (* x x))
(+ (* x 4.16438922228) (/ 3655.1204654076414 x)))
110.1139242984811)))
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)) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606)) <= 2e+293) {
tmp = fma(x, fma(x, fma(x, fma(x, 4.16438922228, 78.6994924154), 137.519416416), y), z) * ((x + -2.0) / fma(x, fma(x, fma(x, (x + 43.3400022514), 263.505074721), 313.399215894), 47.066876606));
} else {
tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811;
}
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(Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606)) <= 2e+293) tmp = Float64(fma(x, fma(x, fma(x, fma(x, 4.16438922228, 78.6994924154), 137.519416416), y), z) * Float64(Float64(x + -2.0) / fma(x, fma(x, fma(x, Float64(x + 43.3400022514), 263.505074721), 313.399215894), 47.066876606))); else tmp = Float64(Float64(Float64(Float64(y - 130977.50649958357) / Float64(x * x)) + Float64(Float64(x * 4.16438922228) + Float64(3655.1204654076414 / x))) - 110.1139242984811); 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[(N[(x * N[(N[(x * N[(N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision] + 263.505074721), $MachinePrecision]), $MachinePrecision] + 313.399215894), $MachinePrecision]), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision], 2e+293], N[(N[(x * N[(x * N[(x * N[(x * 4.16438922228 + 78.6994924154), $MachinePrecision] + 137.519416416), $MachinePrecision] + y), $MachinePrecision] + z), $MachinePrecision] * N[(N[(x + -2.0), $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[(N[(N[(y - 130977.50649958357), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 4.16438922228), $MachinePrecision] + N[(3655.1204654076414 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 110.1139242984811), $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)}{x \cdot \left(x \cdot \left(x \cdot \left(x + 43.3400022514\right) + 263.505074721\right) + 313.399215894\right) + 47.066876606} \leq 2 \cdot 10^{+293}:\\
\;\;\;\;\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) \cdot \frac{x + -2}{\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}:\\
\;\;\;\;\left(\frac{y - 130977.50649958357}{x \cdot x} + \left(x \cdot 4.16438922228 + \frac{3655.1204654076414}{x}\right)\right) - 110.1139242984811\\
\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)) < 1.9999999999999998e293Initial program 95.2%
Simplified97.5%
if 1.9999999999999998e293 < (/.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.2%
Simplified3.8%
Taylor expanded in x around -inf 98.7%
unpow298.7%
Applied egg-rr98.7%
Taylor expanded in x around 0 98.7%
Final simplification98.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(/
(*
(- x 2.0)
(+
(*
x
(+
(*
x
(+ (* x (+ (* x 4.16438922228) 78.6994924154)) 137.519416416))
y))
z))
(+
(*
x
(+
(* x (+ (* x (+ x 43.3400022514)) 263.505074721))
313.399215894))
47.066876606))))
(if (or (<= t_0 (- INFINITY)) (not (<= t_0 2e+293)))
(-
(+
(/ (- y 130977.50649958357) (* x x))
(+ (* x 4.16438922228) (/ 3655.1204654076414 x)))
110.1139242984811)
t_0)))
double code(double x, double y, double z) {
double t_0 = ((x - 2.0) * ((x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606);
double tmp;
if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 2e+293)) {
tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811;
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double x, double y, double z) {
double t_0 = ((x - 2.0) * ((x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606);
double tmp;
if ((t_0 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 2e+293)) {
tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = ((x - 2.0) * ((x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606) tmp = 0 if (t_0 <= -math.inf) or not (t_0 <= 2e+293): tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = 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(Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606)) tmp = 0.0 if ((t_0 <= Float64(-Inf)) || !(t_0 <= 2e+293)) tmp = Float64(Float64(Float64(Float64(y - 130977.50649958357) / Float64(x * x)) + Float64(Float64(x * 4.16438922228) + Float64(3655.1204654076414 / x))) - 110.1139242984811); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = ((x - 2.0) * ((x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606); tmp = 0.0; if ((t_0 <= -Inf) || ~((t_0 <= 2e+293))) tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = 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[(N[(x * N[(N[(x * N[(N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision] + 263.505074721), $MachinePrecision]), $MachinePrecision] + 313.399215894), $MachinePrecision]), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 2e+293]], $MachinePrecision]], N[(N[(N[(N[(y - 130977.50649958357), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 4.16438922228), $MachinePrecision] + N[(3655.1204654076414 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 110.1139242984811), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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)}{x \cdot \left(x \cdot \left(x \cdot \left(x + 43.3400022514\right) + 263.505074721\right) + 313.399215894\right) + 47.066876606}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 2 \cdot 10^{+293}\right):\\
\;\;\;\;\left(\frac{y - 130977.50649958357}{x \cdot x} + \left(x \cdot 4.16438922228 + \frac{3655.1204654076414}{x}\right)\right) - 110.1139242984811\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\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.0 or 1.9999999999999998e293 < (/.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.5%
Simplified7.2%
Taylor expanded in x around -inf 98.8%
unpow298.8%
Applied egg-rr98.8%
Taylor expanded in x around 0 98.8%
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)) < 1.9999999999999998e293Initial program 99.7%
Final simplification99.3%
(FPCore (x y z)
:precision binary64
(if (or (<= x -33000000000.0) (not (<= x 11000000.0)))
(-
(+
(/ (- y 130977.50649958357) (* x x))
(+ (* x 4.16438922228) (/ 3655.1204654076414 x)))
110.1139242984811)
(/
(* (- x 2.0) (+ z (* x (+ y (* x 137.519416416)))))
(+
(* x (+ (* x (+ (* x (+ x 43.3400022514)) 263.505074721)) 313.399215894))
47.066876606))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -33000000000.0) || !(x <= 11000000.0)) {
tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811;
} else {
tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606);
}
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 <= (-33000000000.0d0)) .or. (.not. (x <= 11000000.0d0))) then
tmp = (((y - 130977.50649958357d0) / (x * x)) + ((x * 4.16438922228d0) + (3655.1204654076414d0 / x))) - 110.1139242984811d0
else
tmp = ((x - 2.0d0) * (z + (x * (y + (x * 137.519416416d0))))) / ((x * ((x * ((x * (x + 43.3400022514d0)) + 263.505074721d0)) + 313.399215894d0)) + 47.066876606d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -33000000000.0) || !(x <= 11000000.0)) {
tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811;
} else {
tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -33000000000.0) or not (x <= 11000000.0): tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811 else: tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -33000000000.0) || !(x <= 11000000.0)) tmp = Float64(Float64(Float64(Float64(y - 130977.50649958357) / Float64(x * x)) + Float64(Float64(x * 4.16438922228) + Float64(3655.1204654076414 / x))) - 110.1139242984811); else tmp = Float64(Float64(Float64(x - 2.0) * Float64(z + Float64(x * Float64(y + Float64(x * 137.519416416))))) / Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -33000000000.0) || ~((x <= 11000000.0))) tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811; else tmp = ((x - 2.0) * (z + (x * (y + (x * 137.519416416))))) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -33000000000.0], N[Not[LessEqual[x, 11000000.0]], $MachinePrecision]], N[(N[(N[(N[(y - 130977.50649958357), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 4.16438922228), $MachinePrecision] + N[(3655.1204654076414 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 110.1139242984811), $MachinePrecision], N[(N[(N[(x - 2.0), $MachinePrecision] * N[(z + N[(x * N[(y + N[(x * 137.519416416), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(x * N[(N[(x * N[(N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision] + 263.505074721), $MachinePrecision]), $MachinePrecision] + 313.399215894), $MachinePrecision]), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -33000000000 \lor \neg \left(x \leq 11000000\right):\\
\;\;\;\;\left(\frac{y - 130977.50649958357}{x \cdot x} + \left(x \cdot 4.16438922228 + \frac{3655.1204654076414}{x}\right)\right) - 110.1139242984811\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot 137.519416416\right)\right)}{x \cdot \left(x \cdot \left(x \cdot \left(x + 43.3400022514\right) + 263.505074721\right) + 313.399215894\right) + 47.066876606}\\
\end{array}
\end{array}
if x < -3.3e10 or 1.1e7 < x Initial program 10.6%
Simplified16.6%
Taylor expanded in x around -inf 98.1%
unpow298.1%
Applied egg-rr98.1%
Taylor expanded in x around 0 98.1%
if -3.3e10 < x < 1.1e7Initial program 99.7%
Taylor expanded in x around 0 99.7%
*-commutative99.7%
Simplified99.7%
Final simplification98.9%
(FPCore (x y z)
:precision binary64
(if (or (<= x -29500.0) (not (<= x 42.0)))
(-
(+
(/ (- y 130977.50649958357) (* x x))
(+ (* x 4.16438922228) (/ 3655.1204654076414 x)))
110.1139242984811)
(+
(/
(* (- x 2.0) z)
(+
(* x (+ (* x (+ (* x (+ x 43.3400022514)) 263.505074721)) 313.399215894))
47.066876606))
(* -0.0424927283095952 (* x y)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -29500.0) || !(x <= 42.0)) {
tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811;
} else {
tmp = (((x - 2.0) * z) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606)) + (-0.0424927283095952 * (x * y));
}
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 <= (-29500.0d0)) .or. (.not. (x <= 42.0d0))) then
tmp = (((y - 130977.50649958357d0) / (x * x)) + ((x * 4.16438922228d0) + (3655.1204654076414d0 / x))) - 110.1139242984811d0
else
tmp = (((x - 2.0d0) * z) / ((x * ((x * ((x * (x + 43.3400022514d0)) + 263.505074721d0)) + 313.399215894d0)) + 47.066876606d0)) + ((-0.0424927283095952d0) * (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -29500.0) || !(x <= 42.0)) {
tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811;
} else {
tmp = (((x - 2.0) * z) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606)) + (-0.0424927283095952 * (x * y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -29500.0) or not (x <= 42.0): tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811 else: tmp = (((x - 2.0) * z) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606)) + (-0.0424927283095952 * (x * y)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -29500.0) || !(x <= 42.0)) tmp = Float64(Float64(Float64(Float64(y - 130977.50649958357) / Float64(x * x)) + Float64(Float64(x * 4.16438922228) + Float64(3655.1204654076414 / x))) - 110.1139242984811); else tmp = Float64(Float64(Float64(Float64(x - 2.0) * z) / Float64(Float64(x * Float64(Float64(x * Float64(Float64(x * Float64(x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606)) + Float64(-0.0424927283095952 * Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -29500.0) || ~((x <= 42.0))) tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811; else tmp = (((x - 2.0) * z) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606)) + (-0.0424927283095952 * (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -29500.0], N[Not[LessEqual[x, 42.0]], $MachinePrecision]], N[(N[(N[(N[(y - 130977.50649958357), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 4.16438922228), $MachinePrecision] + N[(3655.1204654076414 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 110.1139242984811), $MachinePrecision], N[(N[(N[(N[(x - 2.0), $MachinePrecision] * z), $MachinePrecision] / N[(N[(x * N[(N[(x * N[(N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision] + 263.505074721), $MachinePrecision]), $MachinePrecision] + 313.399215894), $MachinePrecision]), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision] + N[(-0.0424927283095952 * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -29500 \lor \neg \left(x \leq 42\right):\\
\;\;\;\;\left(\frac{y - 130977.50649958357}{x \cdot x} + \left(x \cdot 4.16438922228 + \frac{3655.1204654076414}{x}\right)\right) - 110.1139242984811\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot z}{x \cdot \left(x \cdot \left(x \cdot \left(x + 43.3400022514\right) + 263.505074721\right) + 313.399215894\right) + 47.066876606} + -0.0424927283095952 \cdot \left(x \cdot y\right)\\
\end{array}
\end{array}
if x < -29500 or 42 < x Initial program 11.3%
Simplified17.2%
Taylor expanded in x around -inf 97.5%
unpow297.5%
Applied egg-rr97.5%
Taylor expanded in x around 0 97.5%
if -29500 < x < 42Initial program 99.8%
Simplified99.4%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around 0 96.6%
Final simplification97.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (- (* x 4.16438922228) 110.1139242984811))
(t_1 (* -0.0424927283095952 (* x y))))
(if (<= x -0.31)
t_0
(if (<= x -6e-37)
t_1
(if (<= x 1.15e-70)
(* z -0.0424927283095952)
(if (<= x 2.2e-8)
t_1
(if (<= x 0.75) (* z -0.0424927283095952) t_0)))))))
double code(double x, double y, double z) {
double t_0 = (x * 4.16438922228) - 110.1139242984811;
double t_1 = -0.0424927283095952 * (x * y);
double tmp;
if (x <= -0.31) {
tmp = t_0;
} else if (x <= -6e-37) {
tmp = t_1;
} else if (x <= 1.15e-70) {
tmp = z * -0.0424927283095952;
} else if (x <= 2.2e-8) {
tmp = t_1;
} else if (x <= 0.75) {
tmp = z * -0.0424927283095952;
} 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) :: t_1
real(8) :: tmp
t_0 = (x * 4.16438922228d0) - 110.1139242984811d0
t_1 = (-0.0424927283095952d0) * (x * y)
if (x <= (-0.31d0)) then
tmp = t_0
else if (x <= (-6d-37)) then
tmp = t_1
else if (x <= 1.15d-70) then
tmp = z * (-0.0424927283095952d0)
else if (x <= 2.2d-8) then
tmp = t_1
else if (x <= 0.75d0) then
tmp = z * (-0.0424927283095952d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (x * 4.16438922228) - 110.1139242984811;
double t_1 = -0.0424927283095952 * (x * y);
double tmp;
if (x <= -0.31) {
tmp = t_0;
} else if (x <= -6e-37) {
tmp = t_1;
} else if (x <= 1.15e-70) {
tmp = z * -0.0424927283095952;
} else if (x <= 2.2e-8) {
tmp = t_1;
} else if (x <= 0.75) {
tmp = z * -0.0424927283095952;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (x * 4.16438922228) - 110.1139242984811 t_1 = -0.0424927283095952 * (x * y) tmp = 0 if x <= -0.31: tmp = t_0 elif x <= -6e-37: tmp = t_1 elif x <= 1.15e-70: tmp = z * -0.0424927283095952 elif x <= 2.2e-8: tmp = t_1 elif x <= 0.75: tmp = z * -0.0424927283095952 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(x * 4.16438922228) - 110.1139242984811) t_1 = Float64(-0.0424927283095952 * Float64(x * y)) tmp = 0.0 if (x <= -0.31) tmp = t_0; elseif (x <= -6e-37) tmp = t_1; elseif (x <= 1.15e-70) tmp = Float64(z * -0.0424927283095952); elseif (x <= 2.2e-8) tmp = t_1; elseif (x <= 0.75) tmp = Float64(z * -0.0424927283095952); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (x * 4.16438922228) - 110.1139242984811; t_1 = -0.0424927283095952 * (x * y); tmp = 0.0; if (x <= -0.31) tmp = t_0; elseif (x <= -6e-37) tmp = t_1; elseif (x <= 1.15e-70) tmp = z * -0.0424927283095952; elseif (x <= 2.2e-8) tmp = t_1; elseif (x <= 0.75) tmp = z * -0.0424927283095952; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x * 4.16438922228), $MachinePrecision] - 110.1139242984811), $MachinePrecision]}, Block[{t$95$1 = N[(-0.0424927283095952 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.31], t$95$0, If[LessEqual[x, -6e-37], t$95$1, If[LessEqual[x, 1.15e-70], N[(z * -0.0424927283095952), $MachinePrecision], If[LessEqual[x, 2.2e-8], t$95$1, If[LessEqual[x, 0.75], N[(z * -0.0424927283095952), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot 4.16438922228 - 110.1139242984811\\
t_1 := -0.0424927283095952 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \leq -0.31:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -6 \cdot 10^{-37}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-70}:\\
\;\;\;\;z \cdot -0.0424927283095952\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-8}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 0.75:\\
\;\;\;\;z \cdot -0.0424927283095952\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -0.309999999999999998 or 0.75 < x Initial program 11.3%
Simplified17.2%
Taylor expanded in x around inf 89.3%
if -0.309999999999999998 < x < -6e-37 or 1.15e-70 < x < 2.1999999999999998e-8Initial program 99.5%
Simplified99.4%
Taylor expanded in z around inf 99.5%
Taylor expanded in x around 0 95.1%
Taylor expanded in x around 0 87.2%
Taylor expanded in x around inf 75.4%
if -6e-37 < x < 1.15e-70 or 2.1999999999999998e-8 < x < 0.75Initial program 99.8%
Simplified99.4%
Taylor expanded in x around 0 79.7%
Final simplification84.2%
(FPCore (x y z)
:precision binary64
(if (or (<= x -0.175) (not (<= x 15.5)))
(/ (+ x -2.0) (+ 0.24013125253755718 (/ 5.86923874282773 x)))
(+
(* z -0.0424927283095952)
(*
x
(- (* 0.0212463641547976 (+ z (* y -2.0))) (* z -0.28294182010212804))))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -0.175) || !(x <= 15.5)) {
tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x));
} else {
tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804)));
}
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)) .or. (.not. (x <= 15.5d0))) then
tmp = (x + (-2.0d0)) / (0.24013125253755718d0 + (5.86923874282773d0 / x))
else
tmp = (z * (-0.0424927283095952d0)) + (x * ((0.0212463641547976d0 * (z + (y * (-2.0d0)))) - (z * (-0.28294182010212804d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -0.175) || !(x <= 15.5)) {
tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x));
} else {
tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -0.175) or not (x <= 15.5): tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x)) else: tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804))) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -0.175) || !(x <= 15.5)) tmp = Float64(Float64(x + -2.0) / Float64(0.24013125253755718 + Float64(5.86923874282773 / x))); else tmp = Float64(Float64(z * -0.0424927283095952) + Float64(x * Float64(Float64(0.0212463641547976 * Float64(z + Float64(y * -2.0))) - Float64(z * -0.28294182010212804)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -0.175) || ~((x <= 15.5))) tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x)); else tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -0.175], N[Not[LessEqual[x, 15.5]], $MachinePrecision]], N[(N[(x + -2.0), $MachinePrecision] / N[(0.24013125253755718 + N[(5.86923874282773 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * -0.0424927283095952), $MachinePrecision] + N[(x * N[(N[(0.0212463641547976 * N[(z + N[(y * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * -0.28294182010212804), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.175 \lor \neg \left(x \leq 15.5\right):\\
\;\;\;\;\frac{x + -2}{0.24013125253755718 + \frac{5.86923874282773}{x}}\\
\mathbf{else}:\\
\;\;\;\;z \cdot -0.0424927283095952 + x \cdot \left(0.0212463641547976 \cdot \left(z + y \cdot -2\right) - z \cdot -0.28294182010212804\right)\\
\end{array}
\end{array}
if x < -0.17499999999999999 or 15.5 < x Initial program 11.3%
associate-/l*17.2%
sub-neg17.2%
metadata-eval17.2%
fma-def17.2%
fma-def17.2%
fma-def17.2%
fma-def17.2%
fma-def17.2%
fma-def17.2%
fma-def17.2%
Simplified17.2%
Taylor expanded in x around inf 89.8%
associate-*r/89.8%
metadata-eval89.8%
Simplified89.8%
if -0.17499999999999999 < x < 15.5Initial program 99.8%
Simplified99.4%
Taylor expanded in x around 0 95.6%
Final simplification92.7%
(FPCore (x y z)
:precision binary64
(if (or (<= x -0.185) (not (<= x 3.6)))
(-
(+
(/ (- y 130977.50649958357) (* x x))
(+ (* x 4.16438922228) (/ 3655.1204654076414 x)))
110.1139242984811)
(+
(* z -0.0424927283095952)
(*
x
(- (* 0.0212463641547976 (+ z (* y -2.0))) (* z -0.28294182010212804))))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -0.185) || !(x <= 3.6)) {
tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811;
} else {
tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804)));
}
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.185d0)) .or. (.not. (x <= 3.6d0))) then
tmp = (((y - 130977.50649958357d0) / (x * x)) + ((x * 4.16438922228d0) + (3655.1204654076414d0 / x))) - 110.1139242984811d0
else
tmp = (z * (-0.0424927283095952d0)) + (x * ((0.0212463641547976d0 * (z + (y * (-2.0d0)))) - (z * (-0.28294182010212804d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -0.185) || !(x <= 3.6)) {
tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811;
} else {
tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -0.185) or not (x <= 3.6): tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811 else: tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804))) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -0.185) || !(x <= 3.6)) tmp = Float64(Float64(Float64(Float64(y - 130977.50649958357) / Float64(x * x)) + Float64(Float64(x * 4.16438922228) + Float64(3655.1204654076414 / x))) - 110.1139242984811); else tmp = Float64(Float64(z * -0.0424927283095952) + Float64(x * Float64(Float64(0.0212463641547976 * Float64(z + Float64(y * -2.0))) - Float64(z * -0.28294182010212804)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -0.185) || ~((x <= 3.6))) tmp = (((y - 130977.50649958357) / (x * x)) + ((x * 4.16438922228) + (3655.1204654076414 / x))) - 110.1139242984811; else tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -0.185], N[Not[LessEqual[x, 3.6]], $MachinePrecision]], N[(N[(N[(N[(y - 130977.50649958357), $MachinePrecision] / N[(x * x), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 4.16438922228), $MachinePrecision] + N[(3655.1204654076414 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 110.1139242984811), $MachinePrecision], N[(N[(z * -0.0424927283095952), $MachinePrecision] + N[(x * N[(N[(0.0212463641547976 * N[(z + N[(y * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * -0.28294182010212804), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.185 \lor \neg \left(x \leq 3.6\right):\\
\;\;\;\;\left(\frac{y - 130977.50649958357}{x \cdot x} + \left(x \cdot 4.16438922228 + \frac{3655.1204654076414}{x}\right)\right) - 110.1139242984811\\
\mathbf{else}:\\
\;\;\;\;z \cdot -0.0424927283095952 + x \cdot \left(0.0212463641547976 \cdot \left(z + y \cdot -2\right) - z \cdot -0.28294182010212804\right)\\
\end{array}
\end{array}
if x < -0.185 or 3.60000000000000009 < x Initial program 11.3%
Simplified17.2%
Taylor expanded in x around -inf 97.5%
unpow297.5%
Applied egg-rr97.5%
Taylor expanded in x around 0 97.5%
if -0.185 < x < 3.60000000000000009Initial program 99.8%
Simplified99.4%
Taylor expanded in x around 0 95.6%
Final simplification96.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -0.0424927283095952 (* x y))))
(if (<= x -5.5)
(* x 4.16438922228)
(if (<= x -5e-37)
t_0
(if (<= x 1.25e-71)
(* z -0.0424927283095952)
(if (<= x 7.6e-8) t_0 (* x 4.16438922228)))))))
double code(double x, double y, double z) {
double t_0 = -0.0424927283095952 * (x * y);
double tmp;
if (x <= -5.5) {
tmp = x * 4.16438922228;
} else if (x <= -5e-37) {
tmp = t_0;
} else if (x <= 1.25e-71) {
tmp = z * -0.0424927283095952;
} else if (x <= 7.6e-8) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = (-0.0424927283095952d0) * (x * y)
if (x <= (-5.5d0)) then
tmp = x * 4.16438922228d0
else if (x <= (-5d-37)) then
tmp = t_0
else if (x <= 1.25d-71) then
tmp = z * (-0.0424927283095952d0)
else if (x <= 7.6d-8) then
tmp = t_0
else
tmp = x * 4.16438922228d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -0.0424927283095952 * (x * y);
double tmp;
if (x <= -5.5) {
tmp = x * 4.16438922228;
} else if (x <= -5e-37) {
tmp = t_0;
} else if (x <= 1.25e-71) {
tmp = z * -0.0424927283095952;
} else if (x <= 7.6e-8) {
tmp = t_0;
} else {
tmp = x * 4.16438922228;
}
return tmp;
}
def code(x, y, z): t_0 = -0.0424927283095952 * (x * y) tmp = 0 if x <= -5.5: tmp = x * 4.16438922228 elif x <= -5e-37: tmp = t_0 elif x <= 1.25e-71: tmp = z * -0.0424927283095952 elif x <= 7.6e-8: tmp = t_0 else: tmp = x * 4.16438922228 return tmp
function code(x, y, z) t_0 = Float64(-0.0424927283095952 * Float64(x * y)) tmp = 0.0 if (x <= -5.5) tmp = Float64(x * 4.16438922228); elseif (x <= -5e-37) tmp = t_0; elseif (x <= 1.25e-71) tmp = Float64(z * -0.0424927283095952); elseif (x <= 7.6e-8) tmp = t_0; else tmp = Float64(x * 4.16438922228); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -0.0424927283095952 * (x * y); tmp = 0.0; if (x <= -5.5) tmp = x * 4.16438922228; elseif (x <= -5e-37) tmp = t_0; elseif (x <= 1.25e-71) tmp = z * -0.0424927283095952; elseif (x <= 7.6e-8) tmp = t_0; else tmp = x * 4.16438922228; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-0.0424927283095952 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, -5e-37], t$95$0, If[LessEqual[x, 1.25e-71], N[(z * -0.0424927283095952), $MachinePrecision], If[LessEqual[x, 7.6e-8], t$95$0, N[(x * 4.16438922228), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -0.0424927283095952 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \leq -5.5:\\
\;\;\;\;x \cdot 4.16438922228\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-37}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-71}:\\
\;\;\;\;z \cdot -0.0424927283095952\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-8}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot 4.16438922228\\
\end{array}
\end{array}
if x < -5.5 or 7.60000000000000056e-8 < x Initial program 11.9%
Simplified17.9%
Taylor expanded in x around inf 88.0%
*-commutative88.0%
Simplified88.0%
if -5.5 < x < -4.9999999999999997e-37 or 1.24999999999999999e-71 < x < 7.60000000000000056e-8Initial program 99.5%
Simplified99.4%
Taylor expanded in z around inf 99.5%
Taylor expanded in x around 0 95.1%
Taylor expanded in x around 0 87.2%
Taylor expanded in x around inf 75.4%
if -4.9999999999999997e-37 < x < 1.24999999999999999e-71Initial program 99.8%
Simplified99.4%
Taylor expanded in x around 0 80.0%
Final simplification83.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -0.175) (not (<= x 3.5))) (- (* x 4.16438922228) 110.1139242984811) (+ (* -0.0424927283095952 (* x y)) (* z -0.0424927283095952))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -0.175) || !(x <= 3.5)) {
tmp = (x * 4.16438922228) - 110.1139242984811;
} else {
tmp = (-0.0424927283095952 * (x * y)) + (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 <= (-0.175d0)) .or. (.not. (x <= 3.5d0))) then
tmp = (x * 4.16438922228d0) - 110.1139242984811d0
else
tmp = ((-0.0424927283095952d0) * (x * y)) + (z * (-0.0424927283095952d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -0.175) || !(x <= 3.5)) {
tmp = (x * 4.16438922228) - 110.1139242984811;
} else {
tmp = (-0.0424927283095952 * (x * y)) + (z * -0.0424927283095952);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -0.175) or not (x <= 3.5): tmp = (x * 4.16438922228) - 110.1139242984811 else: tmp = (-0.0424927283095952 * (x * y)) + (z * -0.0424927283095952) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -0.175) || !(x <= 3.5)) tmp = Float64(Float64(x * 4.16438922228) - 110.1139242984811); else tmp = Float64(Float64(-0.0424927283095952 * Float64(x * y)) + Float64(z * -0.0424927283095952)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -0.175) || ~((x <= 3.5))) tmp = (x * 4.16438922228) - 110.1139242984811; else tmp = (-0.0424927283095952 * (x * y)) + (z * -0.0424927283095952); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -0.175], N[Not[LessEqual[x, 3.5]], $MachinePrecision]], N[(N[(x * 4.16438922228), $MachinePrecision] - 110.1139242984811), $MachinePrecision], N[(N[(-0.0424927283095952 * N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(z * -0.0424927283095952), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.175 \lor \neg \left(x \leq 3.5\right):\\
\;\;\;\;x \cdot 4.16438922228 - 110.1139242984811\\
\mathbf{else}:\\
\;\;\;\;-0.0424927283095952 \cdot \left(x \cdot y\right) + z \cdot -0.0424927283095952\\
\end{array}
\end{array}
if x < -0.17499999999999999 or 3.5 < x Initial program 11.3%
Simplified17.2%
Taylor expanded in x around inf 89.3%
if -0.17499999999999999 < x < 3.5Initial program 99.8%
Simplified99.4%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around 0 98.5%
Taylor expanded in x around 0 95.3%
Final simplification92.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -0.175) (not (<= x 1.7))) (/ (+ x -2.0) (+ 0.24013125253755718 (/ 5.86923874282773 x))) (+ (* -0.0424927283095952 (* x y)) (* z -0.0424927283095952))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -0.175) || !(x <= 1.7)) {
tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x));
} else {
tmp = (-0.0424927283095952 * (x * y)) + (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 <= (-0.175d0)) .or. (.not. (x <= 1.7d0))) then
tmp = (x + (-2.0d0)) / (0.24013125253755718d0 + (5.86923874282773d0 / x))
else
tmp = ((-0.0424927283095952d0) * (x * y)) + (z * (-0.0424927283095952d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -0.175) || !(x <= 1.7)) {
tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x));
} else {
tmp = (-0.0424927283095952 * (x * y)) + (z * -0.0424927283095952);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -0.175) or not (x <= 1.7): tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x)) else: tmp = (-0.0424927283095952 * (x * y)) + (z * -0.0424927283095952) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -0.175) || !(x <= 1.7)) tmp = Float64(Float64(x + -2.0) / Float64(0.24013125253755718 + Float64(5.86923874282773 / x))); else tmp = Float64(Float64(-0.0424927283095952 * Float64(x * y)) + Float64(z * -0.0424927283095952)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -0.175) || ~((x <= 1.7))) tmp = (x + -2.0) / (0.24013125253755718 + (5.86923874282773 / x)); else tmp = (-0.0424927283095952 * (x * y)) + (z * -0.0424927283095952); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -0.175], N[Not[LessEqual[x, 1.7]], $MachinePrecision]], N[(N[(x + -2.0), $MachinePrecision] / N[(0.24013125253755718 + N[(5.86923874282773 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.0424927283095952 * N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(z * -0.0424927283095952), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.175 \lor \neg \left(x \leq 1.7\right):\\
\;\;\;\;\frac{x + -2}{0.24013125253755718 + \frac{5.86923874282773}{x}}\\
\mathbf{else}:\\
\;\;\;\;-0.0424927283095952 \cdot \left(x \cdot y\right) + z \cdot -0.0424927283095952\\
\end{array}
\end{array}
if x < -0.17499999999999999 or 1.69999999999999996 < x Initial program 11.3%
associate-/l*17.2%
sub-neg17.2%
metadata-eval17.2%
fma-def17.2%
fma-def17.2%
fma-def17.2%
fma-def17.2%
fma-def17.2%
fma-def17.2%
fma-def17.2%
Simplified17.2%
Taylor expanded in x around inf 89.8%
associate-*r/89.8%
metadata-eval89.8%
Simplified89.8%
if -0.17499999999999999 < x < 1.69999999999999996Initial program 99.8%
Simplified99.4%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around 0 98.5%
Taylor expanded in x around 0 95.3%
Final simplification92.5%
(FPCore (x y z)
:precision binary64
(if (<= x -0.175)
(- (* x 4.16438922228) 110.1139242984811)
(if (<= x 2.0)
(+ (* -0.0424927283095952 (* x y)) (* z -0.0424927283095952))
(- (+ (* x 4.16438922228) (/ 3655.1204654076414 x)) 110.1139242984811))))
double code(double x, double y, double z) {
double tmp;
if (x <= -0.175) {
tmp = (x * 4.16438922228) - 110.1139242984811;
} else if (x <= 2.0) {
tmp = (-0.0424927283095952 * (x * y)) + (z * -0.0424927283095952);
} else {
tmp = ((x * 4.16438922228) + (3655.1204654076414 / x)) - 110.1139242984811;
}
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 * 4.16438922228d0) - 110.1139242984811d0
else if (x <= 2.0d0) then
tmp = ((-0.0424927283095952d0) * (x * y)) + (z * (-0.0424927283095952d0))
else
tmp = ((x * 4.16438922228d0) + (3655.1204654076414d0 / x)) - 110.1139242984811d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -0.175) {
tmp = (x * 4.16438922228) - 110.1139242984811;
} else if (x <= 2.0) {
tmp = (-0.0424927283095952 * (x * y)) + (z * -0.0424927283095952);
} else {
tmp = ((x * 4.16438922228) + (3655.1204654076414 / x)) - 110.1139242984811;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -0.175: tmp = (x * 4.16438922228) - 110.1139242984811 elif x <= 2.0: tmp = (-0.0424927283095952 * (x * y)) + (z * -0.0424927283095952) else: tmp = ((x * 4.16438922228) + (3655.1204654076414 / x)) - 110.1139242984811 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -0.175) tmp = Float64(Float64(x * 4.16438922228) - 110.1139242984811); elseif (x <= 2.0) tmp = Float64(Float64(-0.0424927283095952 * Float64(x * y)) + Float64(z * -0.0424927283095952)); else tmp = Float64(Float64(Float64(x * 4.16438922228) + Float64(3655.1204654076414 / x)) - 110.1139242984811); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -0.175) tmp = (x * 4.16438922228) - 110.1139242984811; elseif (x <= 2.0) tmp = (-0.0424927283095952 * (x * y)) + (z * -0.0424927283095952); else tmp = ((x * 4.16438922228) + (3655.1204654076414 / x)) - 110.1139242984811; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -0.175], N[(N[(x * 4.16438922228), $MachinePrecision] - 110.1139242984811), $MachinePrecision], If[LessEqual[x, 2.0], N[(N[(-0.0424927283095952 * N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(z * -0.0424927283095952), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 4.16438922228), $MachinePrecision] + N[(3655.1204654076414 / x), $MachinePrecision]), $MachinePrecision] - 110.1139242984811), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.175:\\
\;\;\;\;x \cdot 4.16438922228 - 110.1139242984811\\
\mathbf{elif}\;x \leq 2:\\
\;\;\;\;-0.0424927283095952 \cdot \left(x \cdot y\right) + z \cdot -0.0424927283095952\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot 4.16438922228 + \frac{3655.1204654076414}{x}\right) - 110.1139242984811\\
\end{array}
\end{array}
if x < -0.17499999999999999Initial program 11.9%
Simplified15.6%
Taylor expanded in x around inf 88.2%
if -0.17499999999999999 < x < 2Initial program 99.8%
Simplified99.4%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around 0 98.5%
Taylor expanded in x around 0 95.3%
if 2 < x Initial program 10.8%
Simplified18.3%
Taylor expanded in x around inf 90.3%
Taylor expanded in x around 0 90.3%
Final simplification92.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -0.175) (not (<= x 2.0))) (- (* x 4.16438922228) 110.1139242984811) (* -0.0424927283095952 (+ z (* x y)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -0.175) || !(x <= 2.0)) {
tmp = (x * 4.16438922228) - 110.1139242984811;
} else {
tmp = -0.0424927283095952 * (z + (x * y));
}
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)) .or. (.not. (x <= 2.0d0))) then
tmp = (x * 4.16438922228d0) - 110.1139242984811d0
else
tmp = (-0.0424927283095952d0) * (z + (x * y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -0.175) || !(x <= 2.0)) {
tmp = (x * 4.16438922228) - 110.1139242984811;
} else {
tmp = -0.0424927283095952 * (z + (x * y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -0.175) or not (x <= 2.0): tmp = (x * 4.16438922228) - 110.1139242984811 else: tmp = -0.0424927283095952 * (z + (x * y)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -0.175) || !(x <= 2.0)) tmp = Float64(Float64(x * 4.16438922228) - 110.1139242984811); else tmp = Float64(-0.0424927283095952 * Float64(z + Float64(x * y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -0.175) || ~((x <= 2.0))) tmp = (x * 4.16438922228) - 110.1139242984811; else tmp = -0.0424927283095952 * (z + (x * y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -0.175], N[Not[LessEqual[x, 2.0]], $MachinePrecision]], N[(N[(x * 4.16438922228), $MachinePrecision] - 110.1139242984811), $MachinePrecision], N[(-0.0424927283095952 * N[(z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.175 \lor \neg \left(x \leq 2\right):\\
\;\;\;\;x \cdot 4.16438922228 - 110.1139242984811\\
\mathbf{else}:\\
\;\;\;\;-0.0424927283095952 \cdot \left(z + x \cdot y\right)\\
\end{array}
\end{array}
if x < -0.17499999999999999 or 2 < x Initial program 11.3%
Simplified17.2%
Taylor expanded in x around inf 89.3%
if -0.17499999999999999 < x < 2Initial program 99.8%
Simplified99.4%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around 0 98.5%
Taylor expanded in x around 0 95.3%
Taylor expanded in x around 0 95.3%
distribute-lft-out95.3%
Simplified95.3%
Final simplification92.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -55.0) (not (<= x 2.0))) (* x 4.16438922228) (* z -0.0424927283095952)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -55.0) || !(x <= 2.0)) {
tmp = x * 4.16438922228;
} 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 <= (-55.0d0)) .or. (.not. (x <= 2.0d0))) then
tmp = x * 4.16438922228d0
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 <= -55.0) || !(x <= 2.0)) {
tmp = x * 4.16438922228;
} else {
tmp = z * -0.0424927283095952;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -55.0) or not (x <= 2.0): tmp = x * 4.16438922228 else: tmp = z * -0.0424927283095952 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -55.0) || !(x <= 2.0)) tmp = Float64(x * 4.16438922228); else tmp = Float64(z * -0.0424927283095952); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -55.0) || ~((x <= 2.0))) tmp = x * 4.16438922228; else tmp = z * -0.0424927283095952; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -55.0], N[Not[LessEqual[x, 2.0]], $MachinePrecision]], N[(x * 4.16438922228), $MachinePrecision], N[(z * -0.0424927283095952), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -55 \lor \neg \left(x \leq 2\right):\\
\;\;\;\;x \cdot 4.16438922228\\
\mathbf{else}:\\
\;\;\;\;z \cdot -0.0424927283095952\\
\end{array}
\end{array}
if x < -55 or 2 < x Initial program 11.3%
Simplified17.2%
Taylor expanded in x around inf 88.6%
*-commutative88.6%
Simplified88.6%
if -55 < x < 2Initial program 99.8%
Simplified99.4%
Taylor expanded in x around 0 70.4%
Final simplification79.5%
(FPCore (x y z) :precision binary64 (* z -0.0424927283095952))
double code(double x, double y, double z) {
return z * -0.0424927283095952;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = z * (-0.0424927283095952d0)
end function
public static double code(double x, double y, double z) {
return z * -0.0424927283095952;
}
def code(x, y, z): return z * -0.0424927283095952
function code(x, y, z) return Float64(z * -0.0424927283095952) end
function tmp = code(x, y, z) tmp = z * -0.0424927283095952; end
code[x_, y_, z_] := N[(z * -0.0424927283095952), $MachinePrecision]
\begin{array}{l}
\\
z \cdot -0.0424927283095952
\end{array}
Initial program 55.5%
Simplified58.3%
Taylor expanded in x around 0 36.7%
Final simplification36.7%
(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 2024021
(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)))