
(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 15 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))
(+
(*
x
(+ (* x (+ (* x (+ x 43.3400022514)) 263.505074721)) 313.399215894))
47.066876606))
2e+305)
(*
(fma
x
(fma
x
(fma
x
(/
(- 6193.6101064416025 (* (pow x 2.0) 17.342137594641823))
(- 78.6994924154 (* x 4.16438922228)))
137.519416416)
y)
z)
(/
(+ x -2.0)
(fma
x
(fma x (fma x (+ x 43.3400022514) 263.505074721) 313.399215894)
47.066876606)))
(*
x
(+
4.16438922228
(/
(-
(/ (- 3655.1204654076414 (/ (- 130977.50649958357 y) x)) x)
110.1139242984811)
x)))))
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+305) {
tmp = fma(x, fma(x, fma(x, ((6193.6101064416025 - (pow(x, 2.0) * 17.342137594641823)) / (78.6994924154 - (x * 4.16438922228))), 137.519416416), y), z) * ((x + -2.0) / fma(x, fma(x, fma(x, (x + 43.3400022514), 263.505074721), 313.399215894), 47.066876606));
} else {
tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x));
}
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+305) tmp = Float64(fma(x, fma(x, fma(x, Float64(Float64(6193.6101064416025 - Float64((x ^ 2.0) * 17.342137594641823)) / Float64(78.6994924154 - Float64(x * 4.16438922228))), 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(x * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3655.1204654076414 - Float64(Float64(130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x))); 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+305], N[(N[(x * N[(x * N[(x * N[(N[(6193.6101064416025 - N[(N[Power[x, 2.0], $MachinePrecision] * 17.342137594641823), $MachinePrecision]), $MachinePrecision] / N[(78.6994924154 - N[(x * 4.16438922228), $MachinePrecision]), $MachinePrecision]), $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[(x * N[(4.16438922228 + N[(N[(N[(N[(3655.1204654076414 - N[(N[(130977.50649958357 - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 110.1139242984811), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $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^{+305}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(x, \mathsf{fma}\left(x, \frac{6193.6101064416025 - {x}^{2} \cdot 17.342137594641823}{78.6994924154 - x \cdot 4.16438922228}, 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}:\\
\;\;\;\;x \cdot \left(4.16438922228 + \frac{\frac{3655.1204654076414 - \frac{130977.50649958357 - y}{x}}{x} - 110.1139242984811}{x}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 1.9999999999999999e305Initial program 97.0%
Simplified98.7%
fma-define98.7%
+-commutative98.7%
flip-+98.7%
metadata-eval98.7%
swap-sqr98.7%
pow298.7%
metadata-eval98.7%
Applied egg-rr98.7%
if 1.9999999999999999e305 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 0.3%
Simplified4.6%
Taylor expanded in z around 0 0.3%
Taylor expanded in x around -inf 97.9%
Final simplification98.4%
(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+305)
(*
(/
(+ x -2.0)
(fma
x
(fma x (fma x (+ x 43.3400022514) 263.505074721) 313.399215894)
47.066876606))
(fma
x
(fma x (fma x (fma x 4.16438922228 78.6994924154) 137.519416416) y)
z))
(*
x
(+
4.16438922228
(/
(-
(/ (- 3655.1204654076414 (/ (- 130977.50649958357 y) x)) x)
110.1139242984811)
x)))))
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+305) {
tmp = ((x + -2.0) / fma(x, fma(x, fma(x, (x + 43.3400022514), 263.505074721), 313.399215894), 47.066876606)) * fma(x, fma(x, fma(x, fma(x, 4.16438922228, 78.6994924154), 137.519416416), y), z);
} else {
tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x));
}
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+305) tmp = Float64(Float64(Float64(x + -2.0) / fma(x, fma(x, fma(x, Float64(x + 43.3400022514), 263.505074721), 313.399215894), 47.066876606)) * fma(x, fma(x, fma(x, fma(x, 4.16438922228, 78.6994924154), 137.519416416), y), z)); else tmp = Float64(x * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3655.1204654076414 - Float64(Float64(130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x))); 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+305], N[(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] * N[(x * N[(x * N[(x * N[(x * 4.16438922228 + 78.6994924154), $MachinePrecision] + 137.519416416), $MachinePrecision] + y), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision], N[(x * N[(4.16438922228 + N[(N[(N[(N[(3655.1204654076414 - N[(N[(130977.50649958357 - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 110.1139242984811), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $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^{+305}:\\
\;\;\;\;\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)} \cdot \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)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(4.16438922228 + \frac{\frac{3655.1204654076414 - \frac{130977.50649958357 - y}{x}}{x} - 110.1139242984811}{x}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 1.9999999999999999e305Initial program 97.0%
Simplified98.7%
if 1.9999999999999999e305 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 0.3%
Simplified4.6%
Taylor expanded in z around 0 0.3%
Taylor expanded in x around -inf 97.9%
Final simplification98.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0
(*
(- x 2.0)
(+
(*
x
(+
(*
x
(+ (* x (+ (* x 4.16438922228) 78.6994924154)) 137.519416416))
y))
z)))
(t_1 (* x (+ x 43.3400022514))))
(if (<=
(/
t_0
(+ (* x (+ (* x (+ t_1 263.505074721)) 313.399215894)) 47.066876606))
2e+305)
(/
t_0
(+
47.066876606
(* x (+ 313.399215894 (+ (* x t_1) (* x 263.505074721))))))
(*
x
(+
4.16438922228
(/
(-
(/ (- 3655.1204654076414 (/ (- 130977.50649958357 y) x)) x)
110.1139242984811)
x))))))
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);
double t_1 = x * (x + 43.3400022514);
double tmp;
if ((t_0 / ((x * ((x * (t_1 + 263.505074721)) + 313.399215894)) + 47.066876606)) <= 2e+305) {
tmp = t_0 / (47.066876606 + (x * (313.399215894 + ((x * t_1) + (x * 263.505074721)))));
} else {
tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x));
}
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 - 2.0d0) * ((x * ((x * ((x * ((x * 4.16438922228d0) + 78.6994924154d0)) + 137.519416416d0)) + y)) + z)
t_1 = x * (x + 43.3400022514d0)
if ((t_0 / ((x * ((x * (t_1 + 263.505074721d0)) + 313.399215894d0)) + 47.066876606d0)) <= 2d+305) then
tmp = t_0 / (47.066876606d0 + (x * (313.399215894d0 + ((x * t_1) + (x * 263.505074721d0)))))
else
tmp = x * (4.16438922228d0 + ((((3655.1204654076414d0 - ((130977.50649958357d0 - y) / x)) / x) - 110.1139242984811d0) / x))
end if
code = tmp
end function
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);
double t_1 = x * (x + 43.3400022514);
double tmp;
if ((t_0 / ((x * ((x * (t_1 + 263.505074721)) + 313.399215894)) + 47.066876606)) <= 2e+305) {
tmp = t_0 / (47.066876606 + (x * (313.399215894 + ((x * t_1) + (x * 263.505074721)))));
} else {
tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x));
}
return tmp;
}
def code(x, y, z): t_0 = (x - 2.0) * ((x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z) t_1 = x * (x + 43.3400022514) tmp = 0 if (t_0 / ((x * ((x * (t_1 + 263.505074721)) + 313.399215894)) + 47.066876606)) <= 2e+305: tmp = t_0 / (47.066876606 + (x * (313.399215894 + ((x * t_1) + (x * 263.505074721))))) else: tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x)) return tmp
function code(x, y, z) t_0 = 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)) t_1 = Float64(x * Float64(x + 43.3400022514)) tmp = 0.0 if (Float64(t_0 / Float64(Float64(x * Float64(Float64(x * Float64(t_1 + 263.505074721)) + 313.399215894)) + 47.066876606)) <= 2e+305) tmp = Float64(t_0 / Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(Float64(x * t_1) + Float64(x * 263.505074721)))))); else tmp = Float64(x * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3655.1204654076414 - Float64(Float64(130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x))); 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); t_1 = x * (x + 43.3400022514); tmp = 0.0; if ((t_0 / ((x * ((x * (t_1 + 263.505074721)) + 313.399215894)) + 47.066876606)) <= 2e+305) tmp = t_0 / (47.066876606 + (x * (313.399215894 + ((x * t_1) + (x * 263.505074721))))); else tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(x * N[(x + 43.3400022514), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 / N[(N[(x * N[(N[(x * N[(t$95$1 + 263.505074721), $MachinePrecision]), $MachinePrecision] + 313.399215894), $MachinePrecision]), $MachinePrecision] + 47.066876606), $MachinePrecision]), $MachinePrecision], 2e+305], N[(t$95$0 / N[(47.066876606 + N[(x * N[(313.399215894 + N[(N[(x * t$95$1), $MachinePrecision] + N[(x * 263.505074721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(4.16438922228 + N[(N[(N[(N[(3655.1204654076414 - N[(N[(130977.50649958357 - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 110.1139242984811), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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)\\
t_1 := x \cdot \left(x + 43.3400022514\right)\\
\mathbf{if}\;\frac{t\_0}{x \cdot \left(x \cdot \left(t\_1 + 263.505074721\right) + 313.399215894\right) + 47.066876606} \leq 2 \cdot 10^{+305}:\\
\;\;\;\;\frac{t\_0}{47.066876606 + x \cdot \left(313.399215894 + \left(x \cdot t\_1 + x \cdot 263.505074721\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(4.16438922228 + \frac{\frac{3655.1204654076414 - \frac{130977.50649958357 - y}{x}}{x} - 110.1139242984811}{x}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 1.9999999999999999e305Initial program 97.0%
*-commutative97.0%
distribute-lft-in97.0%
*-commutative97.0%
Applied egg-rr97.0%
if 1.9999999999999999e305 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 0.3%
Simplified4.6%
Taylor expanded in z around 0 0.3%
Taylor expanded in x around -inf 97.9%
Final simplification97.4%
(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 (<= t_0 2e+305)
t_0
(*
x
(+
4.16438922228
(/
(-
(/ (- 3655.1204654076414 (/ (- 130977.50649958357 y) x)) x)
110.1139242984811)
x))))))
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 <= 2e+305) {
tmp = t_0;
} else {
tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x));
}
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 = ((x - 2.0d0) * ((x * ((x * ((x * ((x * 4.16438922228d0) + 78.6994924154d0)) + 137.519416416d0)) + y)) + z)) / ((x * ((x * ((x * (x + 43.3400022514d0)) + 263.505074721d0)) + 313.399215894d0)) + 47.066876606d0)
if (t_0 <= 2d+305) then
tmp = t_0
else
tmp = x * (4.16438922228d0 + ((((3655.1204654076414d0 - ((130977.50649958357d0 - y) / x)) / x) - 110.1139242984811d0) / x))
end if
code = tmp
end function
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 <= 2e+305) {
tmp = t_0;
} else {
tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x));
}
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 <= 2e+305: tmp = t_0 else: tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x)) 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 <= 2e+305) tmp = t_0; else tmp = Float64(x * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3655.1204654076414 - Float64(Float64(130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x))); 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 <= 2e+305) tmp = t_0; else tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x)); 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[LessEqual[t$95$0, 2e+305], t$95$0, N[(x * N[(4.16438922228 + N[(N[(N[(N[(3655.1204654076414 - N[(N[(130977.50649958357 - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 110.1139242984811), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\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 2 \cdot 10^{+305}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(4.16438922228 + \frac{\frac{3655.1204654076414 - \frac{130977.50649958357 - y}{x}}{x} - 110.1139242984811}{x}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) < 1.9999999999999999e305Initial program 97.0%
if 1.9999999999999999e305 < (/.f64 (*.f64 (-.f64 x #s(literal 2 binary64)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x #s(literal 104109730557/25000000000 binary64)) #s(literal 393497462077/5000000000 binary64)) x) #s(literal 4297481763/31250000 binary64)) x) y) x) z)) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 x #s(literal 216700011257/5000000000 binary64)) x) #s(literal 263505074721/1000000000 binary64)) x) #s(literal 156699607947/500000000 binary64)) x) #s(literal 23533438303/500000000 binary64))) Initial program 0.3%
Simplified4.6%
Taylor expanded in z around 0 0.3%
Taylor expanded in x around -inf 97.9%
Final simplification97.4%
(FPCore (x y z)
:precision binary64
(if (or (<= x -1.35e+29) (not (<= x 4.1e+58)))
(*
x
(+
4.16438922228
(/
(-
(/ (- 3655.1204654076414 (/ (- 130977.50649958357 y) x)) x)
110.1139242984811)
x)))
(/
(*
(- x 2.0)
(+ z (* x (+ y (* x (+ 137.519416416 (* 4.16438922228 (* x x))))))))
(+
(* x (+ (* x (+ (* x (+ x 43.3400022514)) 263.505074721)) 313.399215894))
47.066876606))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.35e+29) || !(x <= 4.1e+58)) {
tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x));
} else {
tmp = ((x - 2.0) * (z + (x * (y + (x * (137.519416416 + (4.16438922228 * (x * x)))))))) / ((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 <= (-1.35d+29)) .or. (.not. (x <= 4.1d+58))) then
tmp = x * (4.16438922228d0 + ((((3655.1204654076414d0 - ((130977.50649958357d0 - y) / x)) / x) - 110.1139242984811d0) / x))
else
tmp = ((x - 2.0d0) * (z + (x * (y + (x * (137.519416416d0 + (4.16438922228d0 * (x * x)))))))) / ((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 <= -1.35e+29) || !(x <= 4.1e+58)) {
tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x));
} else {
tmp = ((x - 2.0) * (z + (x * (y + (x * (137.519416416 + (4.16438922228 * (x * x)))))))) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.35e+29) or not (x <= 4.1e+58): tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x)) else: tmp = ((x - 2.0) * (z + (x * (y + (x * (137.519416416 + (4.16438922228 * (x * x)))))))) / ((x * ((x * ((x * (x + 43.3400022514)) + 263.505074721)) + 313.399215894)) + 47.066876606) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.35e+29) || !(x <= 4.1e+58)) tmp = Float64(x * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3655.1204654076414 - Float64(Float64(130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x))); else tmp = Float64(Float64(Float64(x - 2.0) * Float64(z + Float64(x * Float64(y + Float64(x * Float64(137.519416416 + Float64(4.16438922228 * Float64(x * x)))))))) / 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 <= -1.35e+29) || ~((x <= 4.1e+58))) tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x)); else tmp = ((x - 2.0) * (z + (x * (y + (x * (137.519416416 + (4.16438922228 * (x * x)))))))) / ((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, -1.35e+29], N[Not[LessEqual[x, 4.1e+58]], $MachinePrecision]], N[(x * N[(4.16438922228 + N[(N[(N[(N[(3655.1204654076414 - N[(N[(130977.50649958357 - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 110.1139242984811), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x - 2.0), $MachinePrecision] * N[(z + N[(x * N[(y + N[(x * N[(137.519416416 + N[(4.16438922228 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -1.35 \cdot 10^{+29} \lor \neg \left(x \leq 4.1 \cdot 10^{+58}\right):\\
\;\;\;\;x \cdot \left(4.16438922228 + \frac{\frac{3655.1204654076414 - \frac{130977.50649958357 - y}{x}}{x} - 110.1139242984811}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot \left(z + x \cdot \left(y + x \cdot \left(137.519416416 + 4.16438922228 \cdot \left(x \cdot x\right)\right)\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 < -1.35e29 or 4.1e58 < x Initial program 3.7%
Simplified9.4%
Taylor expanded in z around 0 3.7%
Taylor expanded in x around -inf 98.2%
if -1.35e29 < x < 4.1e58Initial program 98.3%
add-sqr-sqrt49.5%
pow249.5%
Applied egg-rr49.5%
Taylor expanded in x around inf 97.8%
unpow297.8%
rem-square-sqrt97.8%
Simplified97.8%
unpow297.8%
Applied egg-rr97.8%
Final simplification98.0%
(FPCore (x y z)
:precision binary64
(if (or (<= x -3e+23) (not (<= x 1.05e+21)))
(*
x
(+
4.16438922228
(/
(-
(/ (- 3655.1204654076414 (/ (- 130977.50649958357 y) x)) x)
110.1139242984811)
x)))
(/
(* (- 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 <= -3e+23) || !(x <= 1.05e+21)) {
tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x));
} 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 <= (-3d+23)) .or. (.not. (x <= 1.05d+21))) then
tmp = x * (4.16438922228d0 + ((((3655.1204654076414d0 - ((130977.50649958357d0 - y) / x)) / x) - 110.1139242984811d0) / x))
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 <= -3e+23) || !(x <= 1.05e+21)) {
tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x));
} 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 <= -3e+23) or not (x <= 1.05e+21): tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x)) 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 <= -3e+23) || !(x <= 1.05e+21)) tmp = Float64(x * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3655.1204654076414 - Float64(Float64(130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x))); 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 <= -3e+23) || ~((x <= 1.05e+21))) tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x)); 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, -3e+23], N[Not[LessEqual[x, 1.05e+21]], $MachinePrecision]], N[(x * N[(4.16438922228 + N[(N[(N[(N[(3655.1204654076414 - N[(N[(130977.50649958357 - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 110.1139242984811), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $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 -3 \cdot 10^{+23} \lor \neg \left(x \leq 1.05 \cdot 10^{+21}\right):\\
\;\;\;\;x \cdot \left(4.16438922228 + \frac{\frac{3655.1204654076414 - \frac{130977.50649958357 - y}{x}}{x} - 110.1139242984811}{x}\right)\\
\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.0000000000000001e23 or 1.05e21 < x Initial program 9.8%
Simplified15.8%
Taylor expanded in z around 0 9.0%
Taylor expanded in x around -inf 96.8%
if -3.0000000000000001e23 < x < 1.05e21Initial program 99.0%
Taylor expanded in x around 0 98.4%
*-commutative98.4%
Simplified98.4%
Final simplification97.6%
(FPCore (x y z)
:precision binary64
(if (or (<= x -36.0) (not (<= x 7500.0)))
(*
x
(+
4.16438922228
(/
(-
(/ (- 3655.1204654076414 (/ (- 130977.50649958357 y) x)) x)
110.1139242984811)
x)))
(/
(*
(- x 2.0)
(+
(*
x
(+
(* x (+ (* x (+ (* x 4.16438922228) 78.6994924154)) 137.519416416))
y))
z))
(+ 47.066876606 (* x 313.399215894)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -36.0) || !(x <= 7500.0)) {
tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x));
} else {
tmp = ((x - 2.0) * ((x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / (47.066876606 + (x * 313.399215894));
}
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 <= (-36.0d0)) .or. (.not. (x <= 7500.0d0))) then
tmp = x * (4.16438922228d0 + ((((3655.1204654076414d0 - ((130977.50649958357d0 - y) / x)) / x) - 110.1139242984811d0) / x))
else
tmp = ((x - 2.0d0) * ((x * ((x * ((x * ((x * 4.16438922228d0) + 78.6994924154d0)) + 137.519416416d0)) + y)) + z)) / (47.066876606d0 + (x * 313.399215894d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -36.0) || !(x <= 7500.0)) {
tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x));
} else {
tmp = ((x - 2.0) * ((x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / (47.066876606 + (x * 313.399215894));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -36.0) or not (x <= 7500.0): tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x)) else: tmp = ((x - 2.0) * ((x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / (47.066876606 + (x * 313.399215894)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -36.0) || !(x <= 7500.0)) tmp = Float64(x * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3655.1204654076414 - Float64(Float64(130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x))); else tmp = 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 * 313.399215894))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -36.0) || ~((x <= 7500.0))) tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / x)); else tmp = ((x - 2.0) * ((x * ((x * ((x * ((x * 4.16438922228) + 78.6994924154)) + 137.519416416)) + y)) + z)) / (47.066876606 + (x * 313.399215894)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -36.0], N[Not[LessEqual[x, 7500.0]], $MachinePrecision]], N[(x * N[(4.16438922228 + N[(N[(N[(N[(3655.1204654076414 - N[(N[(130977.50649958357 - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 110.1139242984811), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 * 313.399215894), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -36 \lor \neg \left(x \leq 7500\right):\\
\;\;\;\;x \cdot \left(4.16438922228 + \frac{\frac{3655.1204654076414 - \frac{130977.50649958357 - y}{x}}{x} - 110.1139242984811}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\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 313.399215894}\\
\end{array}
\end{array}
if x < -36 or 7500 < x Initial program 13.8%
Simplified19.5%
Taylor expanded in z around 0 11.6%
Taylor expanded in x around -inf 94.5%
if -36 < x < 7500Initial program 99.7%
Taylor expanded in x around inf 98.0%
Taylor expanded in x around 0 97.8%
Final simplification96.1%
(FPCore (x y z)
:precision binary64
(if (or (<= x -190.0) (not (<= x 0.032)))
(*
x
(+
4.16438922228
(/
(-
(/ (- 3655.1204654076414 (/ (- 130977.50649958357 y) x)) x)
110.1139242984811)
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 <= -190.0) || !(x <= 0.032)) {
tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / 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 <= (-190.0d0)) .or. (.not. (x <= 0.032d0))) then
tmp = x * (4.16438922228d0 + ((((3655.1204654076414d0 - ((130977.50649958357d0 - y) / x)) / x) - 110.1139242984811d0) / 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 <= -190.0) || !(x <= 0.032)) {
tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / 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 <= -190.0) or not (x <= 0.032): tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / 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 <= -190.0) || !(x <= 0.032)) tmp = Float64(x * Float64(4.16438922228 + Float64(Float64(Float64(Float64(3655.1204654076414 - Float64(Float64(130977.50649958357 - y) / x)) / x) - 110.1139242984811) / 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 <= -190.0) || ~((x <= 0.032))) tmp = x * (4.16438922228 + ((((3655.1204654076414 - ((130977.50649958357 - y) / x)) / x) - 110.1139242984811) / 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, -190.0], N[Not[LessEqual[x, 0.032]], $MachinePrecision]], N[(x * N[(4.16438922228 + N[(N[(N[(N[(3655.1204654076414 - N[(N[(130977.50649958357 - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - 110.1139242984811), $MachinePrecision] / 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 -190 \lor \neg \left(x \leq 0.032\right):\\
\;\;\;\;x \cdot \left(4.16438922228 + \frac{\frac{3655.1204654076414 - \frac{130977.50649958357 - y}{x}}{x} - 110.1139242984811}{x}\right)\\
\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 < -190 or 0.032000000000000001 < x Initial program 14.4%
Simplified20.1%
Taylor expanded in z around 0 12.3%
Taylor expanded in x around -inf 93.9%
if -190 < x < 0.032000000000000001Initial program 99.7%
Simplified99.4%
Taylor expanded in x around 0 95.2%
Final simplification94.5%
(FPCore (x y z)
:precision binary64
(if (<= x -3.1e+31)
(* x 4.16438922228)
(if (<= x 0.032)
(+
(* z -0.0424927283095952)
(*
x
(- (* 0.0212463641547976 (+ z (* y -2.0))) (* z -0.28294182010212804))))
(* x (- 4.16438922228 (/ 110.1139242984811 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.1e+31) {
tmp = x * 4.16438922228;
} else if (x <= 0.032) {
tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804)));
} else {
tmp = x * (4.16438922228 - (110.1139242984811 / x));
}
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 <= (-3.1d+31)) then
tmp = x * 4.16438922228d0
else if (x <= 0.032d0) then
tmp = (z * (-0.0424927283095952d0)) + (x * ((0.0212463641547976d0 * (z + (y * (-2.0d0)))) - (z * (-0.28294182010212804d0))))
else
tmp = x * (4.16438922228d0 - (110.1139242984811d0 / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.1e+31) {
tmp = x * 4.16438922228;
} else if (x <= 0.032) {
tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804)));
} else {
tmp = x * (4.16438922228 - (110.1139242984811 / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.1e+31: tmp = x * 4.16438922228 elif x <= 0.032: tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804))) else: tmp = x * (4.16438922228 - (110.1139242984811 / x)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.1e+31) tmp = Float64(x * 4.16438922228); elseif (x <= 0.032) tmp = Float64(Float64(z * -0.0424927283095952) + Float64(x * Float64(Float64(0.0212463641547976 * Float64(z + Float64(y * -2.0))) - Float64(z * -0.28294182010212804)))); else tmp = Float64(x * Float64(4.16438922228 - Float64(110.1139242984811 / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.1e+31) tmp = x * 4.16438922228; elseif (x <= 0.032) tmp = (z * -0.0424927283095952) + (x * ((0.0212463641547976 * (z + (y * -2.0))) - (z * -0.28294182010212804))); else tmp = x * (4.16438922228 - (110.1139242984811 / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.1e+31], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, 0.032], 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], N[(x * N[(4.16438922228 - N[(110.1139242984811 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{+31}:\\
\;\;\;\;x \cdot 4.16438922228\\
\mathbf{elif}\;x \leq 0.032:\\
\;\;\;\;z \cdot -0.0424927283095952 + x \cdot \left(0.0212463641547976 \cdot \left(z + y \cdot -2\right) - z \cdot -0.28294182010212804\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(4.16438922228 - \frac{110.1139242984811}{x}\right)\\
\end{array}
\end{array}
if x < -3.1000000000000002e31Initial program 6.0%
Simplified10.2%
Taylor expanded in x around inf 94.5%
*-commutative94.5%
Simplified94.5%
if -3.1000000000000002e31 < x < 0.032000000000000001Initial program 98.2%
Simplified97.9%
Taylor expanded in x around 0 91.1%
if 0.032000000000000001 < x Initial program 18.5%
Simplified26.5%
Taylor expanded in x around inf 86.7%
associate-*r/86.7%
metadata-eval86.7%
Simplified86.7%
Final simplification91.0%
(FPCore (x y z)
:precision binary64
(if (<= x -3.1e+31)
(* x 4.16438922228)
(if (<= x 0.032)
(-
(* x (* z (- 0.3041881842569256 (* 0.0424927283095952 (/ y z)))))
(* z 0.0424927283095952))
(* x (- 4.16438922228 (/ 110.1139242984811 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -3.1e+31) {
tmp = x * 4.16438922228;
} else if (x <= 0.032) {
tmp = (x * (z * (0.3041881842569256 - (0.0424927283095952 * (y / z))))) - (z * 0.0424927283095952);
} else {
tmp = x * (4.16438922228 - (110.1139242984811 / x));
}
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 <= (-3.1d+31)) then
tmp = x * 4.16438922228d0
else if (x <= 0.032d0) then
tmp = (x * (z * (0.3041881842569256d0 - (0.0424927283095952d0 * (y / z))))) - (z * 0.0424927283095952d0)
else
tmp = x * (4.16438922228d0 - (110.1139242984811d0 / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -3.1e+31) {
tmp = x * 4.16438922228;
} else if (x <= 0.032) {
tmp = (x * (z * (0.3041881842569256 - (0.0424927283095952 * (y / z))))) - (z * 0.0424927283095952);
} else {
tmp = x * (4.16438922228 - (110.1139242984811 / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -3.1e+31: tmp = x * 4.16438922228 elif x <= 0.032: tmp = (x * (z * (0.3041881842569256 - (0.0424927283095952 * (y / z))))) - (z * 0.0424927283095952) else: tmp = x * (4.16438922228 - (110.1139242984811 / x)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -3.1e+31) tmp = Float64(x * 4.16438922228); elseif (x <= 0.032) tmp = Float64(Float64(x * Float64(z * Float64(0.3041881842569256 - Float64(0.0424927283095952 * Float64(y / z))))) - Float64(z * 0.0424927283095952)); else tmp = Float64(x * Float64(4.16438922228 - Float64(110.1139242984811 / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -3.1e+31) tmp = x * 4.16438922228; elseif (x <= 0.032) tmp = (x * (z * (0.3041881842569256 - (0.0424927283095952 * (y / z))))) - (z * 0.0424927283095952); else tmp = x * (4.16438922228 - (110.1139242984811 / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -3.1e+31], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, 0.032], N[(N[(x * N[(z * N[(0.3041881842569256 - N[(0.0424927283095952 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * 0.0424927283095952), $MachinePrecision]), $MachinePrecision], N[(x * N[(4.16438922228 - N[(110.1139242984811 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{+31}:\\
\;\;\;\;x \cdot 4.16438922228\\
\mathbf{elif}\;x \leq 0.032:\\
\;\;\;\;x \cdot \left(z \cdot \left(0.3041881842569256 - 0.0424927283095952 \cdot \frac{y}{z}\right)\right) - z \cdot 0.0424927283095952\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(4.16438922228 - \frac{110.1139242984811}{x}\right)\\
\end{array}
\end{array}
if x < -3.1000000000000002e31Initial program 6.0%
Simplified10.2%
Taylor expanded in x around inf 94.5%
*-commutative94.5%
Simplified94.5%
if -3.1000000000000002e31 < x < 0.032000000000000001Initial program 98.2%
Simplified97.9%
Taylor expanded in z around -inf 95.0%
Taylor expanded in x around 0 82.8%
if 0.032000000000000001 < x Initial program 18.5%
Simplified26.5%
Taylor expanded in x around inf 86.7%
associate-*r/86.7%
metadata-eval86.7%
Simplified86.7%
Final simplification86.8%
(FPCore (x y z)
:precision binary64
(if (<= x -255000.0)
(* x (- 4.16438922228 (/ 110.1139242984811 x)))
(if (<= x 7500.0)
(/
(* (- x 2.0) z)
(+ 47.066876606 (* x (+ 313.399215894 (* x 263.505074721)))))
(* x 4.16438922228))))
double code(double x, double y, double z) {
double tmp;
if (x <= -255000.0) {
tmp = x * (4.16438922228 - (110.1139242984811 / x));
} else if (x <= 7500.0) {
tmp = ((x - 2.0) * z) / (47.066876606 + (x * (313.399215894 + (x * 263.505074721))));
} 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 <= (-255000.0d0)) then
tmp = x * (4.16438922228d0 - (110.1139242984811d0 / x))
else if (x <= 7500.0d0) then
tmp = ((x - 2.0d0) * z) / (47.066876606d0 + (x * (313.399215894d0 + (x * 263.505074721d0))))
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 <= -255000.0) {
tmp = x * (4.16438922228 - (110.1139242984811 / x));
} else if (x <= 7500.0) {
tmp = ((x - 2.0) * z) / (47.066876606 + (x * (313.399215894 + (x * 263.505074721))));
} else {
tmp = x * 4.16438922228;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -255000.0: tmp = x * (4.16438922228 - (110.1139242984811 / x)) elif x <= 7500.0: tmp = ((x - 2.0) * z) / (47.066876606 + (x * (313.399215894 + (x * 263.505074721)))) else: tmp = x * 4.16438922228 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -255000.0) tmp = Float64(x * Float64(4.16438922228 - Float64(110.1139242984811 / x))); elseif (x <= 7500.0) tmp = Float64(Float64(Float64(x - 2.0) * z) / Float64(47.066876606 + Float64(x * Float64(313.399215894 + Float64(x * 263.505074721))))); else tmp = Float64(x * 4.16438922228); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -255000.0) tmp = x * (4.16438922228 - (110.1139242984811 / x)); elseif (x <= 7500.0) tmp = ((x - 2.0) * z) / (47.066876606 + (x * (313.399215894 + (x * 263.505074721)))); else tmp = x * 4.16438922228; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -255000.0], N[(x * N[(4.16438922228 - N[(110.1139242984811 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7500.0], N[(N[(N[(x - 2.0), $MachinePrecision] * z), $MachinePrecision] / N[(47.066876606 + N[(x * N[(313.399215894 + N[(x * 263.505074721), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 4.16438922228), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -255000:\\
\;\;\;\;x \cdot \left(4.16438922228 - \frac{110.1139242984811}{x}\right)\\
\mathbf{elif}\;x \leq 7500:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot z}{47.066876606 + x \cdot \left(313.399215894 + x \cdot 263.505074721\right)}\\
\mathbf{else}:\\
\;\;\;\;x \cdot 4.16438922228\\
\end{array}
\end{array}
if x < -255000Initial program 11.1%
Simplified15.0%
Taylor expanded in x around inf 87.2%
associate-*r/87.2%
metadata-eval87.2%
Simplified87.2%
if -255000 < x < 7500Initial program 99.7%
Simplified99.4%
Taylor expanded in z around inf 68.0%
Taylor expanded in x around 0 66.3%
*-commutative66.3%
Simplified66.3%
if 7500 < x Initial program 15.8%
Simplified23.9%
Taylor expanded in x around inf 89.4%
*-commutative89.4%
Simplified89.4%
Final simplification77.6%
(FPCore (x y z)
:precision binary64
(if (<= x -530000000000.0)
(* x 4.16438922228)
(if (<= x 0.032)
(/ (* (- x 2.0) z) (+ 47.066876606 (* x 313.399215894)))
(* x (- 4.16438922228 (/ 110.1139242984811 x))))))
double code(double x, double y, double z) {
double tmp;
if (x <= -530000000000.0) {
tmp = x * 4.16438922228;
} else if (x <= 0.032) {
tmp = ((x - 2.0) * z) / (47.066876606 + (x * 313.399215894));
} else {
tmp = x * (4.16438922228 - (110.1139242984811 / x));
}
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 <= (-530000000000.0d0)) then
tmp = x * 4.16438922228d0
else if (x <= 0.032d0) then
tmp = ((x - 2.0d0) * z) / (47.066876606d0 + (x * 313.399215894d0))
else
tmp = x * (4.16438922228d0 - (110.1139242984811d0 / x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -530000000000.0) {
tmp = x * 4.16438922228;
} else if (x <= 0.032) {
tmp = ((x - 2.0) * z) / (47.066876606 + (x * 313.399215894));
} else {
tmp = x * (4.16438922228 - (110.1139242984811 / x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -530000000000.0: tmp = x * 4.16438922228 elif x <= 0.032: tmp = ((x - 2.0) * z) / (47.066876606 + (x * 313.399215894)) else: tmp = x * (4.16438922228 - (110.1139242984811 / x)) return tmp
function code(x, y, z) tmp = 0.0 if (x <= -530000000000.0) tmp = Float64(x * 4.16438922228); elseif (x <= 0.032) tmp = Float64(Float64(Float64(x - 2.0) * z) / Float64(47.066876606 + Float64(x * 313.399215894))); else tmp = Float64(x * Float64(4.16438922228 - Float64(110.1139242984811 / x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -530000000000.0) tmp = x * 4.16438922228; elseif (x <= 0.032) tmp = ((x - 2.0) * z) / (47.066876606 + (x * 313.399215894)); else tmp = x * (4.16438922228 - (110.1139242984811 / x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -530000000000.0], N[(x * 4.16438922228), $MachinePrecision], If[LessEqual[x, 0.032], N[(N[(N[(x - 2.0), $MachinePrecision] * z), $MachinePrecision] / N[(47.066876606 + N[(x * 313.399215894), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(4.16438922228 - N[(110.1139242984811 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -530000000000:\\
\;\;\;\;x \cdot 4.16438922228\\
\mathbf{elif}\;x \leq 0.032:\\
\;\;\;\;\frac{\left(x - 2\right) \cdot z}{47.066876606 + x \cdot 313.399215894}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(4.16438922228 - \frac{110.1139242984811}{x}\right)\\
\end{array}
\end{array}
if x < -5.3e11Initial program 8.7%
Simplified12.7%
Taylor expanded in x around inf 90.8%
*-commutative90.8%
Simplified90.8%
if -5.3e11 < x < 0.032000000000000001Initial program 99.0%
Simplified98.6%
Taylor expanded in z around inf 66.6%
Taylor expanded in x around 0 65.3%
*-commutative65.3%
Simplified65.3%
if 0.032000000000000001 < x Initial program 18.5%
Simplified26.5%
Taylor expanded in x around inf 86.7%
associate-*r/86.7%
metadata-eval86.7%
Simplified86.7%
Final simplification77.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -740.0) (not (<= x 0.032))) (* x (- 4.16438922228 (/ 110.1139242984811 x))) (* z -0.0424927283095952)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -740.0) || !(x <= 0.032)) {
tmp = x * (4.16438922228 - (110.1139242984811 / x));
} 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 <= (-740.0d0)) .or. (.not. (x <= 0.032d0))) then
tmp = x * (4.16438922228d0 - (110.1139242984811d0 / x))
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 <= -740.0) || !(x <= 0.032)) {
tmp = x * (4.16438922228 - (110.1139242984811 / x));
} else {
tmp = z * -0.0424927283095952;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -740.0) or not (x <= 0.032): tmp = x * (4.16438922228 - (110.1139242984811 / x)) else: tmp = z * -0.0424927283095952 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -740.0) || !(x <= 0.032)) tmp = Float64(x * Float64(4.16438922228 - Float64(110.1139242984811 / x))); else tmp = Float64(z * -0.0424927283095952); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -740.0) || ~((x <= 0.032))) tmp = x * (4.16438922228 - (110.1139242984811 / x)); else tmp = z * -0.0424927283095952; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -740.0], N[Not[LessEqual[x, 0.032]], $MachinePrecision]], N[(x * N[(4.16438922228 - N[(110.1139242984811 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * -0.0424927283095952), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -740 \lor \neg \left(x \leq 0.032\right):\\
\;\;\;\;x \cdot \left(4.16438922228 - \frac{110.1139242984811}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot -0.0424927283095952\\
\end{array}
\end{array}
if x < -740 or 0.032000000000000001 < x Initial program 14.4%
Simplified20.1%
Taylor expanded in x around inf 87.0%
associate-*r/87.0%
metadata-eval87.0%
Simplified87.0%
if -740 < x < 0.032000000000000001Initial program 99.7%
Simplified99.4%
Taylor expanded in x around 0 66.1%
Final simplification77.0%
(FPCore (x y z) :precision binary64 (if (or (<= x -380.0) (not (<= x 2.0))) (* x 4.16438922228) (* z -0.0424927283095952)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -380.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 <= (-380.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 <= -380.0) || !(x <= 2.0)) {
tmp = x * 4.16438922228;
} else {
tmp = z * -0.0424927283095952;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -380.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 <= -380.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 <= -380.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, -380.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 -380 \lor \neg \left(x \leq 2\right):\\
\;\;\;\;x \cdot 4.16438922228\\
\mathbf{else}:\\
\;\;\;\;z \cdot -0.0424927283095952\\
\end{array}
\end{array}
if x < -380 or 2 < x Initial program 13.8%
Simplified19.5%
Taylor expanded in x around inf 87.5%
*-commutative87.5%
Simplified87.5%
if -380 < x < 2Initial program 99.7%
Simplified99.4%
Taylor expanded in x around 0 65.6%
Final simplification77.0%
(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.1%
Simplified57.9%
Taylor expanded in x around 0 33.1%
Final simplification33.1%
(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 2024185
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, C"
:precision binary64
:alt
(! :herbie-platform default (if (< x -332612872587000500000000000000000000000000000000000000000000000) (- (+ (/ y (* x x)) (* 104109730557/25000000000 x)) 1101139242984811/10000000000000) (if (< x 94299917145546730000000000000000000000000000000000000000) (* (/ (- x 2) 1) (/ (+ (* (+ (* (+ (* (+ (* x 104109730557/25000000000) 393497462077/5000000000) x) 4297481763/31250000) x) y) x) z) (+ (* (+ (+ (* 263505074721/1000000000 x) (+ (* 216700011257/5000000000 (* x x)) (* x (* x x)))) 156699607947/500000000) x) 23533438303/500000000))) (- (+ (/ y (* x x)) (* 104109730557/25000000000 x)) 1101139242984811/10000000000000))))
(/ (* (- 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)))