
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (+ x (+ (* -6.0 (* z (- y x))) (* (- y x) 4.0))))
double code(double x, double y, double z) {
return x + ((-6.0 * (z * (y - x))) + ((y - x) * 4.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((-6.0d0) * (z * (y - x))) + ((y - x) * 4.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((-6.0 * (z * (y - x))) + ((y - x) * 4.0));
}
def code(x, y, z): return x + ((-6.0 * (z * (y - x))) + ((y - x) * 4.0))
function code(x, y, z) return Float64(x + Float64(Float64(-6.0 * Float64(z * Float64(y - x))) + Float64(Float64(y - x) * 4.0))) end
function tmp = code(x, y, z) tmp = x + ((-6.0 * (z * (y - x))) + ((y - x) * 4.0)); end
code[x_, y_, z_] := N[(x + N[(N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(-6 \cdot \left(z \cdot \left(y - x\right)\right) + \left(y - x\right) \cdot 4\right)
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -560.0)
t_0
(if (<= z -7.8e-76)
(* y 4.0)
(if (<= z -1.45e-136)
(* x -3.0)
(if (<= z -2.2e-198)
(* y 4.0)
(if (<= z -4.5e-262)
(* x -3.0)
(if (<= z -1.22e-284)
(* y 4.0)
(if (<= z 4.2e-205)
(* x -3.0)
(if (<= z 0.63)
(* y 4.0)
(if (<= z 1.05e+72) t_0 (* -6.0 (* z y)))))))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -560.0) {
tmp = t_0;
} else if (z <= -7.8e-76) {
tmp = y * 4.0;
} else if (z <= -1.45e-136) {
tmp = x * -3.0;
} else if (z <= -2.2e-198) {
tmp = y * 4.0;
} else if (z <= -4.5e-262) {
tmp = x * -3.0;
} else if (z <= -1.22e-284) {
tmp = y * 4.0;
} else if (z <= 4.2e-205) {
tmp = x * -3.0;
} else if (z <= 0.63) {
tmp = y * 4.0;
} else if (z <= 1.05e+72) {
tmp = t_0;
} else {
tmp = -6.0 * (z * 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) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (x * z)
if (z <= (-560.0d0)) then
tmp = t_0
else if (z <= (-7.8d-76)) then
tmp = y * 4.0d0
else if (z <= (-1.45d-136)) then
tmp = x * (-3.0d0)
else if (z <= (-2.2d-198)) then
tmp = y * 4.0d0
else if (z <= (-4.5d-262)) then
tmp = x * (-3.0d0)
else if (z <= (-1.22d-284)) then
tmp = y * 4.0d0
else if (z <= 4.2d-205) then
tmp = x * (-3.0d0)
else if (z <= 0.63d0) then
tmp = y * 4.0d0
else if (z <= 1.05d+72) then
tmp = t_0
else
tmp = (-6.0d0) * (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -560.0) {
tmp = t_0;
} else if (z <= -7.8e-76) {
tmp = y * 4.0;
} else if (z <= -1.45e-136) {
tmp = x * -3.0;
} else if (z <= -2.2e-198) {
tmp = y * 4.0;
} else if (z <= -4.5e-262) {
tmp = x * -3.0;
} else if (z <= -1.22e-284) {
tmp = y * 4.0;
} else if (z <= 4.2e-205) {
tmp = x * -3.0;
} else if (z <= 0.63) {
tmp = y * 4.0;
} else if (z <= 1.05e+72) {
tmp = t_0;
} else {
tmp = -6.0 * (z * y);
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -560.0: tmp = t_0 elif z <= -7.8e-76: tmp = y * 4.0 elif z <= -1.45e-136: tmp = x * -3.0 elif z <= -2.2e-198: tmp = y * 4.0 elif z <= -4.5e-262: tmp = x * -3.0 elif z <= -1.22e-284: tmp = y * 4.0 elif z <= 4.2e-205: tmp = x * -3.0 elif z <= 0.63: tmp = y * 4.0 elif z <= 1.05e+72: tmp = t_0 else: tmp = -6.0 * (z * y) return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -560.0) tmp = t_0; elseif (z <= -7.8e-76) tmp = Float64(y * 4.0); elseif (z <= -1.45e-136) tmp = Float64(x * -3.0); elseif (z <= -2.2e-198) tmp = Float64(y * 4.0); elseif (z <= -4.5e-262) tmp = Float64(x * -3.0); elseif (z <= -1.22e-284) tmp = Float64(y * 4.0); elseif (z <= 4.2e-205) tmp = Float64(x * -3.0); elseif (z <= 0.63) tmp = Float64(y * 4.0); elseif (z <= 1.05e+72) tmp = t_0; else tmp = Float64(-6.0 * Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); tmp = 0.0; if (z <= -560.0) tmp = t_0; elseif (z <= -7.8e-76) tmp = y * 4.0; elseif (z <= -1.45e-136) tmp = x * -3.0; elseif (z <= -2.2e-198) tmp = y * 4.0; elseif (z <= -4.5e-262) tmp = x * -3.0; elseif (z <= -1.22e-284) tmp = y * 4.0; elseif (z <= 4.2e-205) tmp = x * -3.0; elseif (z <= 0.63) tmp = y * 4.0; elseif (z <= 1.05e+72) tmp = t_0; else tmp = -6.0 * (z * y); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -560.0], t$95$0, If[LessEqual[z, -7.8e-76], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.45e-136], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.2e-198], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4.5e-262], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.22e-284], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.2e-205], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.63], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.05e+72], t$95$0, N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -560:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-76}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-136}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-198}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-262}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.22 \cdot 10^{-284}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-205}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.63:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+72}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(z \cdot y\right)\\
\end{array}
\end{array}
if z < -560 or 0.630000000000000004 < z < 1.0500000000000001e72Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 61.3%
metadata-eval61.3%
cancel-sign-sub-inv61.3%
*-commutative61.3%
cancel-sign-sub-inv61.3%
distribute-lft-neg-in61.3%
*-commutative61.3%
distribute-lft-neg-in61.3%
metadata-eval61.3%
sub-neg61.3%
distribute-lft-in61.3%
metadata-eval61.3%
neg-mul-161.3%
*-commutative61.3%
associate-*l*61.3%
associate-+r+61.3%
metadata-eval61.3%
*-commutative61.3%
associate-*l*61.3%
metadata-eval61.3%
Simplified61.3%
Taylor expanded in z around inf 56.3%
Taylor expanded in x around 0 56.3%
if -560 < z < -7.8000000000000005e-76 or -1.44999999999999997e-136 < z < -2.2e-198 or -4.49999999999999998e-262 < z < -1.22e-284 or 4.19999999999999965e-205 < z < 0.630000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 66.8%
Taylor expanded in x around 0 67.6%
Taylor expanded in z around 0 63.5%
*-commutative63.5%
Simplified63.5%
if -7.8000000000000005e-76 < z < -1.44999999999999997e-136 or -2.2e-198 < z < -4.49999999999999998e-262 or -1.22e-284 < z < 4.19999999999999965e-205Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 70.6%
metadata-eval70.6%
cancel-sign-sub-inv70.6%
*-commutative70.6%
cancel-sign-sub-inv70.6%
distribute-lft-neg-in70.6%
*-commutative70.6%
distribute-lft-neg-in70.6%
metadata-eval70.6%
sub-neg70.6%
distribute-lft-in70.6%
metadata-eval70.6%
neg-mul-170.6%
*-commutative70.6%
associate-*l*70.6%
associate-+r+70.6%
metadata-eval70.6%
*-commutative70.6%
associate-*l*70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in z around 0 70.6%
*-commutative70.6%
Simplified70.6%
if 1.0500000000000001e72 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 72.6%
Taylor expanded in x around inf 57.3%
Taylor expanded in z around inf 71.9%
Final simplification64.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -275.0)
t_0
(if (<= z -3.4e-68)
(* y 4.0)
(if (<= z -1.85e-131)
(* x -3.0)
(if (<= z -4.9e-197)
(* y 4.0)
(if (<= z -5.8e-263)
(* x -3.0)
(if (<= z -1.3e-279)
(* y 4.0)
(if (<= z 3.2e-206)
(* x -3.0)
(if (<= z 0.54)
(* y 4.0)
(if (<= z 7.5e+71) t_0 (* y (* -6.0 z)))))))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -275.0) {
tmp = t_0;
} else if (z <= -3.4e-68) {
tmp = y * 4.0;
} else if (z <= -1.85e-131) {
tmp = x * -3.0;
} else if (z <= -4.9e-197) {
tmp = y * 4.0;
} else if (z <= -5.8e-263) {
tmp = x * -3.0;
} else if (z <= -1.3e-279) {
tmp = y * 4.0;
} else if (z <= 3.2e-206) {
tmp = x * -3.0;
} else if (z <= 0.54) {
tmp = y * 4.0;
} else if (z <= 7.5e+71) {
tmp = t_0;
} else {
tmp = y * (-6.0 * z);
}
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 = 6.0d0 * (x * z)
if (z <= (-275.0d0)) then
tmp = t_0
else if (z <= (-3.4d-68)) then
tmp = y * 4.0d0
else if (z <= (-1.85d-131)) then
tmp = x * (-3.0d0)
else if (z <= (-4.9d-197)) then
tmp = y * 4.0d0
else if (z <= (-5.8d-263)) then
tmp = x * (-3.0d0)
else if (z <= (-1.3d-279)) then
tmp = y * 4.0d0
else if (z <= 3.2d-206) then
tmp = x * (-3.0d0)
else if (z <= 0.54d0) then
tmp = y * 4.0d0
else if (z <= 7.5d+71) then
tmp = t_0
else
tmp = y * ((-6.0d0) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -275.0) {
tmp = t_0;
} else if (z <= -3.4e-68) {
tmp = y * 4.0;
} else if (z <= -1.85e-131) {
tmp = x * -3.0;
} else if (z <= -4.9e-197) {
tmp = y * 4.0;
} else if (z <= -5.8e-263) {
tmp = x * -3.0;
} else if (z <= -1.3e-279) {
tmp = y * 4.0;
} else if (z <= 3.2e-206) {
tmp = x * -3.0;
} else if (z <= 0.54) {
tmp = y * 4.0;
} else if (z <= 7.5e+71) {
tmp = t_0;
} else {
tmp = y * (-6.0 * z);
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -275.0: tmp = t_0 elif z <= -3.4e-68: tmp = y * 4.0 elif z <= -1.85e-131: tmp = x * -3.0 elif z <= -4.9e-197: tmp = y * 4.0 elif z <= -5.8e-263: tmp = x * -3.0 elif z <= -1.3e-279: tmp = y * 4.0 elif z <= 3.2e-206: tmp = x * -3.0 elif z <= 0.54: tmp = y * 4.0 elif z <= 7.5e+71: tmp = t_0 else: tmp = y * (-6.0 * z) return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -275.0) tmp = t_0; elseif (z <= -3.4e-68) tmp = Float64(y * 4.0); elseif (z <= -1.85e-131) tmp = Float64(x * -3.0); elseif (z <= -4.9e-197) tmp = Float64(y * 4.0); elseif (z <= -5.8e-263) tmp = Float64(x * -3.0); elseif (z <= -1.3e-279) tmp = Float64(y * 4.0); elseif (z <= 3.2e-206) tmp = Float64(x * -3.0); elseif (z <= 0.54) tmp = Float64(y * 4.0); elseif (z <= 7.5e+71) tmp = t_0; else tmp = Float64(y * Float64(-6.0 * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); tmp = 0.0; if (z <= -275.0) tmp = t_0; elseif (z <= -3.4e-68) tmp = y * 4.0; elseif (z <= -1.85e-131) tmp = x * -3.0; elseif (z <= -4.9e-197) tmp = y * 4.0; elseif (z <= -5.8e-263) tmp = x * -3.0; elseif (z <= -1.3e-279) tmp = y * 4.0; elseif (z <= 3.2e-206) tmp = x * -3.0; elseif (z <= 0.54) tmp = y * 4.0; elseif (z <= 7.5e+71) tmp = t_0; else tmp = y * (-6.0 * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -275.0], t$95$0, If[LessEqual[z, -3.4e-68], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.85e-131], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -4.9e-197], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -5.8e-263], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.3e-279], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.2e-206], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.54], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.5e+71], t$95$0, N[(y * N[(-6.0 * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -275:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-68}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{-131}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -4.9 \cdot 10^{-197}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-263}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-279}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-206}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.54:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+71}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-6 \cdot z\right)\\
\end{array}
\end{array}
if z < -275 or 0.54000000000000004 < z < 7.50000000000000007e71Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 61.3%
metadata-eval61.3%
cancel-sign-sub-inv61.3%
*-commutative61.3%
cancel-sign-sub-inv61.3%
distribute-lft-neg-in61.3%
*-commutative61.3%
distribute-lft-neg-in61.3%
metadata-eval61.3%
sub-neg61.3%
distribute-lft-in61.3%
metadata-eval61.3%
neg-mul-161.3%
*-commutative61.3%
associate-*l*61.3%
associate-+r+61.3%
metadata-eval61.3%
*-commutative61.3%
associate-*l*61.3%
metadata-eval61.3%
Simplified61.3%
Taylor expanded in z around inf 56.3%
Taylor expanded in x around 0 56.3%
if -275 < z < -3.40000000000000018e-68 or -1.8500000000000001e-131 < z < -4.9000000000000002e-197 or -5.80000000000000007e-263 < z < -1.3000000000000001e-279 or 3.19999999999999976e-206 < z < 0.54000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 66.8%
Taylor expanded in x around 0 67.6%
Taylor expanded in z around 0 63.5%
*-commutative63.5%
Simplified63.5%
if -3.40000000000000018e-68 < z < -1.8500000000000001e-131 or -4.9000000000000002e-197 < z < -5.80000000000000007e-263 or -1.3000000000000001e-279 < z < 3.19999999999999976e-206Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 70.6%
metadata-eval70.6%
cancel-sign-sub-inv70.6%
*-commutative70.6%
cancel-sign-sub-inv70.6%
distribute-lft-neg-in70.6%
*-commutative70.6%
distribute-lft-neg-in70.6%
metadata-eval70.6%
sub-neg70.6%
distribute-lft-in70.6%
metadata-eval70.6%
neg-mul-170.6%
*-commutative70.6%
associate-*l*70.6%
associate-+r+70.6%
metadata-eval70.6%
*-commutative70.6%
associate-*l*70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in z around 0 70.6%
*-commutative70.6%
Simplified70.6%
if 7.50000000000000007e71 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 72.6%
Taylor expanded in x around inf 57.3%
Taylor expanded in z around inf 71.9%
associate-*r*71.9%
*-commutative71.9%
associate-*l*72.0%
Simplified72.0%
Final simplification64.3%
(FPCore (x y z)
:precision binary64
(if (<= z -310.0)
(* 6.0 (* x z))
(if (<= z -9.2e-73)
(* y 4.0)
(if (<= z -2.5e-135)
(* x -3.0)
(if (<= z -1.1e-197)
(* y 4.0)
(if (<= z -3e-264)
(* x -3.0)
(if (<= z -2.8e-275)
(* y 4.0)
(if (<= z 9.6e-204)
(* x -3.0)
(if (<= z 0.6)
(* y 4.0)
(if (<= z 6e+72) (* z (* x 6.0)) (* y (* -6.0 z))))))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -310.0) {
tmp = 6.0 * (x * z);
} else if (z <= -9.2e-73) {
tmp = y * 4.0;
} else if (z <= -2.5e-135) {
tmp = x * -3.0;
} else if (z <= -1.1e-197) {
tmp = y * 4.0;
} else if (z <= -3e-264) {
tmp = x * -3.0;
} else if (z <= -2.8e-275) {
tmp = y * 4.0;
} else if (z <= 9.6e-204) {
tmp = x * -3.0;
} else if (z <= 0.6) {
tmp = y * 4.0;
} else if (z <= 6e+72) {
tmp = z * (x * 6.0);
} else {
tmp = y * (-6.0 * z);
}
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 (z <= (-310.0d0)) then
tmp = 6.0d0 * (x * z)
else if (z <= (-9.2d-73)) then
tmp = y * 4.0d0
else if (z <= (-2.5d-135)) then
tmp = x * (-3.0d0)
else if (z <= (-1.1d-197)) then
tmp = y * 4.0d0
else if (z <= (-3d-264)) then
tmp = x * (-3.0d0)
else if (z <= (-2.8d-275)) then
tmp = y * 4.0d0
else if (z <= 9.6d-204) then
tmp = x * (-3.0d0)
else if (z <= 0.6d0) then
tmp = y * 4.0d0
else if (z <= 6d+72) then
tmp = z * (x * 6.0d0)
else
tmp = y * ((-6.0d0) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -310.0) {
tmp = 6.0 * (x * z);
} else if (z <= -9.2e-73) {
tmp = y * 4.0;
} else if (z <= -2.5e-135) {
tmp = x * -3.0;
} else if (z <= -1.1e-197) {
tmp = y * 4.0;
} else if (z <= -3e-264) {
tmp = x * -3.0;
} else if (z <= -2.8e-275) {
tmp = y * 4.0;
} else if (z <= 9.6e-204) {
tmp = x * -3.0;
} else if (z <= 0.6) {
tmp = y * 4.0;
} else if (z <= 6e+72) {
tmp = z * (x * 6.0);
} else {
tmp = y * (-6.0 * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -310.0: tmp = 6.0 * (x * z) elif z <= -9.2e-73: tmp = y * 4.0 elif z <= -2.5e-135: tmp = x * -3.0 elif z <= -1.1e-197: tmp = y * 4.0 elif z <= -3e-264: tmp = x * -3.0 elif z <= -2.8e-275: tmp = y * 4.0 elif z <= 9.6e-204: tmp = x * -3.0 elif z <= 0.6: tmp = y * 4.0 elif z <= 6e+72: tmp = z * (x * 6.0) else: tmp = y * (-6.0 * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -310.0) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= -9.2e-73) tmp = Float64(y * 4.0); elseif (z <= -2.5e-135) tmp = Float64(x * -3.0); elseif (z <= -1.1e-197) tmp = Float64(y * 4.0); elseif (z <= -3e-264) tmp = Float64(x * -3.0); elseif (z <= -2.8e-275) tmp = Float64(y * 4.0); elseif (z <= 9.6e-204) tmp = Float64(x * -3.0); elseif (z <= 0.6) tmp = Float64(y * 4.0); elseif (z <= 6e+72) tmp = Float64(z * Float64(x * 6.0)); else tmp = Float64(y * Float64(-6.0 * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -310.0) tmp = 6.0 * (x * z); elseif (z <= -9.2e-73) tmp = y * 4.0; elseif (z <= -2.5e-135) tmp = x * -3.0; elseif (z <= -1.1e-197) tmp = y * 4.0; elseif (z <= -3e-264) tmp = x * -3.0; elseif (z <= -2.8e-275) tmp = y * 4.0; elseif (z <= 9.6e-204) tmp = x * -3.0; elseif (z <= 0.6) tmp = y * 4.0; elseif (z <= 6e+72) tmp = z * (x * 6.0); else tmp = y * (-6.0 * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -310.0], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9.2e-73], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -2.5e-135], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.1e-197], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -3e-264], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.8e-275], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 9.6e-204], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6e+72], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(-6.0 * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -310:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-73}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-135}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-197}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-264}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-275}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-204}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+72}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-6 \cdot z\right)\\
\end{array}
\end{array}
if z < -310Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 56.2%
metadata-eval56.2%
cancel-sign-sub-inv56.2%
*-commutative56.2%
cancel-sign-sub-inv56.2%
distribute-lft-neg-in56.2%
*-commutative56.2%
distribute-lft-neg-in56.2%
metadata-eval56.2%
sub-neg56.2%
distribute-lft-in56.2%
metadata-eval56.2%
neg-mul-156.2%
*-commutative56.2%
associate-*l*56.2%
associate-+r+56.2%
metadata-eval56.2%
*-commutative56.2%
associate-*l*56.2%
metadata-eval56.2%
Simplified56.2%
Taylor expanded in z around inf 54.4%
Taylor expanded in x around 0 54.4%
if -310 < z < -9.19999999999999953e-73 or -2.5000000000000001e-135 < z < -1.1e-197 or -3e-264 < z < -2.79999999999999994e-275 or 9.6e-204 < z < 0.599999999999999978Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 66.8%
Taylor expanded in x around 0 67.6%
Taylor expanded in z around 0 63.5%
*-commutative63.5%
Simplified63.5%
if -9.19999999999999953e-73 < z < -2.5000000000000001e-135 or -1.1e-197 < z < -3e-264 or -2.79999999999999994e-275 < z < 9.6e-204Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 70.6%
metadata-eval70.6%
cancel-sign-sub-inv70.6%
*-commutative70.6%
cancel-sign-sub-inv70.6%
distribute-lft-neg-in70.6%
*-commutative70.6%
distribute-lft-neg-in70.6%
metadata-eval70.6%
sub-neg70.6%
distribute-lft-in70.6%
metadata-eval70.6%
neg-mul-170.6%
*-commutative70.6%
associate-*l*70.6%
associate-+r+70.6%
metadata-eval70.6%
*-commutative70.6%
associate-*l*70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in z around 0 70.6%
*-commutative70.6%
Simplified70.6%
if 0.599999999999999978 < z < 6.00000000000000006e72Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 74.7%
metadata-eval74.7%
cancel-sign-sub-inv74.7%
*-commutative74.7%
cancel-sign-sub-inv74.7%
distribute-lft-neg-in74.7%
*-commutative74.7%
distribute-lft-neg-in74.7%
metadata-eval74.7%
sub-neg74.7%
distribute-lft-in74.7%
metadata-eval74.7%
neg-mul-174.7%
*-commutative74.7%
associate-*l*74.7%
associate-+r+74.7%
metadata-eval74.7%
*-commutative74.7%
associate-*l*74.7%
metadata-eval74.7%
Simplified74.7%
Taylor expanded in z around inf 61.2%
Taylor expanded in x around 0 61.3%
*-commutative61.3%
*-commutative61.3%
associate-*r*61.4%
*-commutative61.4%
Simplified61.4%
if 6.00000000000000006e72 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 72.6%
Taylor expanded in x around inf 57.3%
Taylor expanded in z around inf 71.9%
associate-*r*71.9%
*-commutative71.9%
associate-*l*72.0%
Simplified72.0%
Final simplification64.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z (- y x)))))
(if (<= z -0.062)
t_0
(if (<= z -3.4e-76)
(* y 4.0)
(if (<= z -4.5e-133)
(* x -3.0)
(if (<= z -1.96e-197)
(* y 4.0)
(if (<= z -2.05e-262)
(* x -3.0)
(if (<= z -4e-279)
(* y 4.0)
(if (<= z 9.5e-206)
(* x -3.0)
(if (<= z 0.63) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * (y - x));
double tmp;
if (z <= -0.062) {
tmp = t_0;
} else if (z <= -3.4e-76) {
tmp = y * 4.0;
} else if (z <= -4.5e-133) {
tmp = x * -3.0;
} else if (z <= -1.96e-197) {
tmp = y * 4.0;
} else if (z <= -2.05e-262) {
tmp = x * -3.0;
} else if (z <= -4e-279) {
tmp = y * 4.0;
} else if (z <= 9.5e-206) {
tmp = x * -3.0;
} else if (z <= 0.63) {
tmp = y * 4.0;
} 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 = (-6.0d0) * (z * (y - x))
if (z <= (-0.062d0)) then
tmp = t_0
else if (z <= (-3.4d-76)) then
tmp = y * 4.0d0
else if (z <= (-4.5d-133)) then
tmp = x * (-3.0d0)
else if (z <= (-1.96d-197)) then
tmp = y * 4.0d0
else if (z <= (-2.05d-262)) then
tmp = x * (-3.0d0)
else if (z <= (-4d-279)) then
tmp = y * 4.0d0
else if (z <= 9.5d-206) then
tmp = x * (-3.0d0)
else if (z <= 0.63d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (z * (y - x));
double tmp;
if (z <= -0.062) {
tmp = t_0;
} else if (z <= -3.4e-76) {
tmp = y * 4.0;
} else if (z <= -4.5e-133) {
tmp = x * -3.0;
} else if (z <= -1.96e-197) {
tmp = y * 4.0;
} else if (z <= -2.05e-262) {
tmp = x * -3.0;
} else if (z <= -4e-279) {
tmp = y * 4.0;
} else if (z <= 9.5e-206) {
tmp = x * -3.0;
} else if (z <= 0.63) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * (y - x)) tmp = 0 if z <= -0.062: tmp = t_0 elif z <= -3.4e-76: tmp = y * 4.0 elif z <= -4.5e-133: tmp = x * -3.0 elif z <= -1.96e-197: tmp = y * 4.0 elif z <= -2.05e-262: tmp = x * -3.0 elif z <= -4e-279: tmp = y * 4.0 elif z <= 9.5e-206: tmp = x * -3.0 elif z <= 0.63: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -0.062) tmp = t_0; elseif (z <= -3.4e-76) tmp = Float64(y * 4.0); elseif (z <= -4.5e-133) tmp = Float64(x * -3.0); elseif (z <= -1.96e-197) tmp = Float64(y * 4.0); elseif (z <= -2.05e-262) tmp = Float64(x * -3.0); elseif (z <= -4e-279) tmp = Float64(y * 4.0); elseif (z <= 9.5e-206) tmp = Float64(x * -3.0); elseif (z <= 0.63) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * (y - x)); tmp = 0.0; if (z <= -0.062) tmp = t_0; elseif (z <= -3.4e-76) tmp = y * 4.0; elseif (z <= -4.5e-133) tmp = x * -3.0; elseif (z <= -1.96e-197) tmp = y * 4.0; elseif (z <= -2.05e-262) tmp = x * -3.0; elseif (z <= -4e-279) tmp = y * 4.0; elseif (z <= 9.5e-206) tmp = x * -3.0; elseif (z <= 0.63) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.062], t$95$0, If[LessEqual[z, -3.4e-76], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4.5e-133], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.96e-197], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -2.05e-262], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -4e-279], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 9.5e-206], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.63], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -0.062:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-76}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-133}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.96 \cdot 10^{-197}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -2.05 \cdot 10^{-262}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-279}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-206}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.63:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.062 or 0.630000000000000004 < z Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 94.8%
if -0.062 < z < -3.3999999999999999e-76 or -4.50000000000000009e-133 < z < -1.9600000000000001e-197 or -2.05000000000000013e-262 < z < -4.00000000000000022e-279 or 9.49999999999999979e-206 < z < 0.630000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 65.8%
Taylor expanded in x around 0 66.7%
Taylor expanded in z around 0 65.0%
*-commutative65.0%
Simplified65.0%
if -3.3999999999999999e-76 < z < -4.50000000000000009e-133 or -1.9600000000000001e-197 < z < -2.05000000000000013e-262 or -4.00000000000000022e-279 < z < 9.49999999999999979e-206Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 70.6%
metadata-eval70.6%
cancel-sign-sub-inv70.6%
*-commutative70.6%
cancel-sign-sub-inv70.6%
distribute-lft-neg-in70.6%
*-commutative70.6%
distribute-lft-neg-in70.6%
metadata-eval70.6%
sub-neg70.6%
distribute-lft-in70.6%
metadata-eval70.6%
neg-mul-170.6%
*-commutative70.6%
associate-*l*70.6%
associate-+r+70.6%
metadata-eval70.6%
*-commutative70.6%
associate-*l*70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in z around 0 70.6%
*-commutative70.6%
Simplified70.6%
Final simplification81.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z))))
(t_1 (* -6.0 (* z (- y x)))))
(if (<= z -4800.0)
t_1
(if (<= z -2.5e-69)
t_0
(if (<= z -1.3e-131)
(* x -3.0)
(if (<= z -2.5e-197)
(* y 4.0)
(if (<= z -2.45e-262)
(* x -3.0)
(if (<= z -1.9e-284)
(* y 4.0)
(if (<= z 3.6e-205) (* x -3.0) (if (<= z 0.63) t_0 t_1))))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double t_1 = -6.0 * (z * (y - x));
double tmp;
if (z <= -4800.0) {
tmp = t_1;
} else if (z <= -2.5e-69) {
tmp = t_0;
} else if (z <= -1.3e-131) {
tmp = x * -3.0;
} else if (z <= -2.5e-197) {
tmp = y * 4.0;
} else if (z <= -2.45e-262) {
tmp = x * -3.0;
} else if (z <= -1.9e-284) {
tmp = y * 4.0;
} else if (z <= 3.6e-205) {
tmp = x * -3.0;
} else if (z <= 0.63) {
tmp = t_0;
} else {
tmp = t_1;
}
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 = 6.0d0 * (y * (0.6666666666666666d0 - z))
t_1 = (-6.0d0) * (z * (y - x))
if (z <= (-4800.0d0)) then
tmp = t_1
else if (z <= (-2.5d-69)) then
tmp = t_0
else if (z <= (-1.3d-131)) then
tmp = x * (-3.0d0)
else if (z <= (-2.5d-197)) then
tmp = y * 4.0d0
else if (z <= (-2.45d-262)) then
tmp = x * (-3.0d0)
else if (z <= (-1.9d-284)) then
tmp = y * 4.0d0
else if (z <= 3.6d-205) then
tmp = x * (-3.0d0)
else if (z <= 0.63d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double t_1 = -6.0 * (z * (y - x));
double tmp;
if (z <= -4800.0) {
tmp = t_1;
} else if (z <= -2.5e-69) {
tmp = t_0;
} else if (z <= -1.3e-131) {
tmp = x * -3.0;
} else if (z <= -2.5e-197) {
tmp = y * 4.0;
} else if (z <= -2.45e-262) {
tmp = x * -3.0;
} else if (z <= -1.9e-284) {
tmp = y * 4.0;
} else if (z <= 3.6e-205) {
tmp = x * -3.0;
} else if (z <= 0.63) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * (0.6666666666666666 - z)) t_1 = -6.0 * (z * (y - x)) tmp = 0 if z <= -4800.0: tmp = t_1 elif z <= -2.5e-69: tmp = t_0 elif z <= -1.3e-131: tmp = x * -3.0 elif z <= -2.5e-197: tmp = y * 4.0 elif z <= -2.45e-262: tmp = x * -3.0 elif z <= -1.9e-284: tmp = y * 4.0 elif z <= 3.6e-205: tmp = x * -3.0 elif z <= 0.63: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))) t_1 = Float64(-6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -4800.0) tmp = t_1; elseif (z <= -2.5e-69) tmp = t_0; elseif (z <= -1.3e-131) tmp = Float64(x * -3.0); elseif (z <= -2.5e-197) tmp = Float64(y * 4.0); elseif (z <= -2.45e-262) tmp = Float64(x * -3.0); elseif (z <= -1.9e-284) tmp = Float64(y * 4.0); elseif (z <= 3.6e-205) tmp = Float64(x * -3.0); elseif (z <= 0.63) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * (0.6666666666666666 - z)); t_1 = -6.0 * (z * (y - x)); tmp = 0.0; if (z <= -4800.0) tmp = t_1; elseif (z <= -2.5e-69) tmp = t_0; elseif (z <= -1.3e-131) tmp = x * -3.0; elseif (z <= -2.5e-197) tmp = y * 4.0; elseif (z <= -2.45e-262) tmp = x * -3.0; elseif (z <= -1.9e-284) tmp = y * 4.0; elseif (z <= 3.6e-205) tmp = x * -3.0; elseif (z <= 0.63) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4800.0], t$95$1, If[LessEqual[z, -2.5e-69], t$95$0, If[LessEqual[z, -1.3e-131], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.5e-197], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -2.45e-262], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.9e-284], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.6e-205], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.63], t$95$0, t$95$1]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
t_1 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -4800:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-69}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-131}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-197}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -2.45 \cdot 10^{-262}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-284}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-205}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.63:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4800 or 0.630000000000000004 < z Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 95.8%
if -4800 < z < -2.50000000000000017e-69 or 3.5999999999999998e-205 < z < 0.630000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 63.0%
Taylor expanded in x around 0 64.0%
if -2.50000000000000017e-69 < z < -1.29999999999999998e-131 or -2.5000000000000001e-197 < z < -2.4500000000000001e-262 or -1.8999999999999999e-284 < z < 3.5999999999999998e-205Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 70.6%
metadata-eval70.6%
cancel-sign-sub-inv70.6%
*-commutative70.6%
cancel-sign-sub-inv70.6%
distribute-lft-neg-in70.6%
*-commutative70.6%
distribute-lft-neg-in70.6%
metadata-eval70.6%
sub-neg70.6%
distribute-lft-in70.6%
metadata-eval70.6%
neg-mul-170.6%
*-commutative70.6%
associate-*l*70.6%
associate-+r+70.6%
metadata-eval70.6%
*-commutative70.6%
associate-*l*70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in z around 0 70.6%
*-commutative70.6%
Simplified70.6%
if -1.29999999999999998e-131 < z < -2.5000000000000001e-197 or -2.4500000000000001e-262 < z < -1.8999999999999999e-284Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 78.4%
Taylor expanded in x around 0 78.6%
Taylor expanded in z around 0 78.8%
*-commutative78.8%
Simplified78.8%
Final simplification82.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z y))))
(if (<= z -0.65)
t_0
(if (<= z -2.5e-66)
(* y 4.0)
(if (<= z -5.5e-133)
(* x -3.0)
(if (<= z -6.7e-198)
(* y 4.0)
(if (<= z -8e-265)
(* x -3.0)
(if (<= z -1.46e-276)
(* y 4.0)
(if (<= z 2.2e-203)
(* x -3.0)
(if (<= z 14.5) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * y);
double tmp;
if (z <= -0.65) {
tmp = t_0;
} else if (z <= -2.5e-66) {
tmp = y * 4.0;
} else if (z <= -5.5e-133) {
tmp = x * -3.0;
} else if (z <= -6.7e-198) {
tmp = y * 4.0;
} else if (z <= -8e-265) {
tmp = x * -3.0;
} else if (z <= -1.46e-276) {
tmp = y * 4.0;
} else if (z <= 2.2e-203) {
tmp = x * -3.0;
} else if (z <= 14.5) {
tmp = y * 4.0;
} 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 = (-6.0d0) * (z * y)
if (z <= (-0.65d0)) then
tmp = t_0
else if (z <= (-2.5d-66)) then
tmp = y * 4.0d0
else if (z <= (-5.5d-133)) then
tmp = x * (-3.0d0)
else if (z <= (-6.7d-198)) then
tmp = y * 4.0d0
else if (z <= (-8d-265)) then
tmp = x * (-3.0d0)
else if (z <= (-1.46d-276)) then
tmp = y * 4.0d0
else if (z <= 2.2d-203) then
tmp = x * (-3.0d0)
else if (z <= 14.5d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (z * y);
double tmp;
if (z <= -0.65) {
tmp = t_0;
} else if (z <= -2.5e-66) {
tmp = y * 4.0;
} else if (z <= -5.5e-133) {
tmp = x * -3.0;
} else if (z <= -6.7e-198) {
tmp = y * 4.0;
} else if (z <= -8e-265) {
tmp = x * -3.0;
} else if (z <= -1.46e-276) {
tmp = y * 4.0;
} else if (z <= 2.2e-203) {
tmp = x * -3.0;
} else if (z <= 14.5) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * y) tmp = 0 if z <= -0.65: tmp = t_0 elif z <= -2.5e-66: tmp = y * 4.0 elif z <= -5.5e-133: tmp = x * -3.0 elif z <= -6.7e-198: tmp = y * 4.0 elif z <= -8e-265: tmp = x * -3.0 elif z <= -1.46e-276: tmp = y * 4.0 elif z <= 2.2e-203: tmp = x * -3.0 elif z <= 14.5: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * y)) tmp = 0.0 if (z <= -0.65) tmp = t_0; elseif (z <= -2.5e-66) tmp = Float64(y * 4.0); elseif (z <= -5.5e-133) tmp = Float64(x * -3.0); elseif (z <= -6.7e-198) tmp = Float64(y * 4.0); elseif (z <= -8e-265) tmp = Float64(x * -3.0); elseif (z <= -1.46e-276) tmp = Float64(y * 4.0); elseif (z <= 2.2e-203) tmp = Float64(x * -3.0); elseif (z <= 14.5) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * y); tmp = 0.0; if (z <= -0.65) tmp = t_0; elseif (z <= -2.5e-66) tmp = y * 4.0; elseif (z <= -5.5e-133) tmp = x * -3.0; elseif (z <= -6.7e-198) tmp = y * 4.0; elseif (z <= -8e-265) tmp = x * -3.0; elseif (z <= -1.46e-276) tmp = y * 4.0; elseif (z <= 2.2e-203) tmp = x * -3.0; elseif (z <= 14.5) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.65], t$95$0, If[LessEqual[z, -2.5e-66], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -5.5e-133], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -6.7e-198], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -8e-265], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.46e-276], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.2e-203], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 14.5], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -0.65:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-66}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-133}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -6.7 \cdot 10^{-198}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-265}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.46 \cdot 10^{-276}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-203}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 14.5:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.650000000000000022 or 14.5 < z Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 55.9%
Taylor expanded in x around inf 42.6%
Taylor expanded in z around inf 53.4%
if -0.650000000000000022 < z < -2.49999999999999981e-66 or -5.49999999999999977e-133 < z < -6.69999999999999982e-198 or -7.99999999999999988e-265 < z < -1.45999999999999994e-276 or 2.2e-203 < z < 14.5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 64.4%
Taylor expanded in x around 0 64.9%
Taylor expanded in z around 0 63.2%
*-commutative63.2%
Simplified63.2%
if -2.49999999999999981e-66 < z < -5.49999999999999977e-133 or -6.69999999999999982e-198 < z < -7.99999999999999988e-265 or -1.45999999999999994e-276 < z < 2.2e-203Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 70.6%
metadata-eval70.6%
cancel-sign-sub-inv70.6%
*-commutative70.6%
cancel-sign-sub-inv70.6%
distribute-lft-neg-in70.6%
*-commutative70.6%
distribute-lft-neg-in70.6%
metadata-eval70.6%
sub-neg70.6%
distribute-lft-in70.6%
metadata-eval70.6%
neg-mul-170.6%
*-commutative70.6%
associate-*l*70.6%
associate-+r+70.6%
metadata-eval70.6%
*-commutative70.6%
associate-*l*70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in z around 0 70.6%
*-commutative70.6%
Simplified70.6%
Final simplification59.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -5.8e+77) (not (<= x 0.3))) (* x (+ -3.0 (* z 6.0))) (* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -5.8e+77) || !(x <= 0.3)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
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 <= (-5.8d+77)) .or. (.not. (x <= 0.3d0))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -5.8e+77) || !(x <= 0.3)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -5.8e+77) or not (x <= 0.3): tmp = x * (-3.0 + (z * 6.0)) else: tmp = 6.0 * (y * (0.6666666666666666 - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -5.8e+77) || !(x <= 0.3)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -5.8e+77) || ~((x <= 0.3))) tmp = x * (-3.0 + (z * 6.0)); else tmp = 6.0 * (y * (0.6666666666666666 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.8e+77], N[Not[LessEqual[x, 0.3]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{+77} \lor \neg \left(x \leq 0.3\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -5.8000000000000003e77 or 0.299999999999999989 < x Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 84.5%
metadata-eval84.5%
cancel-sign-sub-inv84.5%
*-commutative84.5%
cancel-sign-sub-inv84.5%
distribute-lft-neg-in84.5%
*-commutative84.5%
distribute-lft-neg-in84.5%
metadata-eval84.5%
sub-neg84.5%
distribute-lft-in84.6%
metadata-eval84.6%
neg-mul-184.6%
*-commutative84.6%
associate-*l*84.6%
associate-+r+84.6%
metadata-eval84.6%
*-commutative84.6%
associate-*l*84.6%
metadata-eval84.6%
Simplified84.6%
if -5.8000000000000003e77 < x < 0.299999999999999989Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 75.2%
Taylor expanded in x around 0 75.3%
Final simplification79.1%
(FPCore (x y z) :precision binary64 (if (or (<= x -3.8e+77) (not (<= x 13.8))) (* x (+ -3.0 (* z 6.0))) (* y (+ 4.0 (* -6.0 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -3.8e+77) || !(x <= 13.8)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (-6.0 * z));
}
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.8d+77)) .or. (.not. (x <= 13.8d0))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = y * (4.0d0 + ((-6.0d0) * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -3.8e+77) || !(x <= 13.8)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (-6.0 * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -3.8e+77) or not (x <= 13.8): tmp = x * (-3.0 + (z * 6.0)) else: tmp = y * (4.0 + (-6.0 * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -3.8e+77) || !(x <= 13.8)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(y * Float64(4.0 + Float64(-6.0 * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -3.8e+77) || ~((x <= 13.8))) tmp = x * (-3.0 + (z * 6.0)); else tmp = y * (4.0 + (-6.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -3.8e+77], N[Not[LessEqual[x, 13.8]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(-6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{+77} \lor \neg \left(x \leq 13.8\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + -6 \cdot z\right)\\
\end{array}
\end{array}
if x < -3.8000000000000001e77 or 13.800000000000001 < x Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 84.5%
metadata-eval84.5%
cancel-sign-sub-inv84.5%
*-commutative84.5%
cancel-sign-sub-inv84.5%
distribute-lft-neg-in84.5%
*-commutative84.5%
distribute-lft-neg-in84.5%
metadata-eval84.5%
sub-neg84.5%
distribute-lft-in84.6%
metadata-eval84.6%
neg-mul-184.6%
*-commutative84.6%
associate-*l*84.6%
associate-+r+84.6%
metadata-eval84.6%
*-commutative84.6%
associate-*l*84.6%
metadata-eval84.6%
Simplified84.6%
if -3.8000000000000001e77 < x < 13.800000000000001Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 75.4%
Final simplification79.2%
(FPCore (x y z) :precision binary64 (if (<= z -0.58) (* -6.0 (* z (- y x))) (if (<= z 0.52) (+ x (* (- y x) 4.0)) (* z (* -6.0 (- y x))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = -6.0 * (z * (y - x));
} else if (z <= 0.52) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * (-6.0 * (y - 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 (z <= (-0.58d0)) then
tmp = (-6.0d0) * (z * (y - x))
else if (z <= 0.52d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = z * ((-6.0d0) * (y - x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = -6.0 * (z * (y - x));
} else if (z <= 0.52) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * (-6.0 * (y - x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.58: tmp = -6.0 * (z * (y - x)) elif z <= 0.52: tmp = x + ((y - x) * 4.0) else: tmp = z * (-6.0 * (y - x)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.58) tmp = Float64(-6.0 * Float64(z * Float64(y - x))); elseif (z <= 0.52) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(z * Float64(-6.0 * Float64(y - x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.58) tmp = -6.0 * (z * (y - x)); elseif (z <= 0.52) tmp = x + ((y - x) * 4.0); else tmp = z * (-6.0 * (y - x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.58], N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.52], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(-6.0 * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58:\\
\;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-6 \cdot \left(y - x\right)\right)\\
\end{array}
\end{array}
if z < -0.57999999999999996Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 95.0%
if -0.57999999999999996 < z < 0.52000000000000002Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 97.7%
if 0.52000000000000002 < z Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 94.7%
associate-*r*94.7%
*-commutative94.7%
associate-*r*94.8%
Simplified94.8%
Final simplification96.2%
(FPCore (x y z) :precision binary64 (if (<= z -0.55) (* -6.0 (* z (- y x))) (if (<= z 0.52) (+ (* x -3.0) (* y 4.0)) (* z (* -6.0 (- y x))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.55) {
tmp = -6.0 * (z * (y - x));
} else if (z <= 0.52) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = z * (-6.0 * (y - 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 (z <= (-0.55d0)) then
tmp = (-6.0d0) * (z * (y - x))
else if (z <= 0.52d0) then
tmp = (x * (-3.0d0)) + (y * 4.0d0)
else
tmp = z * ((-6.0d0) * (y - x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.55) {
tmp = -6.0 * (z * (y - x));
} else if (z <= 0.52) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = z * (-6.0 * (y - x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.55: tmp = -6.0 * (z * (y - x)) elif z <= 0.52: tmp = (x * -3.0) + (y * 4.0) else: tmp = z * (-6.0 * (y - x)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.55) tmp = Float64(-6.0 * Float64(z * Float64(y - x))); elseif (z <= 0.52) tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); else tmp = Float64(z * Float64(-6.0 * Float64(y - x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.55) tmp = -6.0 * (z * (y - x)); elseif (z <= 0.52) tmp = (x * -3.0) + (y * 4.0); else tmp = z * (-6.0 * (y - x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.55], N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.52], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(-6.0 * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.55:\\
\;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-6 \cdot \left(y - x\right)\right)\\
\end{array}
\end{array}
if z < -0.55000000000000004Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 95.0%
if -0.55000000000000004 < z < 0.52000000000000002Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 99.4%
Taylor expanded in z around 0 97.2%
distribute-lft-in97.2%
associate-+r+97.2%
associate-*r*97.5%
metadata-eval97.5%
distribute-rgt1-in97.5%
*-commutative97.5%
metadata-eval97.5%
associate-*r*97.7%
metadata-eval97.7%
*-commutative97.7%
Simplified97.7%
if 0.52000000000000002 < z Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 94.7%
associate-*r*94.7%
*-commutative94.7%
associate-*r*94.8%
Simplified94.8%
Final simplification96.2%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.8e-16) (not (<= x 2.3e+15))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.8e-16) || !(x <= 2.3e+15)) {
tmp = x * -3.0;
} else {
tmp = y * 4.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) :: tmp
if ((x <= (-1.8d-16)) .or. (.not. (x <= 2.3d+15))) then
tmp = x * (-3.0d0)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.8e-16) || !(x <= 2.3e+15)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.8e-16) or not (x <= 2.3e+15): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.8e-16) || !(x <= 2.3e+15)) tmp = Float64(x * -3.0); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.8e-16) || ~((x <= 2.3e+15))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.8e-16], N[Not[LessEqual[x, 2.3e+15]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{-16} \lor \neg \left(x \leq 2.3 \cdot 10^{+15}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -1.79999999999999991e-16 or 2.3e15 < x Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 79.4%
metadata-eval79.4%
cancel-sign-sub-inv79.4%
*-commutative79.4%
cancel-sign-sub-inv79.4%
distribute-lft-neg-in79.4%
*-commutative79.4%
distribute-lft-neg-in79.4%
metadata-eval79.4%
sub-neg79.4%
distribute-lft-in79.5%
metadata-eval79.5%
neg-mul-179.5%
*-commutative79.5%
associate-*l*79.5%
associate-+r+79.5%
metadata-eval79.5%
*-commutative79.5%
associate-*l*79.5%
metadata-eval79.5%
Simplified79.5%
Taylor expanded in z around 0 38.6%
*-commutative38.6%
Simplified38.6%
if -1.79999999999999991e-16 < x < 2.3e15Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 77.9%
Taylor expanded in x around 0 77.9%
Taylor expanded in z around 0 37.4%
*-commutative37.4%
Simplified37.4%
Final simplification38.0%
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- 0.6666666666666666 z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * (0.6666666666666666 - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * (0.6666666666666666d0 - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * (0.6666666666666666 - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * (0.6666666666666666 - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(0.6666666666666666 - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * (0.6666666666666666 - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 49.9%
metadata-eval49.9%
cancel-sign-sub-inv49.9%
*-commutative49.9%
cancel-sign-sub-inv49.9%
distribute-lft-neg-in49.9%
*-commutative49.9%
distribute-lft-neg-in49.9%
metadata-eval49.9%
sub-neg49.9%
distribute-lft-in49.9%
metadata-eval49.9%
neg-mul-149.9%
*-commutative49.9%
associate-*l*49.9%
associate-+r+49.9%
metadata-eval49.9%
*-commutative49.9%
associate-*l*49.9%
metadata-eval49.9%
Simplified49.9%
Taylor expanded in z around 0 25.2%
*-commutative25.2%
Simplified25.2%
Final simplification25.2%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 52.6%
Taylor expanded in x around inf 2.9%
Final simplification2.9%
herbie shell --seed 2024050
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D"
:precision binary64
(+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))