
(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 12 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 (* (- 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(y - x) * Float64(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[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)
\end{array}
Initial program 99.5%
associate-*l*99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -2.4e-16)
t_0
(if (<= z -6.3e-257)
(* x -3.0)
(if (<= z -2.6e-287)
(* y 4.0)
(if (<= z 5.1e-306)
(* x -3.0)
(if (<= z 4.5e-104)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (or (<= z 4.8e+156) (not (<= z 1.75e+239)))
(* -6.0 (* y z))
t_0)))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -2.4e-16) {
tmp = t_0;
} else if (z <= -6.3e-257) {
tmp = x * -3.0;
} else if (z <= -2.6e-287) {
tmp = y * 4.0;
} else if (z <= 5.1e-306) {
tmp = x * -3.0;
} else if (z <= 4.5e-104) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if ((z <= 4.8e+156) || !(z <= 1.75e+239)) {
tmp = -6.0 * (y * z);
} 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 * (x * z)
if (z <= (-2.4d-16)) then
tmp = t_0
else if (z <= (-6.3d-257)) then
tmp = x * (-3.0d0)
else if (z <= (-2.6d-287)) then
tmp = y * 4.0d0
else if (z <= 5.1d-306) then
tmp = x * (-3.0d0)
else if (z <= 4.5d-104) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if ((z <= 4.8d+156) .or. (.not. (z <= 1.75d+239))) then
tmp = (-6.0d0) * (y * z)
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 tmp;
if (z <= -2.4e-16) {
tmp = t_0;
} else if (z <= -6.3e-257) {
tmp = x * -3.0;
} else if (z <= -2.6e-287) {
tmp = y * 4.0;
} else if (z <= 5.1e-306) {
tmp = x * -3.0;
} else if (z <= 4.5e-104) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if ((z <= 4.8e+156) || !(z <= 1.75e+239)) {
tmp = -6.0 * (y * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -2.4e-16: tmp = t_0 elif z <= -6.3e-257: tmp = x * -3.0 elif z <= -2.6e-287: tmp = y * 4.0 elif z <= 5.1e-306: tmp = x * -3.0 elif z <= 4.5e-104: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif (z <= 4.8e+156) or not (z <= 1.75e+239): tmp = -6.0 * (y * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -2.4e-16) tmp = t_0; elseif (z <= -6.3e-257) tmp = Float64(x * -3.0); elseif (z <= -2.6e-287) tmp = Float64(y * 4.0); elseif (z <= 5.1e-306) tmp = Float64(x * -3.0); elseif (z <= 4.5e-104) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif ((z <= 4.8e+156) || !(z <= 1.75e+239)) tmp = Float64(-6.0 * Float64(y * z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); tmp = 0.0; if (z <= -2.4e-16) tmp = t_0; elseif (z <= -6.3e-257) tmp = x * -3.0; elseif (z <= -2.6e-287) tmp = y * 4.0; elseif (z <= 5.1e-306) tmp = x * -3.0; elseif (z <= 4.5e-104) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif ((z <= 4.8e+156) || ~((z <= 1.75e+239))) tmp = -6.0 * (y * z); 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]}, If[LessEqual[z, -2.4e-16], t$95$0, If[LessEqual[z, -6.3e-257], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.6e-287], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.1e-306], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.5e-104], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[Or[LessEqual[z, 4.8e+156], N[Not[LessEqual[z, 1.75e+239]], $MachinePrecision]], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{-16}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -6.3 \cdot 10^{-257}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-287}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-306}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-104}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{+156} \lor \neg \left(z \leq 1.75 \cdot 10^{+239}\right):\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -2.40000000000000005e-16 or 4.8000000000000002e156 < z < 1.7500000000000001e239Initial program 99.9%
Taylor expanded in z around inf 95.6%
Taylor expanded in x around inf 67.2%
Taylor expanded in z around inf 67.2%
if -2.40000000000000005e-16 < z < -6.29999999999999993e-257 or -2.6e-287 < z < 5.09999999999999972e-306 or 4.4999999999999997e-104 < z < 0.5Initial program 99.2%
Taylor expanded in y around 0 99.2%
Taylor expanded in z around 0 99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in x around inf 60.7%
if -6.29999999999999993e-257 < z < -2.6e-287 or 5.09999999999999972e-306 < z < 4.4999999999999997e-104Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 62.4%
Taylor expanded in z around 0 62.4%
*-commutative62.4%
Simplified62.4%
if 0.5 < z < 4.8000000000000002e156 or 1.7500000000000001e239 < z Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.7%
metadata-eval99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 73.3%
Taylor expanded in z around inf 67.9%
*-commutative67.9%
Simplified67.9%
Final simplification64.2%
(FPCore (x y z)
:precision binary64
(if (<= z -2.4e-16)
(* x (+ 1.0 (* 6.0 z)))
(if (<= z -7e-260)
(* x -3.0)
(if (<= z -3.5e-282)
(* y 4.0)
(if (<= z 3.6e-306)
(* x -3.0)
(if (<= z 1.3e-107)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (or (<= z 9e+156) (not (<= z 1.75e+239)))
(* -6.0 (* y z))
(* 6.0 (* x z))))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.4e-16) {
tmp = x * (1.0 + (6.0 * z));
} else if (z <= -7e-260) {
tmp = x * -3.0;
} else if (z <= -3.5e-282) {
tmp = y * 4.0;
} else if (z <= 3.6e-306) {
tmp = x * -3.0;
} else if (z <= 1.3e-107) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if ((z <= 9e+156) || !(z <= 1.75e+239)) {
tmp = -6.0 * (y * z);
} else {
tmp = 6.0 * (x * 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 <= (-2.4d-16)) then
tmp = x * (1.0d0 + (6.0d0 * z))
else if (z <= (-7d-260)) then
tmp = x * (-3.0d0)
else if (z <= (-3.5d-282)) then
tmp = y * 4.0d0
else if (z <= 3.6d-306) then
tmp = x * (-3.0d0)
else if (z <= 1.3d-107) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if ((z <= 9d+156) .or. (.not. (z <= 1.75d+239))) then
tmp = (-6.0d0) * (y * z)
else
tmp = 6.0d0 * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.4e-16) {
tmp = x * (1.0 + (6.0 * z));
} else if (z <= -7e-260) {
tmp = x * -3.0;
} else if (z <= -3.5e-282) {
tmp = y * 4.0;
} else if (z <= 3.6e-306) {
tmp = x * -3.0;
} else if (z <= 1.3e-107) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if ((z <= 9e+156) || !(z <= 1.75e+239)) {
tmp = -6.0 * (y * z);
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.4e-16: tmp = x * (1.0 + (6.0 * z)) elif z <= -7e-260: tmp = x * -3.0 elif z <= -3.5e-282: tmp = y * 4.0 elif z <= 3.6e-306: tmp = x * -3.0 elif z <= 1.3e-107: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif (z <= 9e+156) or not (z <= 1.75e+239): tmp = -6.0 * (y * z) else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.4e-16) tmp = Float64(x * Float64(1.0 + Float64(6.0 * z))); elseif (z <= -7e-260) tmp = Float64(x * -3.0); elseif (z <= -3.5e-282) tmp = Float64(y * 4.0); elseif (z <= 3.6e-306) tmp = Float64(x * -3.0); elseif (z <= 1.3e-107) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif ((z <= 9e+156) || !(z <= 1.75e+239)) tmp = Float64(-6.0 * Float64(y * z)); else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.4e-16) tmp = x * (1.0 + (6.0 * z)); elseif (z <= -7e-260) tmp = x * -3.0; elseif (z <= -3.5e-282) tmp = y * 4.0; elseif (z <= 3.6e-306) tmp = x * -3.0; elseif (z <= 1.3e-107) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif ((z <= 9e+156) || ~((z <= 1.75e+239))) tmp = -6.0 * (y * z); else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.4e-16], N[(x * N[(1.0 + N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7e-260], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3.5e-282], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.6e-306], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.3e-107], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[Or[LessEqual[z, 9e+156], N[Not[LessEqual[z, 1.75e+239]], $MachinePrecision]], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-16}:\\
\;\;\;\;x \cdot \left(1 + 6 \cdot z\right)\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-260}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-282}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-306}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-107}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+156} \lor \neg \left(z \leq 1.75 \cdot 10^{+239}\right):\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -2.40000000000000005e-16Initial program 99.9%
Taylor expanded in z around inf 93.7%
Taylor expanded in x around inf 62.9%
if -2.40000000000000005e-16 < z < -6.9999999999999999e-260 or -3.50000000000000006e-282 < z < 3.59999999999999991e-306 or 1.3e-107 < z < 0.5Initial program 99.2%
Taylor expanded in y around 0 99.2%
Taylor expanded in z around 0 99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in x around inf 60.7%
if -6.9999999999999999e-260 < z < -3.50000000000000006e-282 or 3.59999999999999991e-306 < z < 1.3e-107Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 62.4%
Taylor expanded in z around 0 62.4%
*-commutative62.4%
Simplified62.4%
if 0.5 < z < 9.00000000000000061e156 or 1.7500000000000001e239 < z Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.7%
metadata-eval99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 73.3%
Taylor expanded in z around inf 67.9%
*-commutative67.9%
Simplified67.9%
if 9.00000000000000061e156 < z < 1.7500000000000001e239Initial program 99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in x around inf 77.0%
Taylor expanded in z around inf 77.0%
Final simplification64.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -4.8e+24)
t_0
(if (<= z -9.6e-258)
(* x -3.0)
(if (<= z -5.6e-274)
(* y 4.0)
(if (<= z 5.5e-307)
(* x -3.0)
(if (<= z 1.75e-105)
(* y 4.0)
(if (<= z 0.62) (* x -3.0) t_0))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -4.8e+24) {
tmp = t_0;
} else if (z <= -9.6e-258) {
tmp = x * -3.0;
} else if (z <= -5.6e-274) {
tmp = y * 4.0;
} else if (z <= 5.5e-307) {
tmp = x * -3.0;
} else if (z <= 1.75e-105) {
tmp = y * 4.0;
} else if (z <= 0.62) {
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) * (y * z)
if (z <= (-4.8d+24)) then
tmp = t_0
else if (z <= (-9.6d-258)) then
tmp = x * (-3.0d0)
else if (z <= (-5.6d-274)) then
tmp = y * 4.0d0
else if (z <= 5.5d-307) then
tmp = x * (-3.0d0)
else if (z <= 1.75d-105) then
tmp = y * 4.0d0
else if (z <= 0.62d0) 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 * (y * z);
double tmp;
if (z <= -4.8e+24) {
tmp = t_0;
} else if (z <= -9.6e-258) {
tmp = x * -3.0;
} else if (z <= -5.6e-274) {
tmp = y * 4.0;
} else if (z <= 5.5e-307) {
tmp = x * -3.0;
} else if (z <= 1.75e-105) {
tmp = y * 4.0;
} else if (z <= 0.62) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -4.8e+24: tmp = t_0 elif z <= -9.6e-258: tmp = x * -3.0 elif z <= -5.6e-274: tmp = y * 4.0 elif z <= 5.5e-307: tmp = x * -3.0 elif z <= 1.75e-105: tmp = y * 4.0 elif z <= 0.62: tmp = x * -3.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 <= -4.8e+24) tmp = t_0; elseif (z <= -9.6e-258) tmp = Float64(x * -3.0); elseif (z <= -5.6e-274) tmp = Float64(y * 4.0); elseif (z <= 5.5e-307) tmp = Float64(x * -3.0); elseif (z <= 1.75e-105) tmp = Float64(y * 4.0); elseif (z <= 0.62) tmp = Float64(x * -3.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 <= -4.8e+24) tmp = t_0; elseif (z <= -9.6e-258) tmp = x * -3.0; elseif (z <= -5.6e-274) tmp = y * 4.0; elseif (z <= 5.5e-307) tmp = x * -3.0; elseif (z <= 1.75e-105) tmp = y * 4.0; elseif (z <= 0.62) 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[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e+24], t$95$0, If[LessEqual[z, -9.6e-258], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -5.6e-274], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.5e-307], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.75e-105], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.62], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+24}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -9.6 \cdot 10^{-258}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-274}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-307}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{-105}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.62:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -4.8000000000000001e24 or 0.619999999999999996 < z Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.7%
neg-mul-199.7%
associate-*r*99.7%
*-commutative99.7%
fma-def99.6%
metadata-eval99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 52.7%
Taylor expanded in z around inf 50.4%
*-commutative50.4%
Simplified50.4%
if -4.8000000000000001e24 < z < -9.6000000000000007e-258 or -5.5999999999999995e-274 < z < 5.50000000000000039e-307 or 1.75e-105 < z < 0.619999999999999996Initial program 99.3%
Taylor expanded in y around 0 99.2%
Taylor expanded in z around 0 94.3%
*-commutative94.3%
Simplified94.3%
Taylor expanded in x around inf 57.2%
if -9.6000000000000007e-258 < z < -5.5999999999999995e-274 or 5.50000000000000039e-307 < z < 1.75e-105Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 62.4%
Taylor expanded in z around 0 62.4%
*-commutative62.4%
Simplified62.4%
Final simplification55.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* z (* x 6.0)))))
(if (<= z -46.0)
t_0
(if (<= z 8.5e-7)
(+ (* x -3.0) (* y 4.0))
(if (or (<= z 9e+155) (not (<= z 1.25e+242)))
(* y (+ 4.0 (* z -6.0)))
t_0)))))
double code(double x, double y, double z) {
double t_0 = x + (z * (x * 6.0));
double tmp;
if (z <= -46.0) {
tmp = t_0;
} else if (z <= 8.5e-7) {
tmp = (x * -3.0) + (y * 4.0);
} else if ((z <= 9e+155) || !(z <= 1.25e+242)) {
tmp = y * (4.0 + (z * -6.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 * (x * 6.0d0))
if (z <= (-46.0d0)) then
tmp = t_0
else if (z <= 8.5d-7) then
tmp = (x * (-3.0d0)) + (y * 4.0d0)
else if ((z <= 9d+155) .or. (.not. (z <= 1.25d+242))) then
tmp = y * (4.0d0 + (z * (-6.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 * (x * 6.0));
double tmp;
if (z <= -46.0) {
tmp = t_0;
} else if (z <= 8.5e-7) {
tmp = (x * -3.0) + (y * 4.0);
} else if ((z <= 9e+155) || !(z <= 1.25e+242)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (z * (x * 6.0)) tmp = 0 if z <= -46.0: tmp = t_0 elif z <= 8.5e-7: tmp = (x * -3.0) + (y * 4.0) elif (z <= 9e+155) or not (z <= 1.25e+242): tmp = y * (4.0 + (z * -6.0)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(z * Float64(x * 6.0))) tmp = 0.0 if (z <= -46.0) tmp = t_0; elseif (z <= 8.5e-7) tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); elseif ((z <= 9e+155) || !(z <= 1.25e+242)) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (z * (x * 6.0)); tmp = 0.0; if (z <= -46.0) tmp = t_0; elseif (z <= 8.5e-7) tmp = (x * -3.0) + (y * 4.0); elseif ((z <= 9e+155) || ~((z <= 1.25e+242))) tmp = y * (4.0 + (z * -6.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -46.0], t$95$0, If[LessEqual[z, 8.5e-7], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 9e+155], N[Not[LessEqual[z, 1.25e+242]], $MachinePrecision]], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + z \cdot \left(x \cdot 6\right)\\
\mathbf{if}\;z \leq -46:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-7}:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+155} \lor \neg \left(z \leq 1.25 \cdot 10^{+242}\right):\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -46 or 8.99999999999999947e155 < z < 1.2500000000000001e242Initial program 99.9%
Taylor expanded in z around inf 96.9%
Taylor expanded in y around 0 68.1%
associate-*r*68.1%
*-commutative68.1%
associate-*l*68.2%
Simplified68.2%
if -46 < z < 8.50000000000000014e-7Initial program 99.3%
Taylor expanded in x around 0 99.5%
fma-def99.6%
*-commutative99.6%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in z around 0 99.6%
if 8.50000000000000014e-7 < z < 8.99999999999999947e155 or 1.2500000000000001e242 < z Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.7%
metadata-eval99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 73.3%
Final simplification86.5%
(FPCore (x y z)
:precision binary64
(if (<= z -1.55e-6)
(* x (- (- (* z -6.0)) 3.0))
(if (<= z 6e-7)
(+ (* x -3.0) (* y 4.0))
(if (or (<= z 6e+157) (not (<= z 3.15e+242)))
(* y (+ 4.0 (* z -6.0)))
(+ x (* z (* x 6.0)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.55e-6) {
tmp = x * (-(z * -6.0) - 3.0);
} else if (z <= 6e-7) {
tmp = (x * -3.0) + (y * 4.0);
} else if ((z <= 6e+157) || !(z <= 3.15e+242)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x + (z * (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 <= (-1.55d-6)) then
tmp = x * (-(z * (-6.0d0)) - 3.0d0)
else if (z <= 6d-7) then
tmp = (x * (-3.0d0)) + (y * 4.0d0)
else if ((z <= 6d+157) .or. (.not. (z <= 3.15d+242))) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else
tmp = x + (z * (x * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.55e-6) {
tmp = x * (-(z * -6.0) - 3.0);
} else if (z <= 6e-7) {
tmp = (x * -3.0) + (y * 4.0);
} else if ((z <= 6e+157) || !(z <= 3.15e+242)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x + (z * (x * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.55e-6: tmp = x * (-(z * -6.0) - 3.0) elif z <= 6e-7: tmp = (x * -3.0) + (y * 4.0) elif (z <= 6e+157) or not (z <= 3.15e+242): tmp = y * (4.0 + (z * -6.0)) else: tmp = x + (z * (x * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.55e-6) tmp = Float64(x * Float64(Float64(-Float64(z * -6.0)) - 3.0)); elseif (z <= 6e-7) tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); elseif ((z <= 6e+157) || !(z <= 3.15e+242)) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); else tmp = Float64(x + Float64(z * Float64(x * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.55e-6) tmp = x * (-(z * -6.0) - 3.0); elseif (z <= 6e-7) tmp = (x * -3.0) + (y * 4.0); elseif ((z <= 6e+157) || ~((z <= 3.15e+242))) tmp = y * (4.0 + (z * -6.0)); else tmp = x + (z * (x * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.55e-6], N[(x * N[((-N[(z * -6.0), $MachinePrecision]) - 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e-7], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 6e+157], N[Not[LessEqual[z, 3.15e+242]], $MachinePrecision]], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(\left(-z \cdot -6\right) - 3\right)\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-7}:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+157} \lor \neg \left(z \leq 3.15 \cdot 10^{+242}\right):\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(x \cdot 6\right)\\
\end{array}
\end{array}
if z < -1.55e-6Initial program 99.9%
+-commutative99.9%
associate-*l*99.7%
fma-def99.6%
sub-neg99.6%
+-commutative99.6%
distribute-lft-in99.6%
neg-mul-199.6%
associate-*r*99.6%
*-commutative99.6%
fma-def99.6%
metadata-eval99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around -inf 68.2%
if -1.55e-6 < z < 5.9999999999999997e-7Initial program 99.3%
Taylor expanded in x around 0 99.5%
fma-def99.6%
*-commutative99.6%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in z around 0 99.6%
if 5.9999999999999997e-7 < z < 6.00000000000000021e157 or 3.1499999999999999e242 < z Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.7%
metadata-eval99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 73.3%
if 6.00000000000000021e157 < z < 3.1499999999999999e242Initial program 99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around 0 77.0%
associate-*r*77.0%
*-commutative77.0%
associate-*l*77.1%
Simplified77.1%
Final simplification87.2%
(FPCore (x y z)
:precision binary64
(if (<= z -5.2e-5)
(* x (+ 1.0 (* (- 0.6666666666666666 z) -6.0)))
(if (<= z 2.1e-6)
(+ (* x -3.0) (* y 4.0))
(if (or (<= z 4.6e+155) (not (<= z 1.8e+242)))
(* y (+ 4.0 (* z -6.0)))
(+ x (* z (* x 6.0)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.2e-5) {
tmp = x * (1.0 + ((0.6666666666666666 - z) * -6.0));
} else if (z <= 2.1e-6) {
tmp = (x * -3.0) + (y * 4.0);
} else if ((z <= 4.6e+155) || !(z <= 1.8e+242)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x + (z * (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 <= (-5.2d-5)) then
tmp = x * (1.0d0 + ((0.6666666666666666d0 - z) * (-6.0d0)))
else if (z <= 2.1d-6) then
tmp = (x * (-3.0d0)) + (y * 4.0d0)
else if ((z <= 4.6d+155) .or. (.not. (z <= 1.8d+242))) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else
tmp = x + (z * (x * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5.2e-5) {
tmp = x * (1.0 + ((0.6666666666666666 - z) * -6.0));
} else if (z <= 2.1e-6) {
tmp = (x * -3.0) + (y * 4.0);
} else if ((z <= 4.6e+155) || !(z <= 1.8e+242)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x + (z * (x * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.2e-5: tmp = x * (1.0 + ((0.6666666666666666 - z) * -6.0)) elif z <= 2.1e-6: tmp = (x * -3.0) + (y * 4.0) elif (z <= 4.6e+155) or not (z <= 1.8e+242): tmp = y * (4.0 + (z * -6.0)) else: tmp = x + (z * (x * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.2e-5) tmp = Float64(x * Float64(1.0 + Float64(Float64(0.6666666666666666 - z) * -6.0))); elseif (z <= 2.1e-6) tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); elseif ((z <= 4.6e+155) || !(z <= 1.8e+242)) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); else tmp = Float64(x + Float64(z * Float64(x * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.2e-5) tmp = x * (1.0 + ((0.6666666666666666 - z) * -6.0)); elseif (z <= 2.1e-6) tmp = (x * -3.0) + (y * 4.0); elseif ((z <= 4.6e+155) || ~((z <= 1.8e+242))) tmp = y * (4.0 + (z * -6.0)); else tmp = x + (z * (x * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.2e-5], N[(x * N[(1.0 + N[(N[(0.6666666666666666 - z), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1e-6], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 4.6e+155], N[Not[LessEqual[z, 1.8e+242]], $MachinePrecision]], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \left(1 + \left(0.6666666666666666 - z\right) \cdot -6\right)\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-6}:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+155} \lor \neg \left(z \leq 1.8 \cdot 10^{+242}\right):\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(x \cdot 6\right)\\
\end{array}
\end{array}
if z < -5.19999999999999968e-5Initial program 99.9%
associate-*r*99.7%
metadata-eval99.7%
+-commutative99.7%
metadata-eval99.7%
*-commutative99.7%
associate-*r*99.7%
fma-def99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 68.2%
if -5.19999999999999968e-5 < z < 2.0999999999999998e-6Initial program 99.3%
Taylor expanded in x around 0 99.5%
fma-def99.6%
*-commutative99.6%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in z around 0 99.6%
if 2.0999999999999998e-6 < z < 4.59999999999999996e155 or 1.79999999999999997e242 < z Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.7%
metadata-eval99.7%
metadata-eval99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 73.3%
if 4.59999999999999996e155 < z < 1.79999999999999997e242Initial program 99.8%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around 0 77.0%
associate-*r*77.0%
*-commutative77.0%
associate-*l*77.1%
Simplified77.1%
Final simplification87.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (+ 4.0 (* z -6.0)))))
(if (<= y -3.15e-93)
t_0
(if (<= y -1.4e-179)
(* x -3.0)
(if (<= y -1.36e-179)
(* y (* z -6.0))
(if (<= y 2.45e-119) (* x (* 6.0 z)) t_0))))))
double code(double x, double y, double z) {
double t_0 = y * (4.0 + (z * -6.0));
double tmp;
if (y <= -3.15e-93) {
tmp = t_0;
} else if (y <= -1.4e-179) {
tmp = x * -3.0;
} else if (y <= -1.36e-179) {
tmp = y * (z * -6.0);
} else if (y <= 2.45e-119) {
tmp = x * (6.0 * z);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = y * (4.0d0 + (z * (-6.0d0)))
if (y <= (-3.15d-93)) then
tmp = t_0
else if (y <= (-1.4d-179)) then
tmp = x * (-3.0d0)
else if (y <= (-1.36d-179)) then
tmp = y * (z * (-6.0d0))
else if (y <= 2.45d-119) then
tmp = x * (6.0d0 * z)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (4.0 + (z * -6.0));
double tmp;
if (y <= -3.15e-93) {
tmp = t_0;
} else if (y <= -1.4e-179) {
tmp = x * -3.0;
} else if (y <= -1.36e-179) {
tmp = y * (z * -6.0);
} else if (y <= 2.45e-119) {
tmp = x * (6.0 * z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (4.0 + (z * -6.0)) tmp = 0 if y <= -3.15e-93: tmp = t_0 elif y <= -1.4e-179: tmp = x * -3.0 elif y <= -1.36e-179: tmp = y * (z * -6.0) elif y <= 2.45e-119: tmp = x * (6.0 * z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(4.0 + Float64(z * -6.0))) tmp = 0.0 if (y <= -3.15e-93) tmp = t_0; elseif (y <= -1.4e-179) tmp = Float64(x * -3.0); elseif (y <= -1.36e-179) tmp = Float64(y * Float64(z * -6.0)); elseif (y <= 2.45e-119) tmp = Float64(x * Float64(6.0 * z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (4.0 + (z * -6.0)); tmp = 0.0; if (y <= -3.15e-93) tmp = t_0; elseif (y <= -1.4e-179) tmp = x * -3.0; elseif (y <= -1.36e-179) tmp = y * (z * -6.0); elseif (y <= 2.45e-119) tmp = x * (6.0 * z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.15e-93], t$95$0, If[LessEqual[y, -1.4e-179], N[(x * -3.0), $MachinePrecision], If[LessEqual[y, -1.36e-179], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.45e-119], N[(x * N[(6.0 * z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{if}\;y \leq -3.15 \cdot 10^{-93}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-179}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;y \leq -1.36 \cdot 10^{-179}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;y \leq 2.45 \cdot 10^{-119}:\\
\;\;\;\;x \cdot \left(6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -3.15000000000000014e-93 or 2.45e-119 < y Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 67.6%
if -3.15000000000000014e-93 < y < -1.4e-179Initial program 99.5%
Taylor expanded in y around 0 99.3%
Taylor expanded in z around 0 75.8%
*-commutative75.8%
Simplified75.8%
Taylor expanded in x around inf 51.6%
if -1.4e-179 < y < -1.35999999999999993e-179Initial program 98.4%
+-commutative98.4%
associate-*l*100.0%
fma-def100.0%
sub-neg100.0%
+-commutative100.0%
distribute-lft-in100.0%
neg-mul-1100.0%
associate-*r*100.0%
*-commutative100.0%
fma-def98.4%
metadata-eval98.4%
metadata-eval98.4%
metadata-eval98.4%
Simplified98.4%
Taylor expanded in y around inf 100.0%
Taylor expanded in z around inf 100.0%
if -1.35999999999999993e-179 < y < 2.45e-119Initial program 99.5%
Taylor expanded in z around inf 55.8%
Taylor expanded in x around inf 49.3%
Taylor expanded in z around inf 50.4%
associate-*r*50.4%
*-commutative50.4%
*-commutative50.4%
*-commutative50.4%
Simplified50.4%
Final simplification61.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.6) (not (<= z 0.52))) (* z (+ (* x 6.0) (* y -6.0))) (+ (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.52)) {
tmp = z * ((x * 6.0) + (y * -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.6d0)) .or. (.not. (z <= 0.52d0))) then
tmp = z * ((x * 6.0d0) + (y * (-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.6) || !(z <= 0.52)) {
tmp = z * ((x * 6.0) + (y * -6.0));
} else {
tmp = (x * -3.0) + (y * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.6) or not (z <= 0.52): tmp = z * ((x * 6.0) + (y * -6.0)) else: tmp = (x * -3.0) + (y * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.6) || !(z <= 0.52)) tmp = Float64(z * Float64(Float64(x * 6.0) + Float64(y * -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.6) || ~((z <= 0.52))) tmp = z * ((x * 6.0) + (y * -6.0)); else tmp = (x * -3.0) + (y * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.6], N[Not[LessEqual[z, 0.52]], $MachinePrecision]], N[(z * N[(N[(x * 6.0), $MachinePrecision] + N[(y * -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.6 \lor \neg \left(z \leq 0.52\right):\\
\;\;\;\;z \cdot \left(x \cdot 6 + y \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\end{array}
\end{array}
if z < -0.599999999999999978 or 0.52000000000000002 < z Initial program 99.8%
Taylor expanded in x around 0 95.4%
fma-def98.8%
*-commutative98.8%
associate-*r*98.8%
Simplified98.8%
Taylor expanded in z around inf 95.5%
if -0.599999999999999978 < z < 0.52000000000000002Initial program 99.3%
Taylor expanded in x around 0 99.5%
fma-def99.6%
*-commutative99.6%
associate-*r*99.8%
Simplified99.8%
Taylor expanded in z around 0 99.6%
Final simplification97.7%
(FPCore (x y z) :precision binary64 (if (<= y -3.1e-88) (* y 4.0) (if (<= y 8.8e+63) (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -3.1e-88) {
tmp = y * 4.0;
} else if (y <= 8.8e+63) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-3.1d-88)) then
tmp = y * 4.0d0
else if (y <= 8.8d+63) then
tmp = x * (-3.0d0)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.1e-88) {
tmp = y * 4.0;
} else if (y <= 8.8e+63) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -3.1e-88: tmp = y * 4.0 elif y <= 8.8e+63: tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -3.1e-88) tmp = Float64(y * 4.0); elseif (y <= 8.8e+63) tmp = Float64(x * -3.0); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -3.1e-88) tmp = y * 4.0; elseif (y <= 8.8e+63) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -3.1e-88], N[(y * 4.0), $MachinePrecision], If[LessEqual[y, 8.8e+63], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{-88}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{+63}:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if y < -3.0999999999999998e-88 or 8.7999999999999995e63 < y Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 75.2%
Taylor expanded in z around 0 42.1%
*-commutative42.1%
Simplified42.1%
if -3.0999999999999998e-88 < y < 8.7999999999999995e63Initial program 99.5%
Taylor expanded in y around 0 99.4%
Taylor expanded in z around 0 65.0%
*-commutative65.0%
Simplified65.0%
Taylor expanded in x around inf 42.1%
Final simplification42.1%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.5%
Taylor expanded in y around 0 97.5%
Taylor expanded in z around 0 77.8%
*-commutative77.8%
Simplified77.8%
Taylor expanded in x around inf 30.0%
Final simplification30.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.5%
Taylor expanded in z around inf 44.3%
Taylor expanded in z around 0 2.7%
Final simplification2.7%
herbie shell --seed 2023238
(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))))