
(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 13 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.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))))
(if (<= z -3.05e+171)
(* -6.0 (* z y))
(if (<= z -0.042)
t_0
(if (<= z -1.55e-53)
(* y 4.0)
(if (<= z -6.6e-97)
(* x -3.0)
(if (<= z -7e-109)
(* y 4.0)
(if (<= z -1e-145)
(* x -3.0)
(if (<= z -9e-281)
(* y 4.0)
(if (<= z 9.2e-290)
(* x -3.0)
(if (<= z 1.45e-177)
(* y 4.0)
(if (<= z 0.5) (* x -3.0) t_0))))))))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -3.05e+171) {
tmp = -6.0 * (z * y);
} else if (z <= -0.042) {
tmp = t_0;
} else if (z <= -1.55e-53) {
tmp = y * 4.0;
} else if (z <= -6.6e-97) {
tmp = x * -3.0;
} else if (z <= -7e-109) {
tmp = y * 4.0;
} else if (z <= -1e-145) {
tmp = x * -3.0;
} else if (z <= -9e-281) {
tmp = y * 4.0;
} else if (z <= 9.2e-290) {
tmp = x * -3.0;
} else if (z <= 1.45e-177) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.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 <= (-3.05d+171)) then
tmp = (-6.0d0) * (z * y)
else if (z <= (-0.042d0)) then
tmp = t_0
else if (z <= (-1.55d-53)) then
tmp = y * 4.0d0
else if (z <= (-6.6d-97)) then
tmp = x * (-3.0d0)
else if (z <= (-7d-109)) then
tmp = y * 4.0d0
else if (z <= (-1d-145)) then
tmp = x * (-3.0d0)
else if (z <= (-9d-281)) then
tmp = y * 4.0d0
else if (z <= 9.2d-290) then
tmp = x * (-3.0d0)
else if (z <= 1.45d-177) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.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 <= -3.05e+171) {
tmp = -6.0 * (z * y);
} else if (z <= -0.042) {
tmp = t_0;
} else if (z <= -1.55e-53) {
tmp = y * 4.0;
} else if (z <= -6.6e-97) {
tmp = x * -3.0;
} else if (z <= -7e-109) {
tmp = y * 4.0;
} else if (z <= -1e-145) {
tmp = x * -3.0;
} else if (z <= -9e-281) {
tmp = y * 4.0;
} else if (z <= 9.2e-290) {
tmp = x * -3.0;
} else if (z <= 1.45e-177) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -3.05e+171: tmp = -6.0 * (z * y) elif z <= -0.042: tmp = t_0 elif z <= -1.55e-53: tmp = y * 4.0 elif z <= -6.6e-97: tmp = x * -3.0 elif z <= -7e-109: tmp = y * 4.0 elif z <= -1e-145: tmp = x * -3.0 elif z <= -9e-281: tmp = y * 4.0 elif z <= 9.2e-290: tmp = x * -3.0 elif z <= 1.45e-177: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.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 <= -3.05e+171) tmp = Float64(-6.0 * Float64(z * y)); elseif (z <= -0.042) tmp = t_0; elseif (z <= -1.55e-53) tmp = Float64(y * 4.0); elseif (z <= -6.6e-97) tmp = Float64(x * -3.0); elseif (z <= -7e-109) tmp = Float64(y * 4.0); elseif (z <= -1e-145) tmp = Float64(x * -3.0); elseif (z <= -9e-281) tmp = Float64(y * 4.0); elseif (z <= 9.2e-290) tmp = Float64(x * -3.0); elseif (z <= 1.45e-177) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.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 <= -3.05e+171) tmp = -6.0 * (z * y); elseif (z <= -0.042) tmp = t_0; elseif (z <= -1.55e-53) tmp = y * 4.0; elseif (z <= -6.6e-97) tmp = x * -3.0; elseif (z <= -7e-109) tmp = y * 4.0; elseif (z <= -1e-145) tmp = x * -3.0; elseif (z <= -9e-281) tmp = y * 4.0; elseif (z <= 9.2e-290) tmp = x * -3.0; elseif (z <= 1.45e-177) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.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, -3.05e+171], N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.042], t$95$0, If[LessEqual[z, -1.55e-53], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -6.6e-97], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -7e-109], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1e-145], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -9e-281], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 9.2e-290], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.45e-177], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -3.05 \cdot 10^{+171}:\\
\;\;\;\;-6 \cdot \left(z \cdot y\right)\\
\mathbf{elif}\;z \leq -0.042:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-53}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-97}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-109}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-145}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-281}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-290}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-177}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.04999999999999998e171Initial program 99.8%
+-commutative99.8%
associate-*l*96.9%
fma-def96.9%
sub-neg96.9%
distribute-rgt-in96.9%
metadata-eval96.9%
metadata-eval96.9%
distribute-lft-neg-out96.9%
distribute-rgt-neg-in96.9%
metadata-eval96.9%
Simplified96.9%
Taylor expanded in y around inf 58.8%
Taylor expanded in z around inf 61.6%
if -3.04999999999999998e171 < z < -0.0420000000000000026 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 63.7%
sub-neg63.7%
distribute-rgt-in63.7%
metadata-eval63.7%
metadata-eval63.7%
distribute-lft-neg-in63.7%
associate-+r+63.7%
metadata-eval63.7%
metadata-eval63.7%
distribute-rgt-neg-in63.7%
metadata-eval63.7%
Simplified63.7%
Taylor expanded in z around inf 61.7%
if -0.0420000000000000026 < z < -1.55000000000000008e-53 or -6.6000000000000002e-97 < z < -7e-109 or -9.99999999999999915e-146 < z < -8.99999999999999986e-281 or 9.2000000000000003e-290 < z < 1.44999999999999999e-177Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.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 68.2%
Taylor expanded in z around 0 66.7%
*-commutative66.7%
Simplified66.7%
if -1.55000000000000008e-53 < z < -6.6000000000000002e-97 or -7e-109 < z < -9.99999999999999915e-146 or -8.99999999999999986e-281 < z < 9.2000000000000003e-290 or 1.44999999999999999e-177 < z < 0.5Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 65.8%
sub-neg65.8%
distribute-rgt-in65.8%
metadata-eval65.8%
metadata-eval65.8%
distribute-lft-neg-in65.8%
associate-+r+65.8%
metadata-eval65.8%
metadata-eval65.8%
distribute-rgt-neg-in65.8%
metadata-eval65.8%
Simplified65.8%
Taylor expanded in z around 0 64.6%
*-commutative64.6%
Simplified64.6%
Final simplification63.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))))
(if (<= z -3.05e+171)
(* z (* -6.0 y))
(if (<= z -0.06)
t_0
(if (<= z -1.15e-53)
(* y 4.0)
(if (<= z -1.3e-97)
(* x -3.0)
(if (<= z -1.3e-107)
(* y 4.0)
(if (<= z -1.26e-145)
(* x -3.0)
(if (<= z -5.4e-280)
(* y 4.0)
(if (<= z 4.8e-287)
(* x -3.0)
(if (<= z 3.7e-178)
(* y 4.0)
(if (<= z 0.5) (* x -3.0) t_0))))))))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -3.05e+171) {
tmp = z * (-6.0 * y);
} else if (z <= -0.06) {
tmp = t_0;
} else if (z <= -1.15e-53) {
tmp = y * 4.0;
} else if (z <= -1.3e-97) {
tmp = x * -3.0;
} else if (z <= -1.3e-107) {
tmp = y * 4.0;
} else if (z <= -1.26e-145) {
tmp = x * -3.0;
} else if (z <= -5.4e-280) {
tmp = y * 4.0;
} else if (z <= 4.8e-287) {
tmp = x * -3.0;
} else if (z <= 3.7e-178) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.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 <= (-3.05d+171)) then
tmp = z * ((-6.0d0) * y)
else if (z <= (-0.06d0)) then
tmp = t_0
else if (z <= (-1.15d-53)) then
tmp = y * 4.0d0
else if (z <= (-1.3d-97)) then
tmp = x * (-3.0d0)
else if (z <= (-1.3d-107)) then
tmp = y * 4.0d0
else if (z <= (-1.26d-145)) then
tmp = x * (-3.0d0)
else if (z <= (-5.4d-280)) then
tmp = y * 4.0d0
else if (z <= 4.8d-287) then
tmp = x * (-3.0d0)
else if (z <= 3.7d-178) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.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 <= -3.05e+171) {
tmp = z * (-6.0 * y);
} else if (z <= -0.06) {
tmp = t_0;
} else if (z <= -1.15e-53) {
tmp = y * 4.0;
} else if (z <= -1.3e-97) {
tmp = x * -3.0;
} else if (z <= -1.3e-107) {
tmp = y * 4.0;
} else if (z <= -1.26e-145) {
tmp = x * -3.0;
} else if (z <= -5.4e-280) {
tmp = y * 4.0;
} else if (z <= 4.8e-287) {
tmp = x * -3.0;
} else if (z <= 3.7e-178) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -3.05e+171: tmp = z * (-6.0 * y) elif z <= -0.06: tmp = t_0 elif z <= -1.15e-53: tmp = y * 4.0 elif z <= -1.3e-97: tmp = x * -3.0 elif z <= -1.3e-107: tmp = y * 4.0 elif z <= -1.26e-145: tmp = x * -3.0 elif z <= -5.4e-280: tmp = y * 4.0 elif z <= 4.8e-287: tmp = x * -3.0 elif z <= 3.7e-178: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.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 <= -3.05e+171) tmp = Float64(z * Float64(-6.0 * y)); elseif (z <= -0.06) tmp = t_0; elseif (z <= -1.15e-53) tmp = Float64(y * 4.0); elseif (z <= -1.3e-97) tmp = Float64(x * -3.0); elseif (z <= -1.3e-107) tmp = Float64(y * 4.0); elseif (z <= -1.26e-145) tmp = Float64(x * -3.0); elseif (z <= -5.4e-280) tmp = Float64(y * 4.0); elseif (z <= 4.8e-287) tmp = Float64(x * -3.0); elseif (z <= 3.7e-178) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.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 <= -3.05e+171) tmp = z * (-6.0 * y); elseif (z <= -0.06) tmp = t_0; elseif (z <= -1.15e-53) tmp = y * 4.0; elseif (z <= -1.3e-97) tmp = x * -3.0; elseif (z <= -1.3e-107) tmp = y * 4.0; elseif (z <= -1.26e-145) tmp = x * -3.0; elseif (z <= -5.4e-280) tmp = y * 4.0; elseif (z <= 4.8e-287) tmp = x * -3.0; elseif (z <= 3.7e-178) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.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, -3.05e+171], N[(z * N[(-6.0 * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.06], t$95$0, If[LessEqual[z, -1.15e-53], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.3e-97], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.3e-107], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.26e-145], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -5.4e-280], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.8e-287], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.7e-178], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -3.05 \cdot 10^{+171}:\\
\;\;\;\;z \cdot \left(-6 \cdot y\right)\\
\mathbf{elif}\;z \leq -0.06:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-53}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-97}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-107}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.26 \cdot 10^{-145}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -5.4 \cdot 10^{-280}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-287}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-178}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -3.04999999999999998e171Initial program 99.8%
+-commutative99.8%
associate-*l*96.9%
fma-def96.9%
sub-neg96.9%
distribute-rgt-in96.9%
metadata-eval96.9%
metadata-eval96.9%
distribute-lft-neg-out96.9%
distribute-rgt-neg-in96.9%
metadata-eval96.9%
Simplified96.9%
Taylor expanded in y around inf 58.8%
Taylor expanded in z around inf 61.6%
associate-*r*61.7%
*-commutative61.7%
Simplified61.7%
if -3.04999999999999998e171 < z < -0.059999999999999998 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 63.7%
sub-neg63.7%
distribute-rgt-in63.7%
metadata-eval63.7%
metadata-eval63.7%
distribute-lft-neg-in63.7%
associate-+r+63.7%
metadata-eval63.7%
metadata-eval63.7%
distribute-rgt-neg-in63.7%
metadata-eval63.7%
Simplified63.7%
Taylor expanded in z around inf 61.7%
if -0.059999999999999998 < z < -1.1500000000000001e-53 or -1.30000000000000003e-97 < z < -1.3e-107 or -1.2599999999999999e-145 < z < -5.39999999999999967e-280 or 4.79999999999999999e-287 < z < 3.70000000000000004e-178Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.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 68.2%
Taylor expanded in z around 0 66.7%
*-commutative66.7%
Simplified66.7%
if -1.1500000000000001e-53 < z < -1.30000000000000003e-97 or -1.3e-107 < z < -1.2599999999999999e-145 or -5.39999999999999967e-280 < z < 4.79999999999999999e-287 or 3.70000000000000004e-178 < z < 0.5Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 65.8%
sub-neg65.8%
distribute-rgt-in65.8%
metadata-eval65.8%
metadata-eval65.8%
distribute-lft-neg-in65.8%
associate-+r+65.8%
metadata-eval65.8%
metadata-eval65.8%
distribute-rgt-neg-in65.8%
metadata-eval65.8%
Simplified65.8%
Taylor expanded in z around 0 64.6%
*-commutative64.6%
Simplified64.6%
Final simplification63.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z (- y x)))))
(if (<= z -0.00135)
t_0
(if (<= z -6.5e-53)
(* y 4.0)
(if (<= z -4.3e-97)
(* x -3.0)
(if (<= z -1.95e-112)
(* y 4.0)
(if (<= z -2.6e-145)
(* x -3.0)
(if (<= z -5.1e-280)
(* y 4.0)
(if (<= z 3.9e-286)
(* x -3.0)
(if (<= z 2.6e-175)
(* y 4.0)
(if (<= z 0.5) (* x -3.0) t_0)))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * (y - x));
double tmp;
if (z <= -0.00135) {
tmp = t_0;
} else if (z <= -6.5e-53) {
tmp = y * 4.0;
} else if (z <= -4.3e-97) {
tmp = x * -3.0;
} else if (z <= -1.95e-112) {
tmp = y * 4.0;
} else if (z <= -2.6e-145) {
tmp = x * -3.0;
} else if (z <= -5.1e-280) {
tmp = y * 4.0;
} else if (z <= 3.9e-286) {
tmp = x * -3.0;
} else if (z <= 2.6e-175) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.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.00135d0)) then
tmp = t_0
else if (z <= (-6.5d-53)) then
tmp = y * 4.0d0
else if (z <= (-4.3d-97)) then
tmp = x * (-3.0d0)
else if (z <= (-1.95d-112)) then
tmp = y * 4.0d0
else if (z <= (-2.6d-145)) then
tmp = x * (-3.0d0)
else if (z <= (-5.1d-280)) then
tmp = y * 4.0d0
else if (z <= 3.9d-286) then
tmp = x * (-3.0d0)
else if (z <= 2.6d-175) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.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.00135) {
tmp = t_0;
} else if (z <= -6.5e-53) {
tmp = y * 4.0;
} else if (z <= -4.3e-97) {
tmp = x * -3.0;
} else if (z <= -1.95e-112) {
tmp = y * 4.0;
} else if (z <= -2.6e-145) {
tmp = x * -3.0;
} else if (z <= -5.1e-280) {
tmp = y * 4.0;
} else if (z <= 3.9e-286) {
tmp = x * -3.0;
} else if (z <= 2.6e-175) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * (y - x)) tmp = 0 if z <= -0.00135: tmp = t_0 elif z <= -6.5e-53: tmp = y * 4.0 elif z <= -4.3e-97: tmp = x * -3.0 elif z <= -1.95e-112: tmp = y * 4.0 elif z <= -2.6e-145: tmp = x * -3.0 elif z <= -5.1e-280: tmp = y * 4.0 elif z <= 3.9e-286: tmp = x * -3.0 elif z <= 2.6e-175: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.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.00135) tmp = t_0; elseif (z <= -6.5e-53) tmp = Float64(y * 4.0); elseif (z <= -4.3e-97) tmp = Float64(x * -3.0); elseif (z <= -1.95e-112) tmp = Float64(y * 4.0); elseif (z <= -2.6e-145) tmp = Float64(x * -3.0); elseif (z <= -5.1e-280) tmp = Float64(y * 4.0); elseif (z <= 3.9e-286) tmp = Float64(x * -3.0); elseif (z <= 2.6e-175) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.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.00135) tmp = t_0; elseif (z <= -6.5e-53) tmp = y * 4.0; elseif (z <= -4.3e-97) tmp = x * -3.0; elseif (z <= -1.95e-112) tmp = y * 4.0; elseif (z <= -2.6e-145) tmp = x * -3.0; elseif (z <= -5.1e-280) tmp = y * 4.0; elseif (z <= 3.9e-286) tmp = x * -3.0; elseif (z <= 2.6e-175) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.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.00135], t$95$0, If[LessEqual[z, -6.5e-53], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4.3e-97], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.95e-112], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -2.6e-145], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -5.1e-280], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.9e-286], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.6e-175], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.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.00135:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -6.5 \cdot 10^{-53}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -4.3 \cdot 10^{-97}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-112}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-145}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -5.1 \cdot 10^{-280}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-286}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-175}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.0013500000000000001 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 97.3%
if -0.0013500000000000001 < z < -6.4999999999999997e-53 or -4.3e-97 < z < -1.9500000000000001e-112 or -2.6e-145 < z < -5.0999999999999996e-280 or 3.89999999999999995e-286 < z < 2.6e-175Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.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 68.2%
Taylor expanded in z around 0 66.7%
*-commutative66.7%
Simplified66.7%
if -6.4999999999999997e-53 < z < -4.3e-97 or -1.9500000000000001e-112 < z < -2.6e-145 or -5.0999999999999996e-280 < z < 3.89999999999999995e-286 or 2.6e-175 < z < 0.5Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 65.8%
sub-neg65.8%
distribute-rgt-in65.8%
metadata-eval65.8%
metadata-eval65.8%
distribute-lft-neg-in65.8%
associate-+r+65.8%
metadata-eval65.8%
metadata-eval65.8%
distribute-rgt-neg-in65.8%
metadata-eval65.8%
Simplified65.8%
Taylor expanded in z around 0 64.6%
*-commutative64.6%
Simplified64.6%
Final simplification82.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z (- y x)))) (t_1 (* x (+ -3.0 (* z 6.0)))))
(if (<= z -0.0115)
t_0
(if (<= z -9e-52)
(* y 4.0)
(if (<= z -1.36e-98)
(* x -3.0)
(if (<= z -1.62e-112)
(* y 4.0)
(if (<= z -1.55e-145)
t_1
(if (<= z -1.05e-281)
(* y 4.0)
(if (<= z 1.5e-289)
(* x -3.0)
(if (<= z 1.85e-176)
(* y 4.0)
(if (<= z 4.2e+14) t_1 t_0)))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * (y - x));
double t_1 = x * (-3.0 + (z * 6.0));
double tmp;
if (z <= -0.0115) {
tmp = t_0;
} else if (z <= -9e-52) {
tmp = y * 4.0;
} else if (z <= -1.36e-98) {
tmp = x * -3.0;
} else if (z <= -1.62e-112) {
tmp = y * 4.0;
} else if (z <= -1.55e-145) {
tmp = t_1;
} else if (z <= -1.05e-281) {
tmp = y * 4.0;
} else if (z <= 1.5e-289) {
tmp = x * -3.0;
} else if (z <= 1.85e-176) {
tmp = y * 4.0;
} else if (z <= 4.2e+14) {
tmp = t_1;
} 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) * (z * (y - x))
t_1 = x * ((-3.0d0) + (z * 6.0d0))
if (z <= (-0.0115d0)) then
tmp = t_0
else if (z <= (-9d-52)) then
tmp = y * 4.0d0
else if (z <= (-1.36d-98)) then
tmp = x * (-3.0d0)
else if (z <= (-1.62d-112)) then
tmp = y * 4.0d0
else if (z <= (-1.55d-145)) then
tmp = t_1
else if (z <= (-1.05d-281)) then
tmp = y * 4.0d0
else if (z <= 1.5d-289) then
tmp = x * (-3.0d0)
else if (z <= 1.85d-176) then
tmp = y * 4.0d0
else if (z <= 4.2d+14) then
tmp = t_1
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 t_1 = x * (-3.0 + (z * 6.0));
double tmp;
if (z <= -0.0115) {
tmp = t_0;
} else if (z <= -9e-52) {
tmp = y * 4.0;
} else if (z <= -1.36e-98) {
tmp = x * -3.0;
} else if (z <= -1.62e-112) {
tmp = y * 4.0;
} else if (z <= -1.55e-145) {
tmp = t_1;
} else if (z <= -1.05e-281) {
tmp = y * 4.0;
} else if (z <= 1.5e-289) {
tmp = x * -3.0;
} else if (z <= 1.85e-176) {
tmp = y * 4.0;
} else if (z <= 4.2e+14) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * (y - x)) t_1 = x * (-3.0 + (z * 6.0)) tmp = 0 if z <= -0.0115: tmp = t_0 elif z <= -9e-52: tmp = y * 4.0 elif z <= -1.36e-98: tmp = x * -3.0 elif z <= -1.62e-112: tmp = y * 4.0 elif z <= -1.55e-145: tmp = t_1 elif z <= -1.05e-281: tmp = y * 4.0 elif z <= 1.5e-289: tmp = x * -3.0 elif z <= 1.85e-176: tmp = y * 4.0 elif z <= 4.2e+14: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * Float64(y - x))) t_1 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) tmp = 0.0 if (z <= -0.0115) tmp = t_0; elseif (z <= -9e-52) tmp = Float64(y * 4.0); elseif (z <= -1.36e-98) tmp = Float64(x * -3.0); elseif (z <= -1.62e-112) tmp = Float64(y * 4.0); elseif (z <= -1.55e-145) tmp = t_1; elseif (z <= -1.05e-281) tmp = Float64(y * 4.0); elseif (z <= 1.5e-289) tmp = Float64(x * -3.0); elseif (z <= 1.85e-176) tmp = Float64(y * 4.0); elseif (z <= 4.2e+14) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * (y - x)); t_1 = x * (-3.0 + (z * 6.0)); tmp = 0.0; if (z <= -0.0115) tmp = t_0; elseif (z <= -9e-52) tmp = y * 4.0; elseif (z <= -1.36e-98) tmp = x * -3.0; elseif (z <= -1.62e-112) tmp = y * 4.0; elseif (z <= -1.55e-145) tmp = t_1; elseif (z <= -1.05e-281) tmp = y * 4.0; elseif (z <= 1.5e-289) tmp = x * -3.0; elseif (z <= 1.85e-176) tmp = y * 4.0; elseif (z <= 4.2e+14) tmp = t_1; 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]}, Block[{t$95$1 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.0115], t$95$0, If[LessEqual[z, -9e-52], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.36e-98], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.62e-112], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.55e-145], t$95$1, If[LessEqual[z, -1.05e-281], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.5e-289], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.85e-176], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.2e+14], t$95$1, t$95$0]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\
t_1 := x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{if}\;z \leq -0.0115:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -9 \cdot 10^{-52}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.36 \cdot 10^{-98}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.62 \cdot 10^{-112}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-281}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-289}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{-176}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.0115 or 4.2e14 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 98.7%
if -0.0115 < z < -9.0000000000000001e-52 or -1.36000000000000003e-98 < z < -1.62000000000000009e-112 or -1.55e-145 < z < -1.0499999999999999e-281 or 1.4999999999999999e-289 < z < 1.84999999999999992e-176Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.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 68.2%
Taylor expanded in z around 0 66.7%
*-commutative66.7%
Simplified66.7%
if -9.0000000000000001e-52 < z < -1.36000000000000003e-98 or -1.0499999999999999e-281 < z < 1.4999999999999999e-289Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 79.5%
sub-neg79.5%
distribute-rgt-in79.5%
metadata-eval79.5%
metadata-eval79.5%
distribute-lft-neg-in79.5%
associate-+r+79.5%
metadata-eval79.5%
metadata-eval79.5%
distribute-rgt-neg-in79.5%
metadata-eval79.5%
Simplified79.5%
Taylor expanded in z around 0 79.5%
*-commutative79.5%
Simplified79.5%
if -1.62000000000000009e-112 < z < -1.55e-145 or 1.84999999999999992e-176 < z < 4.2e14Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 62.0%
sub-neg62.0%
distribute-rgt-in62.1%
metadata-eval62.1%
metadata-eval62.1%
distribute-lft-neg-in62.1%
associate-+r+62.1%
metadata-eval62.1%
metadata-eval62.1%
distribute-rgt-neg-in62.1%
metadata-eval62.1%
Simplified62.1%
Final simplification83.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z y))))
(if (<= z -0.066)
t_0
(if (<= z -4.2e-52)
(* y 4.0)
(if (<= z -1e-96)
(* x -3.0)
(if (<= z -2.2e-107)
(* y 4.0)
(if (<= z -2.3e-145)
(* x -3.0)
(if (<= z -6.3e-280)
(* y 4.0)
(if (<= z 2.5e-287)
(* x -3.0)
(if (<= z 3.1e-176)
(* y 4.0)
(if (<= z 0.55) (* x -3.0) t_0)))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * y);
double tmp;
if (z <= -0.066) {
tmp = t_0;
} else if (z <= -4.2e-52) {
tmp = y * 4.0;
} else if (z <= -1e-96) {
tmp = x * -3.0;
} else if (z <= -2.2e-107) {
tmp = y * 4.0;
} else if (z <= -2.3e-145) {
tmp = x * -3.0;
} else if (z <= -6.3e-280) {
tmp = y * 4.0;
} else if (z <= 2.5e-287) {
tmp = x * -3.0;
} else if (z <= 3.1e-176) {
tmp = y * 4.0;
} else if (z <= 0.55) {
tmp = x * -3.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.066d0)) then
tmp = t_0
else if (z <= (-4.2d-52)) then
tmp = y * 4.0d0
else if (z <= (-1d-96)) then
tmp = x * (-3.0d0)
else if (z <= (-2.2d-107)) then
tmp = y * 4.0d0
else if (z <= (-2.3d-145)) then
tmp = x * (-3.0d0)
else if (z <= (-6.3d-280)) then
tmp = y * 4.0d0
else if (z <= 2.5d-287) then
tmp = x * (-3.0d0)
else if (z <= 3.1d-176) then
tmp = y * 4.0d0
else if (z <= 0.55d0) then
tmp = x * (-3.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.066) {
tmp = t_0;
} else if (z <= -4.2e-52) {
tmp = y * 4.0;
} else if (z <= -1e-96) {
tmp = x * -3.0;
} else if (z <= -2.2e-107) {
tmp = y * 4.0;
} else if (z <= -2.3e-145) {
tmp = x * -3.0;
} else if (z <= -6.3e-280) {
tmp = y * 4.0;
} else if (z <= 2.5e-287) {
tmp = x * -3.0;
} else if (z <= 3.1e-176) {
tmp = y * 4.0;
} else if (z <= 0.55) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * y) tmp = 0 if z <= -0.066: tmp = t_0 elif z <= -4.2e-52: tmp = y * 4.0 elif z <= -1e-96: tmp = x * -3.0 elif z <= -2.2e-107: tmp = y * 4.0 elif z <= -2.3e-145: tmp = x * -3.0 elif z <= -6.3e-280: tmp = y * 4.0 elif z <= 2.5e-287: tmp = x * -3.0 elif z <= 3.1e-176: tmp = y * 4.0 elif z <= 0.55: tmp = x * -3.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.066) tmp = t_0; elseif (z <= -4.2e-52) tmp = Float64(y * 4.0); elseif (z <= -1e-96) tmp = Float64(x * -3.0); elseif (z <= -2.2e-107) tmp = Float64(y * 4.0); elseif (z <= -2.3e-145) tmp = Float64(x * -3.0); elseif (z <= -6.3e-280) tmp = Float64(y * 4.0); elseif (z <= 2.5e-287) tmp = Float64(x * -3.0); elseif (z <= 3.1e-176) tmp = Float64(y * 4.0); elseif (z <= 0.55) tmp = Float64(x * -3.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.066) tmp = t_0; elseif (z <= -4.2e-52) tmp = y * 4.0; elseif (z <= -1e-96) tmp = x * -3.0; elseif (z <= -2.2e-107) tmp = y * 4.0; elseif (z <= -2.3e-145) tmp = x * -3.0; elseif (z <= -6.3e-280) tmp = y * 4.0; elseif (z <= 2.5e-287) tmp = x * -3.0; elseif (z <= 3.1e-176) tmp = y * 4.0; elseif (z <= 0.55) tmp = x * -3.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.066], t$95$0, If[LessEqual[z, -4.2e-52], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1e-96], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.2e-107], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -2.3e-145], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -6.3e-280], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.5e-287], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.1e-176], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.55], N[(x * -3.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.066:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-52}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-96}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-107}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-145}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -6.3 \cdot 10^{-280}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-287}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-176}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.066000000000000003 or 0.55000000000000004 < z Initial program 99.8%
+-commutative99.8%
associate-*l*99.0%
fma-def99.0%
sub-neg99.0%
distribute-rgt-in99.0%
metadata-eval99.0%
metadata-eval99.0%
distribute-lft-neg-out99.0%
distribute-rgt-neg-in99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in y around inf 43.9%
Taylor expanded in z around inf 43.9%
if -0.066000000000000003 < z < -4.1999999999999997e-52 or -9.9999999999999991e-97 < z < -2.20000000000000012e-107 or -2.30000000000000007e-145 < z < -6.2999999999999998e-280 or 2.50000000000000013e-287 < z < 3.09999999999999992e-176Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.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 68.2%
Taylor expanded in z around 0 66.7%
*-commutative66.7%
Simplified66.7%
if -4.1999999999999997e-52 < z < -9.9999999999999991e-97 or -2.20000000000000012e-107 < z < -2.30000000000000007e-145 or -6.2999999999999998e-280 < z < 2.50000000000000013e-287 or 3.09999999999999992e-176 < z < 0.55000000000000004Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 65.8%
sub-neg65.8%
distribute-rgt-in65.8%
metadata-eval65.8%
metadata-eval65.8%
distribute-lft-neg-in65.8%
associate-+r+65.8%
metadata-eval65.8%
metadata-eval65.8%
distribute-rgt-neg-in65.8%
metadata-eval65.8%
Simplified65.8%
Taylor expanded in z around 0 64.6%
*-commutative64.6%
Simplified64.6%
Final simplification54.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.02e+76) (not (<= y 5.2e-18))) (* y (+ 4.0 (* -6.0 z))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.02e+76) || !(y <= 5.2e-18)) {
tmp = y * (4.0 + (-6.0 * z));
} else {
tmp = x * (-3.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 ((y <= (-1.02d+76)) .or. (.not. (y <= 5.2d-18))) then
tmp = y * (4.0d0 + ((-6.0d0) * z))
else
tmp = x * ((-3.0d0) + (z * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.02e+76) || !(y <= 5.2e-18)) {
tmp = y * (4.0 + (-6.0 * z));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.02e+76) or not (y <= 5.2e-18): tmp = y * (4.0 + (-6.0 * z)) else: tmp = x * (-3.0 + (z * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.02e+76) || !(y <= 5.2e-18)) tmp = Float64(y * Float64(4.0 + Float64(-6.0 * z))); else tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.02e+76) || ~((y <= 5.2e-18))) tmp = y * (4.0 + (-6.0 * z)); else tmp = x * (-3.0 + (z * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.02e+76], N[Not[LessEqual[y, 5.2e-18]], $MachinePrecision]], N[(y * N[(4.0 + N[(-6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{+76} \lor \neg \left(y \leq 5.2 \cdot 10^{-18}\right):\\
\;\;\;\;y \cdot \left(4 + -6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\end{array}
\end{array}
if y < -1.02000000000000007e76 or 5.2000000000000001e-18 < y Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.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 79.4%
if -1.02000000000000007e76 < y < 5.2000000000000001e-18Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 75.1%
sub-neg75.1%
distribute-rgt-in75.1%
metadata-eval75.1%
metadata-eval75.1%
distribute-lft-neg-in75.1%
associate-+r+75.1%
metadata-eval75.1%
metadata-eval75.1%
distribute-rgt-neg-in75.1%
metadata-eval75.1%
Simplified75.1%
Final simplification76.8%
(FPCore (x y z) :precision binary64 (if (<= z -0.57) (* -6.0 (* z (- y x))) (if (<= z 0.52) (+ x (* (- y x) 4.0)) (* (- y x) (* -6.0 z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.57) {
tmp = -6.0 * (z * (y - x));
} else if (z <= 0.52) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = (y - x) * (-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 <= (-0.57d0)) then
tmp = (-6.0d0) * (z * (y - x))
else if (z <= 0.52d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = (y - x) * ((-6.0d0) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.57) {
tmp = -6.0 * (z * (y - x));
} else if (z <= 0.52) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = (y - x) * (-6.0 * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.57: tmp = -6.0 * (z * (y - x)) elif z <= 0.52: tmp = x + ((y - x) * 4.0) else: tmp = (y - x) * (-6.0 * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.57) 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(Float64(y - x) * Float64(-6.0 * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.57) tmp = -6.0 * (z * (y - x)); elseif (z <= 0.52) tmp = x + ((y - x) * 4.0); else tmp = (y - x) * (-6.0 * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.57], 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[(N[(y - x), $MachinePrecision] * N[(-6.0 * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.57:\\
\;\;\;\;-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}:\\
\;\;\;\;\left(y - x\right) \cdot \left(-6 \cdot z\right)\\
\end{array}
\end{array}
if z < -0.569999999999999951Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.9%
Taylor expanded in z around inf 99.0%
if -0.569999999999999951 < z < 0.52000000000000002Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 97.3%
if 0.52000000000000002 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 96.8%
associate-*r*96.9%
*-commutative96.9%
Simplified96.9%
Final simplification97.6%
(FPCore (x y z) :precision binary64 (if (<= z -0.58) (* -6.0 (* z (- y x))) (if (<= z 0.65) (+ (* y 4.0) (* x -3.0)) (* (- y x) (* -6.0 z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = -6.0 * (z * (y - x));
} else if (z <= 0.65) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = (y - x) * (-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 <= (-0.58d0)) then
tmp = (-6.0d0) * (z * (y - x))
else if (z <= 0.65d0) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = (y - x) * ((-6.0d0) * z)
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.65) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = (y - x) * (-6.0 * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.58: tmp = -6.0 * (z * (y - x)) elif z <= 0.65: tmp = (y * 4.0) + (x * -3.0) else: tmp = (y - x) * (-6.0 * z) 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.65) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(Float64(y - x) * Float64(-6.0 * z)); 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.65) tmp = (y * 4.0) + (x * -3.0); else tmp = (y - x) * (-6.0 * z); 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.65], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(-6.0 * z), $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.65:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \left(-6 \cdot z\right)\\
\end{array}
\end{array}
if z < -0.57999999999999996Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.9%
Taylor expanded in z around inf 99.0%
if -0.57999999999999996 < z < 0.650000000000000022Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 96.8%
Taylor expanded in x around 0 97.3%
if 0.650000000000000022 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 96.8%
associate-*r*96.9%
*-commutative96.9%
Simplified96.9%
Final simplification97.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -3e+79) (not (<= y 1.4e-102))) (* y 4.0) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3e+79) || !(y <= 1.4e-102)) {
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 <= (-3d+79)) .or. (.not. (y <= 1.4d-102))) 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 <= -3e+79) || !(y <= 1.4e-102)) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3e+79) or not (y <= 1.4e-102): tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3e+79) || !(y <= 1.4e-102)) 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 <= -3e+79) || ~((y <= 1.4e-102))) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3e+79], N[Not[LessEqual[y, 1.4e-102]], $MachinePrecision]], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+79} \lor \neg \left(y \leq 1.4 \cdot 10^{-102}\right):\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if y < -2.99999999999999974e79 or 1.40000000000000006e-102 < y Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
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 72.8%
Taylor expanded in z around 0 38.7%
*-commutative38.7%
Simplified38.7%
if -2.99999999999999974e79 < y < 1.40000000000000006e-102Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 77.6%
sub-neg77.6%
distribute-rgt-in77.7%
metadata-eval77.7%
metadata-eval77.7%
distribute-lft-neg-in77.7%
associate-+r+77.7%
metadata-eval77.7%
metadata-eval77.7%
distribute-rgt-neg-in77.7%
metadata-eval77.7%
Simplified77.7%
Taylor expanded in z around 0 37.0%
*-commutative37.0%
Simplified37.0%
Final simplification37.8%
(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%
Final simplification99.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 55.2%
sub-neg55.2%
distribute-rgt-in55.2%
metadata-eval55.2%
metadata-eval55.2%
distribute-lft-neg-in55.2%
associate-+r+55.2%
metadata-eval55.2%
metadata-eval55.2%
distribute-rgt-neg-in55.2%
metadata-eval55.2%
Simplified55.2%
Taylor expanded in z around 0 25.0%
*-commutative25.0%
Simplified25.0%
Final simplification25.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 z around inf 52.5%
Taylor expanded in z around 0 2.7%
Final simplification2.7%
herbie shell --seed 2024027
(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))))