
(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 18 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 (fma (- y x) (fma z -6.0 4.0) x))
double code(double x, double y, double z) {
return fma((y - x), fma(z, -6.0, 4.0), x);
}
function code(x, y, z) return fma(Float64(y - x), fma(z, -6.0, 4.0), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(z * -6.0 + 4.0), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, \mathsf{fma}\left(z, -6, 4\right), x\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
distribute-rgt-neg-out99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
(FPCore (x y z) :precision binary64 (+ x (* (- y x) (fma z -6.0 4.0))))
double code(double x, double y, double z) {
return x + ((y - x) * fma(z, -6.0, 4.0));
}
function code(x, y, z) return Float64(x + Float64(Float64(y - x) * fma(z, -6.0, 4.0))) end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(z * -6.0 + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \mathsf{fma}\left(z, -6, 4\right)
\end{array}
Initial 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%
fma-undefine99.8%
+-commutative99.8%
fma-undefine99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))))
(if (<= z -4.5e+181)
t_0
(if (<= z -8e+149)
(* y (* z -6.0))
(if (<= z -3.5e+98)
(* z (* x 6.0))
(if (<= z -2.0)
(* z (* y -6.0))
(if (<= z -3.4e-140)
(* x -3.0)
(if (<= z -7e-177)
(* y 4.0)
(if (<= z 1.6e-49)
(* x -3.0)
(if (<= z 0.58) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -4.5e+181) {
tmp = t_0;
} else if (z <= -8e+149) {
tmp = y * (z * -6.0);
} else if (z <= -3.5e+98) {
tmp = z * (x * 6.0);
} else if (z <= -2.0) {
tmp = z * (y * -6.0);
} else if (z <= -3.4e-140) {
tmp = x * -3.0;
} else if (z <= -7e-177) {
tmp = y * 4.0;
} else if (z <= 1.6e-49) {
tmp = x * -3.0;
} else if (z <= 0.58) {
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 = x * (z * 6.0d0)
if (z <= (-4.5d+181)) then
tmp = t_0
else if (z <= (-8d+149)) then
tmp = y * (z * (-6.0d0))
else if (z <= (-3.5d+98)) then
tmp = z * (x * 6.0d0)
else if (z <= (-2.0d0)) then
tmp = z * (y * (-6.0d0))
else if (z <= (-3.4d-140)) then
tmp = x * (-3.0d0)
else if (z <= (-7d-177)) then
tmp = y * 4.0d0
else if (z <= 1.6d-49) then
tmp = x * (-3.0d0)
else if (z <= 0.58d0) 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 = x * (z * 6.0);
double tmp;
if (z <= -4.5e+181) {
tmp = t_0;
} else if (z <= -8e+149) {
tmp = y * (z * -6.0);
} else if (z <= -3.5e+98) {
tmp = z * (x * 6.0);
} else if (z <= -2.0) {
tmp = z * (y * -6.0);
} else if (z <= -3.4e-140) {
tmp = x * -3.0;
} else if (z <= -7e-177) {
tmp = y * 4.0;
} else if (z <= 1.6e-49) {
tmp = x * -3.0;
} else if (z <= 0.58) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -4.5e+181: tmp = t_0 elif z <= -8e+149: tmp = y * (z * -6.0) elif z <= -3.5e+98: tmp = z * (x * 6.0) elif z <= -2.0: tmp = z * (y * -6.0) elif z <= -3.4e-140: tmp = x * -3.0 elif z <= -7e-177: tmp = y * 4.0 elif z <= 1.6e-49: tmp = x * -3.0 elif z <= 0.58: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -4.5e+181) tmp = t_0; elseif (z <= -8e+149) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= -3.5e+98) tmp = Float64(z * Float64(x * 6.0)); elseif (z <= -2.0) tmp = Float64(z * Float64(y * -6.0)); elseif (z <= -3.4e-140) tmp = Float64(x * -3.0); elseif (z <= -7e-177) tmp = Float64(y * 4.0); elseif (z <= 1.6e-49) tmp = Float64(x * -3.0); elseif (z <= 0.58) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z * 6.0); tmp = 0.0; if (z <= -4.5e+181) tmp = t_0; elseif (z <= -8e+149) tmp = y * (z * -6.0); elseif (z <= -3.5e+98) tmp = z * (x * 6.0); elseif (z <= -2.0) tmp = z * (y * -6.0); elseif (z <= -3.4e-140) tmp = x * -3.0; elseif (z <= -7e-177) tmp = y * 4.0; elseif (z <= 1.6e-49) tmp = x * -3.0; elseif (z <= 0.58) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+181], t$95$0, If[LessEqual[z, -8e+149], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.5e+98], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.0], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.4e-140], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -7e-177], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.6e-49], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.58], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+181}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -8 \cdot 10^{+149}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{+98}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq -2:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-140}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-177}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-49}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.58:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -4.5e181 or 0.57999999999999996 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 55.5%
sub-neg55.5%
distribute-rgt-in55.5%
metadata-eval55.5%
distribute-lft-neg-in55.5%
associate-+r+55.5%
metadata-eval55.5%
distribute-rgt-neg-in55.5%
metadata-eval55.5%
Simplified55.5%
Taylor expanded in z around inf 54.6%
*-commutative54.6%
Simplified54.6%
if -4.5e181 < z < -8.00000000000000039e149Initial program 99.4%
+-commutative99.4%
associate-*l*100.0%
fma-define100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 81.8%
Taylor expanded in z around inf 81.8%
if -8.00000000000000039e149 < z < -3.5e98Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 82.2%
sub-neg82.2%
distribute-rgt-in82.2%
metadata-eval82.2%
distribute-lft-neg-in82.2%
associate-+r+82.2%
metadata-eval82.2%
distribute-rgt-neg-in82.2%
metadata-eval82.2%
Simplified82.2%
Taylor expanded in z around inf 82.3%
*-commutative82.3%
*-commutative82.3%
associate-*r*82.4%
Simplified82.4%
if -3.5e98 < z < -2Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-out99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 65.5%
Taylor expanded in z around inf 61.5%
Taylor expanded in y around 0 61.6%
associate-*r*61.6%
Simplified61.6%
if -2 < z < -3.40000000000000008e-140 or -7.0000000000000003e-177 < z < 1.60000000000000001e-49Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 60.8%
sub-neg60.8%
distribute-rgt-in60.8%
metadata-eval60.8%
distribute-lft-neg-in60.8%
associate-+r+60.8%
metadata-eval60.8%
distribute-rgt-neg-in60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in z around 0 60.8%
*-commutative60.8%
Simplified60.8%
if -3.40000000000000008e-140 < z < -7.0000000000000003e-177 or 1.60000000000000001e-49 < z < 0.57999999999999996Initial program 99.4%
+-commutative99.4%
associate-*l*99.7%
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 78.6%
Taylor expanded in z around 0 74.5%
Final simplification61.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))))
(if (<= z -7.8e+181)
t_0
(if (<= z -1.45e+153)
(* y (* z -6.0))
(if (<= z -2.8e+98)
(* z (* x 6.0))
(if (<= z -2.5)
(* -6.0 (* y z))
(if (<= z -4.7e-148)
(* x -3.0)
(if (<= z -3.4e-176)
(* y 4.0)
(if (<= z 8.2e-49)
(* x -3.0)
(if (<= z 0.65) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -7.8e+181) {
tmp = t_0;
} else if (z <= -1.45e+153) {
tmp = y * (z * -6.0);
} else if (z <= -2.8e+98) {
tmp = z * (x * 6.0);
} else if (z <= -2.5) {
tmp = -6.0 * (y * z);
} else if (z <= -4.7e-148) {
tmp = x * -3.0;
} else if (z <= -3.4e-176) {
tmp = y * 4.0;
} else if (z <= 8.2e-49) {
tmp = x * -3.0;
} else if (z <= 0.65) {
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 = x * (z * 6.0d0)
if (z <= (-7.8d+181)) then
tmp = t_0
else if (z <= (-1.45d+153)) then
tmp = y * (z * (-6.0d0))
else if (z <= (-2.8d+98)) then
tmp = z * (x * 6.0d0)
else if (z <= (-2.5d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-4.7d-148)) then
tmp = x * (-3.0d0)
else if (z <= (-3.4d-176)) then
tmp = y * 4.0d0
else if (z <= 8.2d-49) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) 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 = x * (z * 6.0);
double tmp;
if (z <= -7.8e+181) {
tmp = t_0;
} else if (z <= -1.45e+153) {
tmp = y * (z * -6.0);
} else if (z <= -2.8e+98) {
tmp = z * (x * 6.0);
} else if (z <= -2.5) {
tmp = -6.0 * (y * z);
} else if (z <= -4.7e-148) {
tmp = x * -3.0;
} else if (z <= -3.4e-176) {
tmp = y * 4.0;
} else if (z <= 8.2e-49) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -7.8e+181: tmp = t_0 elif z <= -1.45e+153: tmp = y * (z * -6.0) elif z <= -2.8e+98: tmp = z * (x * 6.0) elif z <= -2.5: tmp = -6.0 * (y * z) elif z <= -4.7e-148: tmp = x * -3.0 elif z <= -3.4e-176: tmp = y * 4.0 elif z <= 8.2e-49: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -7.8e+181) tmp = t_0; elseif (z <= -1.45e+153) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= -2.8e+98) tmp = Float64(z * Float64(x * 6.0)); elseif (z <= -2.5) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -4.7e-148) tmp = Float64(x * -3.0); elseif (z <= -3.4e-176) tmp = Float64(y * 4.0); elseif (z <= 8.2e-49) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z * 6.0); tmp = 0.0; if (z <= -7.8e+181) tmp = t_0; elseif (z <= -1.45e+153) tmp = y * (z * -6.0); elseif (z <= -2.8e+98) tmp = z * (x * 6.0); elseif (z <= -2.5) tmp = -6.0 * (y * z); elseif (z <= -4.7e-148) tmp = x * -3.0; elseif (z <= -3.4e-176) tmp = y * 4.0; elseif (z <= 8.2e-49) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e+181], t$95$0, If[LessEqual[z, -1.45e+153], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.8e+98], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.5], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.7e-148], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3.4e-176], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 8.2e-49], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{+181}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{+153}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{+98}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq -2.5:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-148}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-176}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-49}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -7.8e181 or 0.650000000000000022 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 55.5%
sub-neg55.5%
distribute-rgt-in55.5%
metadata-eval55.5%
distribute-lft-neg-in55.5%
associate-+r+55.5%
metadata-eval55.5%
distribute-rgt-neg-in55.5%
metadata-eval55.5%
Simplified55.5%
Taylor expanded in z around inf 54.6%
*-commutative54.6%
Simplified54.6%
if -7.8e181 < z < -1.45000000000000001e153Initial program 99.4%
+-commutative99.4%
associate-*l*100.0%
fma-define100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 81.8%
Taylor expanded in z around inf 81.8%
if -1.45000000000000001e153 < z < -2.8000000000000001e98Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 82.2%
sub-neg82.2%
distribute-rgt-in82.2%
metadata-eval82.2%
distribute-lft-neg-in82.2%
associate-+r+82.2%
metadata-eval82.2%
distribute-rgt-neg-in82.2%
metadata-eval82.2%
Simplified82.2%
Taylor expanded in z around inf 82.3%
*-commutative82.3%
*-commutative82.3%
associate-*r*82.4%
Simplified82.4%
if -2.8000000000000001e98 < z < -2.5Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-out99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 65.5%
Taylor expanded in z around inf 61.5%
Taylor expanded in y around 0 61.6%
if -2.5 < z < -4.69999999999999975e-148 or -3.3999999999999997e-176 < z < 8.2000000000000003e-49Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 60.8%
sub-neg60.8%
distribute-rgt-in60.8%
metadata-eval60.8%
distribute-lft-neg-in60.8%
associate-+r+60.8%
metadata-eval60.8%
distribute-rgt-neg-in60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in z around 0 60.8%
*-commutative60.8%
Simplified60.8%
if -4.69999999999999975e-148 < z < -3.3999999999999997e-176 or 8.2000000000000003e-49 < z < 0.650000000000000022Initial program 99.4%
+-commutative99.4%
associate-*l*99.7%
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 78.6%
Taylor expanded in z around 0 74.5%
Final simplification61.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))))
(if (<= z -8.5e+183)
t_0
(if (<= z -4.8e+148)
(* y (* z -6.0))
(if (<= z -2.7e+98)
(* 6.0 (* x z))
(if (<= z -0.68)
(* -6.0 (* y z))
(if (<= z -2.8e-147)
(* x -3.0)
(if (<= z -4.8e-176)
(* y 4.0)
(if (<= z 6e-49)
(* x -3.0)
(if (<= z 0.52) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -8.5e+183) {
tmp = t_0;
} else if (z <= -4.8e+148) {
tmp = y * (z * -6.0);
} else if (z <= -2.7e+98) {
tmp = 6.0 * (x * z);
} else if (z <= -0.68) {
tmp = -6.0 * (y * z);
} else if (z <= -2.8e-147) {
tmp = x * -3.0;
} else if (z <= -4.8e-176) {
tmp = y * 4.0;
} else if (z <= 6e-49) {
tmp = x * -3.0;
} else if (z <= 0.52) {
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 = x * (z * 6.0d0)
if (z <= (-8.5d+183)) then
tmp = t_0
else if (z <= (-4.8d+148)) then
tmp = y * (z * (-6.0d0))
else if (z <= (-2.7d+98)) then
tmp = 6.0d0 * (x * z)
else if (z <= (-0.68d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-2.8d-147)) then
tmp = x * (-3.0d0)
else if (z <= (-4.8d-176)) then
tmp = y * 4.0d0
else if (z <= 6d-49) then
tmp = x * (-3.0d0)
else if (z <= 0.52d0) 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 = x * (z * 6.0);
double tmp;
if (z <= -8.5e+183) {
tmp = t_0;
} else if (z <= -4.8e+148) {
tmp = y * (z * -6.0);
} else if (z <= -2.7e+98) {
tmp = 6.0 * (x * z);
} else if (z <= -0.68) {
tmp = -6.0 * (y * z);
} else if (z <= -2.8e-147) {
tmp = x * -3.0;
} else if (z <= -4.8e-176) {
tmp = y * 4.0;
} else if (z <= 6e-49) {
tmp = x * -3.0;
} else if (z <= 0.52) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -8.5e+183: tmp = t_0 elif z <= -4.8e+148: tmp = y * (z * -6.0) elif z <= -2.7e+98: tmp = 6.0 * (x * z) elif z <= -0.68: tmp = -6.0 * (y * z) elif z <= -2.8e-147: tmp = x * -3.0 elif z <= -4.8e-176: tmp = y * 4.0 elif z <= 6e-49: tmp = x * -3.0 elif z <= 0.52: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -8.5e+183) tmp = t_0; elseif (z <= -4.8e+148) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= -2.7e+98) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= -0.68) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -2.8e-147) tmp = Float64(x * -3.0); elseif (z <= -4.8e-176) tmp = Float64(y * 4.0); elseif (z <= 6e-49) tmp = Float64(x * -3.0); elseif (z <= 0.52) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z * 6.0); tmp = 0.0; if (z <= -8.5e+183) tmp = t_0; elseif (z <= -4.8e+148) tmp = y * (z * -6.0); elseif (z <= -2.7e+98) tmp = 6.0 * (x * z); elseif (z <= -0.68) tmp = -6.0 * (y * z); elseif (z <= -2.8e-147) tmp = x * -3.0; elseif (z <= -4.8e-176) tmp = y * 4.0; elseif (z <= 6e-49) tmp = x * -3.0; elseif (z <= 0.52) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.5e+183], t$95$0, If[LessEqual[z, -4.8e+148], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.7e+98], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.68], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.8e-147], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -4.8e-176], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6e-49], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -8.5 \cdot 10^{+183}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{+148}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{+98}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -0.68:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-147}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-176}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-49}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -8.5000000000000004e183 or 0.52000000000000002 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 55.5%
sub-neg55.5%
distribute-rgt-in55.5%
metadata-eval55.5%
distribute-lft-neg-in55.5%
associate-+r+55.5%
metadata-eval55.5%
distribute-rgt-neg-in55.5%
metadata-eval55.5%
Simplified55.5%
Taylor expanded in z around inf 54.6%
*-commutative54.6%
Simplified54.6%
if -8.5000000000000004e183 < z < -4.79999999999999989e148Initial program 99.4%
+-commutative99.4%
associate-*l*100.0%
fma-define100.0%
sub-neg100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
metadata-eval100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 81.8%
Taylor expanded in z around inf 81.8%
if -4.79999999999999989e148 < z < -2.7e98Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 82.2%
sub-neg82.2%
distribute-rgt-in82.2%
metadata-eval82.2%
distribute-lft-neg-in82.2%
associate-+r+82.2%
metadata-eval82.2%
distribute-rgt-neg-in82.2%
metadata-eval82.2%
Simplified82.2%
Taylor expanded in z around inf 82.3%
if -2.7e98 < z < -0.680000000000000049Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-out99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 65.5%
Taylor expanded in z around inf 61.5%
Taylor expanded in y around 0 61.6%
if -0.680000000000000049 < z < -2.8e-147 or -4.80000000000000012e-176 < z < 6e-49Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 60.8%
sub-neg60.8%
distribute-rgt-in60.8%
metadata-eval60.8%
distribute-lft-neg-in60.8%
associate-+r+60.8%
metadata-eval60.8%
distribute-rgt-neg-in60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in z around 0 60.8%
*-commutative60.8%
Simplified60.8%
if -2.8e-147 < z < -4.80000000000000012e-176 or 6e-49 < z < 0.52000000000000002Initial program 99.4%
+-commutative99.4%
associate-*l*99.7%
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 78.6%
Taylor expanded in z around 0 74.5%
Final simplification61.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))) (t_1 (* -6.0 (* y z))))
(if (<= z -2e+182)
t_0
(if (<= z -6.5e+151)
t_1
(if (<= z -3.8e+98)
(* 6.0 (* x z))
(if (<= z -4.0)
t_1
(if (<= z -1.4e-152)
(* x -3.0)
(if (<= z -3e-176)
(* y 4.0)
(if (<= z 1.85e-50)
(* x -3.0)
(if (<= z 0.52) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -2e+182) {
tmp = t_0;
} else if (z <= -6.5e+151) {
tmp = t_1;
} else if (z <= -3.8e+98) {
tmp = 6.0 * (x * z);
} else if (z <= -4.0) {
tmp = t_1;
} else if (z <= -1.4e-152) {
tmp = x * -3.0;
} else if (z <= -3e-176) {
tmp = y * 4.0;
} else if (z <= 1.85e-50) {
tmp = x * -3.0;
} else if (z <= 0.52) {
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) :: t_1
real(8) :: tmp
t_0 = x * (z * 6.0d0)
t_1 = (-6.0d0) * (y * z)
if (z <= (-2d+182)) then
tmp = t_0
else if (z <= (-6.5d+151)) then
tmp = t_1
else if (z <= (-3.8d+98)) then
tmp = 6.0d0 * (x * z)
else if (z <= (-4.0d0)) then
tmp = t_1
else if (z <= (-1.4d-152)) then
tmp = x * (-3.0d0)
else if (z <= (-3d-176)) then
tmp = y * 4.0d0
else if (z <= 1.85d-50) then
tmp = x * (-3.0d0)
else if (z <= 0.52d0) 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 = x * (z * 6.0);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -2e+182) {
tmp = t_0;
} else if (z <= -6.5e+151) {
tmp = t_1;
} else if (z <= -3.8e+98) {
tmp = 6.0 * (x * z);
} else if (z <= -4.0) {
tmp = t_1;
} else if (z <= -1.4e-152) {
tmp = x * -3.0;
} else if (z <= -3e-176) {
tmp = y * 4.0;
} else if (z <= 1.85e-50) {
tmp = x * -3.0;
} else if (z <= 0.52) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) t_1 = -6.0 * (y * z) tmp = 0 if z <= -2e+182: tmp = t_0 elif z <= -6.5e+151: tmp = t_1 elif z <= -3.8e+98: tmp = 6.0 * (x * z) elif z <= -4.0: tmp = t_1 elif z <= -1.4e-152: tmp = x * -3.0 elif z <= -3e-176: tmp = y * 4.0 elif z <= 1.85e-50: tmp = x * -3.0 elif z <= 0.52: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z * 6.0)) t_1 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -2e+182) tmp = t_0; elseif (z <= -6.5e+151) tmp = t_1; elseif (z <= -3.8e+98) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= -4.0) tmp = t_1; elseif (z <= -1.4e-152) tmp = Float64(x * -3.0); elseif (z <= -3e-176) tmp = Float64(y * 4.0); elseif (z <= 1.85e-50) tmp = Float64(x * -3.0); elseif (z <= 0.52) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z * 6.0); t_1 = -6.0 * (y * z); tmp = 0.0; if (z <= -2e+182) tmp = t_0; elseif (z <= -6.5e+151) tmp = t_1; elseif (z <= -3.8e+98) tmp = 6.0 * (x * z); elseif (z <= -4.0) tmp = t_1; elseif (z <= -1.4e-152) tmp = x * -3.0; elseif (z <= -3e-176) tmp = y * 4.0; elseif (z <= 1.85e-50) tmp = x * -3.0; elseif (z <= 0.52) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+182], t$95$0, If[LessEqual[z, -6.5e+151], t$95$1, If[LessEqual[z, -3.8e+98], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.0], t$95$1, If[LessEqual[z, -1.4e-152], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3e-176], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.85e-50], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
t_1 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{+182}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{+98}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -4:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-152}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-176}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-50}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.0000000000000001e182 or 0.52000000000000002 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 55.5%
sub-neg55.5%
distribute-rgt-in55.5%
metadata-eval55.5%
distribute-lft-neg-in55.5%
associate-+r+55.5%
metadata-eval55.5%
distribute-rgt-neg-in55.5%
metadata-eval55.5%
Simplified55.5%
Taylor expanded in z around inf 54.6%
*-commutative54.6%
Simplified54.6%
if -2.0000000000000001e182 < z < -6.5000000000000002e151 or -3.7999999999999999e98 < z < -4Initial program 99.7%
+-commutative99.7%
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 70.7%
Taylor expanded in z around inf 68.0%
Taylor expanded in y around 0 68.0%
if -6.5000000000000002e151 < z < -3.7999999999999999e98Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 82.2%
sub-neg82.2%
distribute-rgt-in82.2%
metadata-eval82.2%
distribute-lft-neg-in82.2%
associate-+r+82.2%
metadata-eval82.2%
distribute-rgt-neg-in82.2%
metadata-eval82.2%
Simplified82.2%
Taylor expanded in z around inf 82.3%
if -4 < z < -1.39999999999999992e-152 or -3e-176 < z < 1.85e-50Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 60.8%
sub-neg60.8%
distribute-rgt-in60.8%
metadata-eval60.8%
distribute-lft-neg-in60.8%
associate-+r+60.8%
metadata-eval60.8%
distribute-rgt-neg-in60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in z around 0 60.8%
*-commutative60.8%
Simplified60.8%
if -1.39999999999999992e-152 < z < -3e-176 or 1.85e-50 < z < 0.52000000000000002Initial program 99.4%
+-commutative99.4%
associate-*l*99.7%
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 78.6%
Taylor expanded in z around 0 74.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))) (t_1 (* -6.0 (* y z))))
(if (<= z -1.4e+183)
t_0
(if (<= z -9.5e+152)
t_1
(if (<= z -3.4e+98)
t_0
(if (<= z -0.39)
t_1
(if (<= z -4.6e-153)
(* x -3.0)
(if (<= z -1.05e-176)
(* y 4.0)
(if (<= z 2e-49)
(* x -3.0)
(if (<= z 0.5) (* y 4.0) t_0))))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -1.4e+183) {
tmp = t_0;
} else if (z <= -9.5e+152) {
tmp = t_1;
} else if (z <= -3.4e+98) {
tmp = t_0;
} else if (z <= -0.39) {
tmp = t_1;
} else if (z <= -4.6e-153) {
tmp = x * -3.0;
} else if (z <= -1.05e-176) {
tmp = y * 4.0;
} else if (z <= 2e-49) {
tmp = x * -3.0;
} else if (z <= 0.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) :: t_1
real(8) :: tmp
t_0 = 6.0d0 * (x * z)
t_1 = (-6.0d0) * (y * z)
if (z <= (-1.4d+183)) then
tmp = t_0
else if (z <= (-9.5d+152)) then
tmp = t_1
else if (z <= (-3.4d+98)) then
tmp = t_0
else if (z <= (-0.39d0)) then
tmp = t_1
else if (z <= (-4.6d-153)) then
tmp = x * (-3.0d0)
else if (z <= (-1.05d-176)) then
tmp = y * 4.0d0
else if (z <= 2d-49) then
tmp = x * (-3.0d0)
else if (z <= 0.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 * (x * z);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -1.4e+183) {
tmp = t_0;
} else if (z <= -9.5e+152) {
tmp = t_1;
} else if (z <= -3.4e+98) {
tmp = t_0;
} else if (z <= -0.39) {
tmp = t_1;
} else if (z <= -4.6e-153) {
tmp = x * -3.0;
} else if (z <= -1.05e-176) {
tmp = y * 4.0;
} else if (z <= 2e-49) {
tmp = x * -3.0;
} else if (z <= 0.5) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) t_1 = -6.0 * (y * z) tmp = 0 if z <= -1.4e+183: tmp = t_0 elif z <= -9.5e+152: tmp = t_1 elif z <= -3.4e+98: tmp = t_0 elif z <= -0.39: tmp = t_1 elif z <= -4.6e-153: tmp = x * -3.0 elif z <= -1.05e-176: tmp = y * 4.0 elif z <= 2e-49: tmp = x * -3.0 elif z <= 0.5: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) t_1 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1.4e+183) tmp = t_0; elseif (z <= -9.5e+152) tmp = t_1; elseif (z <= -3.4e+98) tmp = t_0; elseif (z <= -0.39) tmp = t_1; elseif (z <= -4.6e-153) tmp = Float64(x * -3.0); elseif (z <= -1.05e-176) tmp = Float64(y * 4.0); elseif (z <= 2e-49) tmp = Float64(x * -3.0); elseif (z <= 0.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 * (x * z); t_1 = -6.0 * (y * z); tmp = 0.0; if (z <= -1.4e+183) tmp = t_0; elseif (z <= -9.5e+152) tmp = t_1; elseif (z <= -3.4e+98) tmp = t_0; elseif (z <= -0.39) tmp = t_1; elseif (z <= -4.6e-153) tmp = x * -3.0; elseif (z <= -1.05e-176) tmp = y * 4.0; elseif (z <= 2e-49) tmp = x * -3.0; elseif (z <= 0.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[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.4e+183], t$95$0, If[LessEqual[z, -9.5e+152], t$95$1, If[LessEqual[z, -3.4e+98], t$95$0, If[LessEqual[z, -0.39], t$95$1, If[LessEqual[z, -4.6e-153], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.05e-176], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2e-49], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
t_1 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+183}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{+152}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{+98}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -0.39:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{-153}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-176}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-49}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.40000000000000009e183 or -9.49999999999999916e152 < z < -3.39999999999999972e98 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 58.4%
sub-neg58.4%
distribute-rgt-in58.4%
metadata-eval58.4%
distribute-lft-neg-in58.4%
associate-+r+58.4%
metadata-eval58.4%
distribute-rgt-neg-in58.4%
metadata-eval58.4%
Simplified58.4%
Taylor expanded in z around inf 57.5%
if -1.40000000000000009e183 < z < -9.49999999999999916e152 or -3.39999999999999972e98 < z < -0.39000000000000001Initial program 99.7%
+-commutative99.7%
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 70.7%
Taylor expanded in z around inf 68.0%
Taylor expanded in y around 0 68.0%
if -0.39000000000000001 < z < -4.59999999999999994e-153 or -1.04999999999999996e-176 < z < 1.99999999999999987e-49Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 60.8%
sub-neg60.8%
distribute-rgt-in60.8%
metadata-eval60.8%
distribute-lft-neg-in60.8%
associate-+r+60.8%
metadata-eval60.8%
distribute-rgt-neg-in60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in z around 0 60.8%
*-commutative60.8%
Simplified60.8%
if -4.59999999999999994e-153 < z < -1.04999999999999996e-176 or 1.99999999999999987e-49 < z < 0.5Initial program 99.4%
+-commutative99.4%
associate-*l*99.7%
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 78.6%
Taylor expanded in z around 0 74.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -1.6)
t_0
(if (<= z -9e-153)
(* x -3.0)
(if (<= z -4.8e-176)
(* y 4.0)
(if (<= z 2.75e-49) (* x -3.0) (if (<= z 215.0) (* y 4.0) t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1.6) {
tmp = t_0;
} else if (z <= -9e-153) {
tmp = x * -3.0;
} else if (z <= -4.8e-176) {
tmp = y * 4.0;
} else if (z <= 2.75e-49) {
tmp = x * -3.0;
} else if (z <= 215.0) {
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) * (y * z)
if (z <= (-1.6d0)) then
tmp = t_0
else if (z <= (-9d-153)) then
tmp = x * (-3.0d0)
else if (z <= (-4.8d-176)) then
tmp = y * 4.0d0
else if (z <= 2.75d-49) then
tmp = x * (-3.0d0)
else if (z <= 215.0d0) 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 * (y * z);
double tmp;
if (z <= -1.6) {
tmp = t_0;
} else if (z <= -9e-153) {
tmp = x * -3.0;
} else if (z <= -4.8e-176) {
tmp = y * 4.0;
} else if (z <= 2.75e-49) {
tmp = x * -3.0;
} else if (z <= 215.0) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -1.6: tmp = t_0 elif z <= -9e-153: tmp = x * -3.0 elif z <= -4.8e-176: tmp = y * 4.0 elif z <= 2.75e-49: tmp = x * -3.0 elif z <= 215.0: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1.6) tmp = t_0; elseif (z <= -9e-153) tmp = Float64(x * -3.0); elseif (z <= -4.8e-176) tmp = Float64(y * 4.0); elseif (z <= 2.75e-49) tmp = Float64(x * -3.0); elseif (z <= 215.0) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -1.6) tmp = t_0; elseif (z <= -9e-153) tmp = x * -3.0; elseif (z <= -4.8e-176) tmp = y * 4.0; elseif (z <= 2.75e-49) tmp = x * -3.0; elseif (z <= 215.0) 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[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6], t$95$0, If[LessEqual[z, -9e-153], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -4.8e-176], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.75e-49], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 215.0], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.6:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-153}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-176}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{-49}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 215:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.6000000000000001 or 215 < z Initial program 99.8%
+-commutative99.8%
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 51.4%
Taylor expanded in z around inf 50.8%
Taylor expanded in y around 0 50.9%
if -1.6000000000000001 < z < -9e-153 or -4.80000000000000012e-176 < z < 2.75000000000000016e-49Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 60.8%
sub-neg60.8%
distribute-rgt-in60.8%
metadata-eval60.8%
distribute-lft-neg-in60.8%
associate-+r+60.8%
metadata-eval60.8%
distribute-rgt-neg-in60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in z around 0 60.8%
*-commutative60.8%
Simplified60.8%
if -9e-153 < z < -4.80000000000000012e-176 or 2.75000000000000016e-49 < z < 215Initial program 99.4%
+-commutative99.4%
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 74.5%
Taylor expanded in z around 0 70.9%
(FPCore (x y z)
:precision binary64
(if (or (<= x -2.7e+59)
(not (or (<= x -9e-50) (and (not (<= x -5.5e-68)) (<= x 5.2e-20)))))
(* x (+ -3.0 (* z 6.0)))
(* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.7e+59) || !((x <= -9e-50) || (!(x <= -5.5e-68) && (x <= 5.2e-20)))) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.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 <= (-2.7d+59)) .or. (.not. (x <= (-9d-50)) .or. (.not. (x <= (-5.5d-68))) .and. (x <= 5.2d-20))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2.7e+59) || !((x <= -9e-50) || (!(x <= -5.5e-68) && (x <= 5.2e-20)))) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.7e+59) or not ((x <= -9e-50) or (not (x <= -5.5e-68) and (x <= 5.2e-20))): tmp = x * (-3.0 + (z * 6.0)) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.7e+59) || !((x <= -9e-50) || (!(x <= -5.5e-68) && (x <= 5.2e-20)))) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.7e+59) || ~(((x <= -9e-50) || (~((x <= -5.5e-68)) && (x <= 5.2e-20))))) tmp = x * (-3.0 + (z * 6.0)); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.7e+59], N[Not[Or[LessEqual[x, -9e-50], And[N[Not[LessEqual[x, -5.5e-68]], $MachinePrecision], LessEqual[x, 5.2e-20]]]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{+59} \lor \neg \left(x \leq -9 \cdot 10^{-50} \lor \neg \left(x \leq -5.5 \cdot 10^{-68}\right) \land x \leq 5.2 \cdot 10^{-20}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -2.7000000000000001e59 or -8.99999999999999924e-50 < x < -5.5000000000000003e-68 or 5.1999999999999999e-20 < x Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 82.1%
sub-neg82.1%
distribute-rgt-in82.1%
metadata-eval82.1%
distribute-lft-neg-in82.1%
associate-+r+82.1%
metadata-eval82.1%
distribute-rgt-neg-in82.1%
metadata-eval82.1%
Simplified82.1%
if -2.7000000000000001e59 < x < -8.99999999999999924e-50 or -5.5000000000000003e-68 < x < 5.1999999999999999e-20Initial program 99.5%
+-commutative99.5%
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 78.5%
Final simplification80.4%
(FPCore (x y z)
:precision binary64
(if (or (<= x -3.25e+59)
(not (or (<= x -4.3e-51) (and (not (<= x -3.05e-78)) (<= x 6e-18)))))
(* x (+ -3.0 (* z 6.0)))
(* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -3.25e+59) || !((x <= -4.3e-51) || (!(x <= -3.05e-78) && (x <= 6e-18)))) {
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 <= (-3.25d+59)) .or. (.not. (x <= (-4.3d-51)) .or. (.not. (x <= (-3.05d-78))) .and. (x <= 6d-18))) 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 <= -3.25e+59) || !((x <= -4.3e-51) || (!(x <= -3.05e-78) && (x <= 6e-18)))) {
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 <= -3.25e+59) or not ((x <= -4.3e-51) or (not (x <= -3.05e-78) and (x <= 6e-18))): 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 <= -3.25e+59) || !((x <= -4.3e-51) || (!(x <= -3.05e-78) && (x <= 6e-18)))) 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 <= -3.25e+59) || ~(((x <= -4.3e-51) || (~((x <= -3.05e-78)) && (x <= 6e-18))))) 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, -3.25e+59], N[Not[Or[LessEqual[x, -4.3e-51], And[N[Not[LessEqual[x, -3.05e-78]], $MachinePrecision], LessEqual[x, 6e-18]]]], $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 -3.25 \cdot 10^{+59} \lor \neg \left(x \leq -4.3 \cdot 10^{-51} \lor \neg \left(x \leq -3.05 \cdot 10^{-78}\right) \land x \leq 6 \cdot 10^{-18}\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 < -3.2500000000000001e59 or -4.2999999999999997e-51 < x < -3.05000000000000003e-78 or 5.99999999999999966e-18 < x Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 82.1%
sub-neg82.1%
distribute-rgt-in82.1%
metadata-eval82.1%
distribute-lft-neg-in82.1%
associate-+r+82.1%
metadata-eval82.1%
distribute-rgt-neg-in82.1%
metadata-eval82.1%
Simplified82.1%
if -3.2500000000000001e59 < x < -4.2999999999999997e-51 or -3.05000000000000003e-78 < x < 5.99999999999999966e-18Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.6%
Taylor expanded in y around inf 78.3%
*-commutative78.3%
Simplified78.3%
Final simplification80.4%
(FPCore (x y z)
:precision binary64
(if (or (<= y -1.26e+44)
(not
(or (<= y -200000000000.0)
(and (not (<= y -1.75e-26)) (<= y 1.05e-146)))))
(* 6.0 (* y (- 0.6666666666666666 z)))
(* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.26e+44) || !((y <= -200000000000.0) || (!(y <= -1.75e-26) && (y <= 1.05e-146)))) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * -3.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 ((y <= (-1.26d+44)) .or. (.not. (y <= (-200000000000.0d0)) .or. (.not. (y <= (-1.75d-26))) .and. (y <= 1.05d-146))) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
else
tmp = x * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.26e+44) || !((y <= -200000000000.0) || (!(y <= -1.75e-26) && (y <= 1.05e-146)))) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.26e+44) or not ((y <= -200000000000.0) or (not (y <= -1.75e-26) and (y <= 1.05e-146))): tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.26e+44) || !((y <= -200000000000.0) || (!(y <= -1.75e-26) && (y <= 1.05e-146)))) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.26e+44) || ~(((y <= -200000000000.0) || (~((y <= -1.75e-26)) && (y <= 1.05e-146))))) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.26e+44], N[Not[Or[LessEqual[y, -200000000000.0], And[N[Not[LessEqual[y, -1.75e-26]], $MachinePrecision], LessEqual[y, 1.05e-146]]]], $MachinePrecision]], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.26 \cdot 10^{+44} \lor \neg \left(y \leq -200000000000 \lor \neg \left(y \leq -1.75 \cdot 10^{-26}\right) \land y \leq 1.05 \cdot 10^{-146}\right):\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if y < -1.25999999999999996e44 or -2e11 < y < -1.74999999999999992e-26 or 1.05e-146 < y Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 96.4%
Taylor expanded in y around inf 69.2%
*-commutative69.2%
Simplified69.2%
if -1.25999999999999996e44 < y < -2e11 or -1.74999999999999992e-26 < y < 1.05e-146Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 84.4%
sub-neg84.4%
distribute-rgt-in84.4%
metadata-eval84.4%
distribute-lft-neg-in84.4%
associate-+r+84.4%
metadata-eval84.4%
distribute-rgt-neg-in84.4%
metadata-eval84.4%
Simplified84.4%
Taylor expanded in z around 0 52.0%
*-commutative52.0%
Simplified52.0%
Final simplification62.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))))
(if (<= x -1.02e+28)
t_0
(if (<= x -2.9e-51)
(+ x (* (- y x) 4.0))
(if (or (<= x -8.3e-81) (not (<= x 6.6e-18)))
t_0
(* y (+ 4.0 (* z -6.0))))))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -1.02e+28) {
tmp = t_0;
} else if (x <= -2.9e-51) {
tmp = x + ((y - x) * 4.0);
} else if ((x <= -8.3e-81) || !(x <= 6.6e-18)) {
tmp = t_0;
} else {
tmp = y * (4.0 + (z * -6.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 = x * ((-3.0d0) + (z * 6.0d0))
if (x <= (-1.02d+28)) then
tmp = t_0
else if (x <= (-2.9d-51)) then
tmp = x + ((y - x) * 4.0d0)
else if ((x <= (-8.3d-81)) .or. (.not. (x <= 6.6d-18))) then
tmp = t_0
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -1.02e+28) {
tmp = t_0;
} else if (x <= -2.9e-51) {
tmp = x + ((y - x) * 4.0);
} else if ((x <= -8.3e-81) || !(x <= 6.6e-18)) {
tmp = t_0;
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) tmp = 0 if x <= -1.02e+28: tmp = t_0 elif x <= -2.9e-51: tmp = x + ((y - x) * 4.0) elif (x <= -8.3e-81) or not (x <= 6.6e-18): tmp = t_0 else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) tmp = 0.0 if (x <= -1.02e+28) tmp = t_0; elseif (x <= -2.9e-51) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); elseif ((x <= -8.3e-81) || !(x <= 6.6e-18)) tmp = t_0; else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); tmp = 0.0; if (x <= -1.02e+28) tmp = t_0; elseif (x <= -2.9e-51) tmp = x + ((y - x) * 4.0); elseif ((x <= -8.3e-81) || ~((x <= 6.6e-18))) tmp = t_0; else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.02e+28], t$95$0, If[LessEqual[x, -2.9e-51], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -8.3e-81], N[Not[LessEqual[x, 6.6e-18]], $MachinePrecision]], t$95$0, N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{if}\;x \leq -1.02 \cdot 10^{+28}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-51}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{elif}\;x \leq -8.3 \cdot 10^{-81} \lor \neg \left(x \leq 6.6 \cdot 10^{-18}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -1.02e28 or -2.89999999999999973e-51 < x < -8.30000000000000015e-81 or 6.6000000000000003e-18 < x Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 80.6%
sub-neg80.6%
distribute-rgt-in80.6%
metadata-eval80.6%
distribute-lft-neg-in80.6%
associate-+r+80.6%
metadata-eval80.6%
distribute-rgt-neg-in80.6%
metadata-eval80.6%
Simplified80.6%
if -1.02e28 < x < -2.89999999999999973e-51Initial program 99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in z around 0 80.7%
if -8.30000000000000015e-81 < x < 6.6000000000000003e-18Initial program 99.5%
+-commutative99.5%
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 80.3%
Final simplification80.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.57) (not (<= z 0.5))) (* z (+ (* y -6.0) (* x 6.0))) (+ (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.57) || !(z <= 0.5)) {
tmp = z * ((y * -6.0) + (x * 6.0));
} else {
tmp = (x * -3.0) + (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 ((z <= (-0.57d0)) .or. (.not. (z <= 0.5d0))) then
tmp = z * ((y * (-6.0d0)) + (x * 6.0d0))
else
tmp = (x * (-3.0d0)) + (y * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.57) || !(z <= 0.5)) {
tmp = z * ((y * -6.0) + (x * 6.0));
} else {
tmp = (x * -3.0) + (y * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.57) or not (z <= 0.5): tmp = z * ((y * -6.0) + (x * 6.0)) else: tmp = (x * -3.0) + (y * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.57) || !(z <= 0.5)) tmp = Float64(z * Float64(Float64(y * -6.0) + Float64(x * 6.0))); else tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.57) || ~((z <= 0.5))) tmp = z * ((y * -6.0) + (x * 6.0)); else tmp = (x * -3.0) + (y * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.57], N[Not[LessEqual[z, 0.5]], $MachinePrecision]], N[(z * N[(N[(y * -6.0), $MachinePrecision] + N[(x * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.57 \lor \neg \left(z \leq 0.5\right):\\
\;\;\;\;z \cdot \left(y \cdot -6 + x \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\end{array}
\end{array}
if z < -0.569999999999999951 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 95.1%
Taylor expanded in z around inf 98.5%
if -0.569999999999999951 < z < 0.5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 98.7%
Final simplification98.6%
(FPCore (x y z) :precision binary64 (if (<= z -0.66) (+ x (* z (* 6.0 (- x y)))) (if (<= z 0.5) (+ (* x -3.0) (* y 4.0)) (* z (+ (* y -6.0) (* x 6.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + (z * (6.0 * (x - y)));
} else if (z <= 0.5) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = z * ((y * -6.0) + (x * 6.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 (z <= (-0.66d0)) then
tmp = x + (z * (6.0d0 * (x - y)))
else if (z <= 0.5d0) then
tmp = (x * (-3.0d0)) + (y * 4.0d0)
else
tmp = z * ((y * (-6.0d0)) + (x * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + (z * (6.0 * (x - y)));
} else if (z <= 0.5) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = z * ((y * -6.0) + (x * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = x + (z * (6.0 * (x - y))) elif z <= 0.5: tmp = (x * -3.0) + (y * 4.0) else: tmp = z * ((y * -6.0) + (x * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(x + Float64(z * Float64(6.0 * Float64(x - y)))); elseif (z <= 0.5) tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); else tmp = Float64(z * Float64(Float64(y * -6.0) + Float64(x * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = x + (z * (6.0 * (x - y))); elseif (z <= 0.5) tmp = (x * -3.0) + (y * 4.0); else tmp = z * ((y * -6.0) + (x * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(x + N[(z * N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.5], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y * -6.0), $MachinePrecision] + N[(x * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;x + z \cdot \left(6 \cdot \left(x - y\right)\right)\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot -6 + x \cdot 6\right)\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 98.4%
neg-mul-198.4%
Simplified98.4%
if -0.660000000000000031 < z < 0.5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 98.7%
if 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 95.5%
Taylor expanded in z around inf 98.6%
Final simplification98.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.5e+124) (not (<= y 5.2e-11))) (* y 4.0) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.5e+124) || !(y <= 5.2e-11)) {
tmp = y * 4.0;
} else {
tmp = x * -3.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 ((y <= (-1.5d+124)) .or. (.not. (y <= 5.2d-11))) then
tmp = y * 4.0d0
else
tmp = x * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.5e+124) || !(y <= 5.2e-11)) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.5e+124) or not (y <= 5.2e-11): tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.5e+124) || !(y <= 5.2e-11)) tmp = Float64(y * 4.0); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.5e+124) || ~((y <= 5.2e-11))) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.5e+124], N[Not[LessEqual[y, 5.2e-11]], $MachinePrecision]], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{+124} \lor \neg \left(y \leq 5.2 \cdot 10^{-11}\right):\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if y < -1.5e124 or 5.2000000000000001e-11 < y Initial program 99.7%
+-commutative99.7%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 81.7%
Taylor expanded in z around 0 42.8%
if -1.5e124 < y < 5.2000000000000001e-11Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 71.6%
sub-neg71.6%
distribute-rgt-in71.6%
metadata-eval71.6%
distribute-lft-neg-in71.6%
associate-+r+71.6%
metadata-eval71.6%
distribute-rgt-neg-in71.6%
metadata-eval71.6%
Simplified71.6%
Taylor expanded in z around 0 41.7%
*-commutative41.7%
Simplified41.7%
Final simplification42.1%
(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.6%
metadata-eval99.6%
Simplified99.6%
(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.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 54.4%
sub-neg54.4%
distribute-rgt-in54.4%
metadata-eval54.4%
distribute-lft-neg-in54.4%
associate-+r+54.4%
metadata-eval54.4%
distribute-rgt-neg-in54.4%
metadata-eval54.4%
Simplified54.4%
Taylor expanded in z around 0 29.0%
*-commutative29.0%
Simplified29.0%
(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.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 47.6%
Taylor expanded in x around inf 2.8%
herbie shell --seed 2024110
(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))))