
(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 (fma (- y x) (+ 4.0 (* z -6.0)) x))
double code(double x, double y, double z) {
return fma((y - x), (4.0 + (z * -6.0)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(4.0 + Float64(z * -6.0)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
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%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))) (t_1 (* z (* x 6.0))))
(if (<= z -1.16e+198)
t_0
(if (<= z -1.25e+97)
t_1
(if (<= z -2.6e-11)
t_0
(if (<= z -4.9e-67)
(* x -3.0)
(if (<= z -2.2e-174)
(* y 4.0)
(if (<= z 1.15e-306)
(* x -3.0)
(if (<= z 1.1e-222)
(* y 4.0)
(if (<= z 9.5e-153)
(* x -3.0)
(if (<= z 2.4e-115)
(* y 4.0)
(if (<= z 5e-70)
(* x -3.0)
(if (<= z 0.54) (* y 4.0) t_1)))))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double t_1 = z * (x * 6.0);
double tmp;
if (z <= -1.16e+198) {
tmp = t_0;
} else if (z <= -1.25e+97) {
tmp = t_1;
} else if (z <= -2.6e-11) {
tmp = t_0;
} else if (z <= -4.9e-67) {
tmp = x * -3.0;
} else if (z <= -2.2e-174) {
tmp = y * 4.0;
} else if (z <= 1.15e-306) {
tmp = x * -3.0;
} else if (z <= 1.1e-222) {
tmp = y * 4.0;
} else if (z <= 9.5e-153) {
tmp = x * -3.0;
} else if (z <= 2.4e-115) {
tmp = y * 4.0;
} else if (z <= 5e-70) {
tmp = x * -3.0;
} else if (z <= 0.54) {
tmp = y * 4.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
t_1 = z * (x * 6.0d0)
if (z <= (-1.16d+198)) then
tmp = t_0
else if (z <= (-1.25d+97)) then
tmp = t_1
else if (z <= (-2.6d-11)) then
tmp = t_0
else if (z <= (-4.9d-67)) then
tmp = x * (-3.0d0)
else if (z <= (-2.2d-174)) then
tmp = y * 4.0d0
else if (z <= 1.15d-306) then
tmp = x * (-3.0d0)
else if (z <= 1.1d-222) then
tmp = y * 4.0d0
else if (z <= 9.5d-153) then
tmp = x * (-3.0d0)
else if (z <= 2.4d-115) then
tmp = y * 4.0d0
else if (z <= 5d-70) then
tmp = x * (-3.0d0)
else if (z <= 0.54d0) then
tmp = y * 4.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double t_1 = z * (x * 6.0);
double tmp;
if (z <= -1.16e+198) {
tmp = t_0;
} else if (z <= -1.25e+97) {
tmp = t_1;
} else if (z <= -2.6e-11) {
tmp = t_0;
} else if (z <= -4.9e-67) {
tmp = x * -3.0;
} else if (z <= -2.2e-174) {
tmp = y * 4.0;
} else if (z <= 1.15e-306) {
tmp = x * -3.0;
} else if (z <= 1.1e-222) {
tmp = y * 4.0;
} else if (z <= 9.5e-153) {
tmp = x * -3.0;
} else if (z <= 2.4e-115) {
tmp = y * 4.0;
} else if (z <= 5e-70) {
tmp = x * -3.0;
} else if (z <= 0.54) {
tmp = y * 4.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) t_1 = z * (x * 6.0) tmp = 0 if z <= -1.16e+198: tmp = t_0 elif z <= -1.25e+97: tmp = t_1 elif z <= -2.6e-11: tmp = t_0 elif z <= -4.9e-67: tmp = x * -3.0 elif z <= -2.2e-174: tmp = y * 4.0 elif z <= 1.15e-306: tmp = x * -3.0 elif z <= 1.1e-222: tmp = y * 4.0 elif z <= 9.5e-153: tmp = x * -3.0 elif z <= 2.4e-115: tmp = y * 4.0 elif z <= 5e-70: tmp = x * -3.0 elif z <= 0.54: tmp = y * 4.0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) t_1 = Float64(z * Float64(x * 6.0)) tmp = 0.0 if (z <= -1.16e+198) tmp = t_0; elseif (z <= -1.25e+97) tmp = t_1; elseif (z <= -2.6e-11) tmp = t_0; elseif (z <= -4.9e-67) tmp = Float64(x * -3.0); elseif (z <= -2.2e-174) tmp = Float64(y * 4.0); elseif (z <= 1.15e-306) tmp = Float64(x * -3.0); elseif (z <= 1.1e-222) tmp = Float64(y * 4.0); elseif (z <= 9.5e-153) tmp = Float64(x * -3.0); elseif (z <= 2.4e-115) tmp = Float64(y * 4.0); elseif (z <= 5e-70) tmp = Float64(x * -3.0); elseif (z <= 0.54) tmp = Float64(y * 4.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); t_1 = z * (x * 6.0); tmp = 0.0; if (z <= -1.16e+198) tmp = t_0; elseif (z <= -1.25e+97) tmp = t_1; elseif (z <= -2.6e-11) tmp = t_0; elseif (z <= -4.9e-67) tmp = x * -3.0; elseif (z <= -2.2e-174) tmp = y * 4.0; elseif (z <= 1.15e-306) tmp = x * -3.0; elseif (z <= 1.1e-222) tmp = y * 4.0; elseif (z <= 9.5e-153) tmp = x * -3.0; elseif (z <= 2.4e-115) tmp = y * 4.0; elseif (z <= 5e-70) tmp = x * -3.0; elseif (z <= 0.54) tmp = y * 4.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.16e+198], t$95$0, If[LessEqual[z, -1.25e+97], t$95$1, If[LessEqual[z, -2.6e-11], t$95$0, If[LessEqual[z, -4.9e-67], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.2e-174], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.15e-306], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.1e-222], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 9.5e-153], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.4e-115], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5e-70], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.54], N[(y * 4.0), $MachinePrecision], t$95$1]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
t_1 := z \cdot \left(x \cdot 6\right)\\
\mathbf{if}\;z \leq -1.16 \cdot 10^{+198}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{+97}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-11}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.9 \cdot 10^{-67}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-174}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-306}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-222}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-153}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-115}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-70}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.54:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.16000000000000001e198 or -1.25e97 < z < -2.6000000000000001e-11Initial program 99.7%
+-commutative99.7%
associate-*l*99.5%
fma-def99.5%
sub-neg99.5%
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 69.6%
Taylor expanded in z around inf 61.8%
if -1.16000000000000001e198 < z < -1.25e97 or 0.54000000000000004 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
flip3-+9.6%
clear-num9.6%
clear-num9.6%
flip3-+99.6%
+-commutative99.6%
associate-*l*99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in x around -inf 67.1%
associate-/r*67.0%
*-commutative67.0%
Simplified67.0%
Taylor expanded in z around inf 67.1%
associate-/r/67.0%
associate-*r*67.2%
*-commutative67.2%
metadata-eval67.2%
Applied egg-rr67.2%
if -2.6000000000000001e-11 < z < -4.89999999999999993e-67 or -2.20000000000000022e-174 < z < 1.14999999999999995e-306 or 1.1e-222 < z < 9.50000000000000031e-153 or 2.40000000000000021e-115 < z < 4.9999999999999998e-70Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around 0 71.1%
Taylor expanded in z around 0 70.8%
distribute-rgt1-in70.8%
metadata-eval70.8%
*-commutative70.8%
Simplified70.8%
if -4.89999999999999993e-67 < z < -2.20000000000000022e-174 or 1.14999999999999995e-306 < z < 1.1e-222 or 9.50000000000000031e-153 < z < 2.40000000000000021e-115 or 4.9999999999999998e-70 < z < 0.54000000000000004Initial program 99.6%
+-commutative99.6%
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 69.1%
Taylor expanded in z around 0 67.8%
Final simplification67.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -2.95e+198)
t_0
(if (<= z -7e+97)
(* x (* z 6.0))
(if (<= z -2.6e-11)
t_0
(if (<= z -5.9e-68)
(* x -3.0)
(if (<= z -1.2e-167)
(* y 4.0)
(if (<= z 1.9e-306)
(* x -3.0)
(if (<= z 6.8e-217)
(* y 4.0)
(if (<= z 2.3e-152)
(* x -3.0)
(if (<= z 1e-114)
(* y 4.0)
(if (<= z 7.6e-61)
(* x -3.0)
(if (<= z 0.65) (* y 4.0) (* z (* x 6.0)))))))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -2.95e+198) {
tmp = t_0;
} else if (z <= -7e+97) {
tmp = x * (z * 6.0);
} else if (z <= -2.6e-11) {
tmp = t_0;
} else if (z <= -5.9e-68) {
tmp = x * -3.0;
} else if (z <= -1.2e-167) {
tmp = y * 4.0;
} else if (z <= 1.9e-306) {
tmp = x * -3.0;
} else if (z <= 6.8e-217) {
tmp = y * 4.0;
} else if (z <= 2.3e-152) {
tmp = x * -3.0;
} else if (z <= 1e-114) {
tmp = y * 4.0;
} else if (z <= 7.6e-61) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = 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) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-2.95d+198)) then
tmp = t_0
else if (z <= (-7d+97)) then
tmp = x * (z * 6.0d0)
else if (z <= (-2.6d-11)) then
tmp = t_0
else if (z <= (-5.9d-68)) then
tmp = x * (-3.0d0)
else if (z <= (-1.2d-167)) then
tmp = y * 4.0d0
else if (z <= 1.9d-306) then
tmp = x * (-3.0d0)
else if (z <= 6.8d-217) then
tmp = y * 4.0d0
else if (z <= 2.3d-152) then
tmp = x * (-3.0d0)
else if (z <= 1d-114) then
tmp = y * 4.0d0
else if (z <= 7.6d-61) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = z * (x * 6.0d0)
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 <= -2.95e+198) {
tmp = t_0;
} else if (z <= -7e+97) {
tmp = x * (z * 6.0);
} else if (z <= -2.6e-11) {
tmp = t_0;
} else if (z <= -5.9e-68) {
tmp = x * -3.0;
} else if (z <= -1.2e-167) {
tmp = y * 4.0;
} else if (z <= 1.9e-306) {
tmp = x * -3.0;
} else if (z <= 6.8e-217) {
tmp = y * 4.0;
} else if (z <= 2.3e-152) {
tmp = x * -3.0;
} else if (z <= 1e-114) {
tmp = y * 4.0;
} else if (z <= 7.6e-61) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = z * (x * 6.0);
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -2.95e+198: tmp = t_0 elif z <= -7e+97: tmp = x * (z * 6.0) elif z <= -2.6e-11: tmp = t_0 elif z <= -5.9e-68: tmp = x * -3.0 elif z <= -1.2e-167: tmp = y * 4.0 elif z <= 1.9e-306: tmp = x * -3.0 elif z <= 6.8e-217: tmp = y * 4.0 elif z <= 2.3e-152: tmp = x * -3.0 elif z <= 1e-114: tmp = y * 4.0 elif z <= 7.6e-61: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 else: tmp = z * (x * 6.0) return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -2.95e+198) tmp = t_0; elseif (z <= -7e+97) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= -2.6e-11) tmp = t_0; elseif (z <= -5.9e-68) tmp = Float64(x * -3.0); elseif (z <= -1.2e-167) tmp = Float64(y * 4.0); elseif (z <= 1.9e-306) tmp = Float64(x * -3.0); elseif (z <= 6.8e-217) tmp = Float64(y * 4.0); elseif (z <= 2.3e-152) tmp = Float64(x * -3.0); elseif (z <= 1e-114) tmp = Float64(y * 4.0); elseif (z <= 7.6e-61) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = Float64(z * Float64(x * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -2.95e+198) tmp = t_0; elseif (z <= -7e+97) tmp = x * (z * 6.0); elseif (z <= -2.6e-11) tmp = t_0; elseif (z <= -5.9e-68) tmp = x * -3.0; elseif (z <= -1.2e-167) tmp = y * 4.0; elseif (z <= 1.9e-306) tmp = x * -3.0; elseif (z <= 6.8e-217) tmp = y * 4.0; elseif (z <= 2.3e-152) tmp = x * -3.0; elseif (z <= 1e-114) tmp = y * 4.0; elseif (z <= 7.6e-61) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = z * (x * 6.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, -2.95e+198], t$95$0, If[LessEqual[z, -7e+97], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.6e-11], t$95$0, If[LessEqual[z, -5.9e-68], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.2e-167], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.9e-306], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.8e-217], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.3e-152], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1e-114], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.6e-61], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -2.95 \cdot 10^{+198}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7 \cdot 10^{+97}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-11}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -5.9 \cdot 10^{-68}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-167}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-306}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-217}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{-152}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 10^{-114}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-61}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\end{array}
\end{array}
if z < -2.94999999999999987e198 or -7.0000000000000001e97 < z < -2.6000000000000001e-11Initial program 99.7%
+-commutative99.7%
associate-*l*99.5%
fma-def99.5%
sub-neg99.5%
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 69.6%
Taylor expanded in z around inf 61.8%
if -2.94999999999999987e198 < z < -7.0000000000000001e97Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
flip3-+0.8%
clear-num0.8%
clear-num0.8%
flip3-+99.4%
+-commutative99.4%
associate-*l*99.9%
fma-def99.9%
Applied egg-rr99.8%
Taylor expanded in x around -inf 69.9%
associate-/r*69.8%
*-commutative69.8%
Simplified69.8%
Taylor expanded in z around inf 69.7%
associate-/r/69.7%
associate-*r*69.7%
*-commutative69.7%
associate-*l*69.9%
metadata-eval69.9%
Applied egg-rr69.9%
if -2.6000000000000001e-11 < z < -5.9e-68 or -1.19999999999999997e-167 < z < 1.9e-306 or 6.80000000000000032e-217 < z < 2.3000000000000001e-152 or 1.0000000000000001e-114 < z < 7.59999999999999961e-61Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around 0 71.1%
Taylor expanded in z around 0 70.8%
distribute-rgt1-in70.8%
metadata-eval70.8%
*-commutative70.8%
Simplified70.8%
if -5.9e-68 < z < -1.19999999999999997e-167 or 1.9e-306 < z < 6.80000000000000032e-217 or 2.3000000000000001e-152 < z < 1.0000000000000001e-114 or 7.59999999999999961e-61 < z < 0.650000000000000022Initial program 99.6%
+-commutative99.6%
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 69.1%
Taylor expanded in z around 0 67.8%
if 0.650000000000000022 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
flip3-+12.8%
clear-num12.8%
clear-num12.8%
flip3-+99.7%
+-commutative99.7%
associate-*l*99.7%
fma-def99.7%
Applied egg-rr99.6%
Taylor expanded in x around -inf 66.1%
associate-/r*66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in z around inf 66.1%
associate-/r/66.1%
associate-*r*66.3%
*-commutative66.3%
metadata-eval66.3%
Applied egg-rr66.3%
Final simplification67.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -1.6e+198)
t_0
(if (<= z -1.15e+97)
(* x (* z 6.0))
(if (<= z -2.6e-11)
t_0
(if (<= z -1.46e-68)
(* x -3.0)
(if (<= z -1.15e-166)
(* y 4.0)
(if (<= z 5.8e-307)
(* x -3.0)
(if (<= z 1.8e-223)
(* y 4.0)
(if (<= z 1.35e-151)
(* x -3.0)
(if (<= z 5.8e-117)
(* y 4.0)
(if (<= z 5.5e-64)
(/ 1.0 (/ -0.3333333333333333 x))
(if (<= z 0.65) (* y 4.0) (* z (* x 6.0)))))))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1.6e+198) {
tmp = t_0;
} else if (z <= -1.15e+97) {
tmp = x * (z * 6.0);
} else if (z <= -2.6e-11) {
tmp = t_0;
} else if (z <= -1.46e-68) {
tmp = x * -3.0;
} else if (z <= -1.15e-166) {
tmp = y * 4.0;
} else if (z <= 5.8e-307) {
tmp = x * -3.0;
} else if (z <= 1.8e-223) {
tmp = y * 4.0;
} else if (z <= 1.35e-151) {
tmp = x * -3.0;
} else if (z <= 5.8e-117) {
tmp = y * 4.0;
} else if (z <= 5.5e-64) {
tmp = 1.0 / (-0.3333333333333333 / x);
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = 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) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-1.6d+198)) then
tmp = t_0
else if (z <= (-1.15d+97)) then
tmp = x * (z * 6.0d0)
else if (z <= (-2.6d-11)) then
tmp = t_0
else if (z <= (-1.46d-68)) then
tmp = x * (-3.0d0)
else if (z <= (-1.15d-166)) then
tmp = y * 4.0d0
else if (z <= 5.8d-307) then
tmp = x * (-3.0d0)
else if (z <= 1.8d-223) then
tmp = y * 4.0d0
else if (z <= 1.35d-151) then
tmp = x * (-3.0d0)
else if (z <= 5.8d-117) then
tmp = y * 4.0d0
else if (z <= 5.5d-64) then
tmp = 1.0d0 / ((-0.3333333333333333d0) / x)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = z * (x * 6.0d0)
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.6e+198) {
tmp = t_0;
} else if (z <= -1.15e+97) {
tmp = x * (z * 6.0);
} else if (z <= -2.6e-11) {
tmp = t_0;
} else if (z <= -1.46e-68) {
tmp = x * -3.0;
} else if (z <= -1.15e-166) {
tmp = y * 4.0;
} else if (z <= 5.8e-307) {
tmp = x * -3.0;
} else if (z <= 1.8e-223) {
tmp = y * 4.0;
} else if (z <= 1.35e-151) {
tmp = x * -3.0;
} else if (z <= 5.8e-117) {
tmp = y * 4.0;
} else if (z <= 5.5e-64) {
tmp = 1.0 / (-0.3333333333333333 / x);
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = z * (x * 6.0);
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -1.6e+198: tmp = t_0 elif z <= -1.15e+97: tmp = x * (z * 6.0) elif z <= -2.6e-11: tmp = t_0 elif z <= -1.46e-68: tmp = x * -3.0 elif z <= -1.15e-166: tmp = y * 4.0 elif z <= 5.8e-307: tmp = x * -3.0 elif z <= 1.8e-223: tmp = y * 4.0 elif z <= 1.35e-151: tmp = x * -3.0 elif z <= 5.8e-117: tmp = y * 4.0 elif z <= 5.5e-64: tmp = 1.0 / (-0.3333333333333333 / x) elif z <= 0.65: tmp = y * 4.0 else: tmp = z * (x * 6.0) return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1.6e+198) tmp = t_0; elseif (z <= -1.15e+97) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= -2.6e-11) tmp = t_0; elseif (z <= -1.46e-68) tmp = Float64(x * -3.0); elseif (z <= -1.15e-166) tmp = Float64(y * 4.0); elseif (z <= 5.8e-307) tmp = Float64(x * -3.0); elseif (z <= 1.8e-223) tmp = Float64(y * 4.0); elseif (z <= 1.35e-151) tmp = Float64(x * -3.0); elseif (z <= 5.8e-117) tmp = Float64(y * 4.0); elseif (z <= 5.5e-64) tmp = Float64(1.0 / Float64(-0.3333333333333333 / x)); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = Float64(z * Float64(x * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -1.6e+198) tmp = t_0; elseif (z <= -1.15e+97) tmp = x * (z * 6.0); elseif (z <= -2.6e-11) tmp = t_0; elseif (z <= -1.46e-68) tmp = x * -3.0; elseif (z <= -1.15e-166) tmp = y * 4.0; elseif (z <= 5.8e-307) tmp = x * -3.0; elseif (z <= 1.8e-223) tmp = y * 4.0; elseif (z <= 1.35e-151) tmp = x * -3.0; elseif (z <= 5.8e-117) tmp = y * 4.0; elseif (z <= 5.5e-64) tmp = 1.0 / (-0.3333333333333333 / x); elseif (z <= 0.65) tmp = y * 4.0; else tmp = z * (x * 6.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.6e+198], t$95$0, If[LessEqual[z, -1.15e+97], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.6e-11], t$95$0, If[LessEqual[z, -1.46e-68], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.15e-166], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.8e-307], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.8e-223], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.35e-151], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 5.8e-117], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.5e-64], N[(1.0 / N[(-0.3333333333333333 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+198}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{+97}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-11}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.46 \cdot 10^{-68}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-166}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-307}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-223}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-151}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-117}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-64}:\\
\;\;\;\;\frac{1}{\frac{-0.3333333333333333}{x}}\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\end{array}
\end{array}
if z < -1.5999999999999999e198 or -1.15000000000000003e97 < z < -2.6000000000000001e-11Initial program 99.7%
+-commutative99.7%
associate-*l*99.5%
fma-def99.5%
sub-neg99.5%
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 69.6%
Taylor expanded in z around inf 61.8%
if -1.5999999999999999e198 < z < -1.15000000000000003e97Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
flip3-+0.8%
clear-num0.8%
clear-num0.8%
flip3-+99.4%
+-commutative99.4%
associate-*l*99.9%
fma-def99.9%
Applied egg-rr99.8%
Taylor expanded in x around -inf 69.9%
associate-/r*69.8%
*-commutative69.8%
Simplified69.8%
Taylor expanded in z around inf 69.7%
associate-/r/69.7%
associate-*r*69.7%
*-commutative69.7%
associate-*l*69.9%
metadata-eval69.9%
Applied egg-rr69.9%
if -2.6000000000000001e-11 < z < -1.45999999999999998e-68 or -1.14999999999999999e-166 < z < 5.8000000000000001e-307 or 1.8000000000000002e-223 < z < 1.35000000000000004e-151Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in y around 0 70.1%
Taylor expanded in z around 0 69.8%
distribute-rgt1-in69.8%
metadata-eval69.8%
*-commutative69.8%
Simplified69.8%
if -1.45999999999999998e-68 < z < -1.14999999999999999e-166 or 5.8000000000000001e-307 < z < 1.8000000000000002e-223 or 1.35000000000000004e-151 < z < 5.8000000000000001e-117 or 5.4999999999999999e-64 < z < 0.650000000000000022Initial program 99.6%
+-commutative99.6%
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 69.1%
Taylor expanded in z around 0 67.8%
if 5.8000000000000001e-117 < z < 5.4999999999999999e-64Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
flip3-+22.5%
clear-num22.4%
clear-num22.5%
flip3-+99.4%
+-commutative99.4%
associate-*l*99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in x around -inf 77.7%
associate-/r*77.7%
*-commutative77.7%
Simplified77.7%
Taylor expanded in z around 0 77.7%
if 0.650000000000000022 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
flip3-+12.8%
clear-num12.8%
clear-num12.8%
flip3-+99.7%
+-commutative99.7%
associate-*l*99.7%
fma-def99.7%
Applied egg-rr99.6%
Taylor expanded in x around -inf 66.1%
associate-/r*66.0%
*-commutative66.0%
Simplified66.0%
Taylor expanded in z around inf 66.1%
associate-/r/66.1%
associate-*r*66.3%
*-commutative66.3%
metadata-eval66.3%
Applied egg-rr66.3%
Final simplification67.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -2.6e-11)
t_0
(if (<= z -1.5e-68)
(* x -3.0)
(if (<= z -8e-175)
(* y 4.0)
(if (<= z 2.25e-306)
(* x -3.0)
(if (<= z 1.7e-216)
(* y 4.0)
(if (<= z 1.1e-152)
(* x -3.0)
(if (<= z 3.2e-115)
(* y 4.0)
(if (<= z 4.7e-73)
(* x -3.0)
(if (<= z 0.048) (* y 4.0) t_0)))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -2.6e-11) {
tmp = t_0;
} else if (z <= -1.5e-68) {
tmp = x * -3.0;
} else if (z <= -8e-175) {
tmp = y * 4.0;
} else if (z <= 2.25e-306) {
tmp = x * -3.0;
} else if (z <= 1.7e-216) {
tmp = y * 4.0;
} else if (z <= 1.1e-152) {
tmp = x * -3.0;
} else if (z <= 3.2e-115) {
tmp = y * 4.0;
} else if (z <= 4.7e-73) {
tmp = x * -3.0;
} else if (z <= 0.048) {
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 <= (-2.6d-11)) then
tmp = t_0
else if (z <= (-1.5d-68)) then
tmp = x * (-3.0d0)
else if (z <= (-8d-175)) then
tmp = y * 4.0d0
else if (z <= 2.25d-306) then
tmp = x * (-3.0d0)
else if (z <= 1.7d-216) then
tmp = y * 4.0d0
else if (z <= 1.1d-152) then
tmp = x * (-3.0d0)
else if (z <= 3.2d-115) then
tmp = y * 4.0d0
else if (z <= 4.7d-73) then
tmp = x * (-3.0d0)
else if (z <= 0.048d0) 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 <= -2.6e-11) {
tmp = t_0;
} else if (z <= -1.5e-68) {
tmp = x * -3.0;
} else if (z <= -8e-175) {
tmp = y * 4.0;
} else if (z <= 2.25e-306) {
tmp = x * -3.0;
} else if (z <= 1.7e-216) {
tmp = y * 4.0;
} else if (z <= 1.1e-152) {
tmp = x * -3.0;
} else if (z <= 3.2e-115) {
tmp = y * 4.0;
} else if (z <= 4.7e-73) {
tmp = x * -3.0;
} else if (z <= 0.048) {
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 <= -2.6e-11: tmp = t_0 elif z <= -1.5e-68: tmp = x * -3.0 elif z <= -8e-175: tmp = y * 4.0 elif z <= 2.25e-306: tmp = x * -3.0 elif z <= 1.7e-216: tmp = y * 4.0 elif z <= 1.1e-152: tmp = x * -3.0 elif z <= 3.2e-115: tmp = y * 4.0 elif z <= 4.7e-73: tmp = x * -3.0 elif z <= 0.048: 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 <= -2.6e-11) tmp = t_0; elseif (z <= -1.5e-68) tmp = Float64(x * -3.0); elseif (z <= -8e-175) tmp = Float64(y * 4.0); elseif (z <= 2.25e-306) tmp = Float64(x * -3.0); elseif (z <= 1.7e-216) tmp = Float64(y * 4.0); elseif (z <= 1.1e-152) tmp = Float64(x * -3.0); elseif (z <= 3.2e-115) tmp = Float64(y * 4.0); elseif (z <= 4.7e-73) tmp = Float64(x * -3.0); elseif (z <= 0.048) 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 <= -2.6e-11) tmp = t_0; elseif (z <= -1.5e-68) tmp = x * -3.0; elseif (z <= -8e-175) tmp = y * 4.0; elseif (z <= 2.25e-306) tmp = x * -3.0; elseif (z <= 1.7e-216) tmp = y * 4.0; elseif (z <= 1.1e-152) tmp = x * -3.0; elseif (z <= 3.2e-115) tmp = y * 4.0; elseif (z <= 4.7e-73) tmp = x * -3.0; elseif (z <= 0.048) 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, -2.6e-11], t$95$0, If[LessEqual[z, -1.5e-68], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -8e-175], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.25e-306], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.7e-216], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.1e-152], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.2e-115], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.7e-73], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.048], 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 -2.6 \cdot 10^{-11}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-68}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-175}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-306}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-216}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-152}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-115}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{-73}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.048:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -2.6000000000000001e-11 or 0.048000000000000001 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 51.6%
Taylor expanded in z around inf 47.7%
if -2.6000000000000001e-11 < z < -1.5e-68 or -8e-175 < z < 2.25000000000000002e-306 or 1.6999999999999999e-216 < z < 1.09999999999999992e-152 or 3.2e-115 < z < 4.69999999999999994e-73Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in y around 0 71.1%
Taylor expanded in z around 0 70.8%
distribute-rgt1-in70.8%
metadata-eval70.8%
*-commutative70.8%
Simplified70.8%
if -1.5e-68 < z < -8e-175 or 2.25000000000000002e-306 < z < 1.6999999999999999e-216 or 1.09999999999999992e-152 < z < 3.2e-115 or 4.69999999999999994e-73 < z < 0.048000000000000001Initial program 99.6%
+-commutative99.6%
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 70.2%
Taylor expanded in z around 0 69.0%
Final simplification58.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (+ 4.0 (* z -6.0)))))
(if (<= y -8e-74)
t_0
(if (<= y -1.65e-274)
(* x (* z 6.0))
(if (<= y 4.2e-171)
(* x -3.0)
(if (<= y 1900000000000.0) (* z (* x 6.0)) t_0))))))
double code(double x, double y, double z) {
double t_0 = y * (4.0 + (z * -6.0));
double tmp;
if (y <= -8e-74) {
tmp = t_0;
} else if (y <= -1.65e-274) {
tmp = x * (z * 6.0);
} else if (y <= 4.2e-171) {
tmp = x * -3.0;
} else if (y <= 1900000000000.0) {
tmp = z * (x * 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 = y * (4.0d0 + (z * (-6.0d0)))
if (y <= (-8d-74)) then
tmp = t_0
else if (y <= (-1.65d-274)) then
tmp = x * (z * 6.0d0)
else if (y <= 4.2d-171) then
tmp = x * (-3.0d0)
else if (y <= 1900000000000.0d0) then
tmp = z * (x * 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 = y * (4.0 + (z * -6.0));
double tmp;
if (y <= -8e-74) {
tmp = t_0;
} else if (y <= -1.65e-274) {
tmp = x * (z * 6.0);
} else if (y <= 4.2e-171) {
tmp = x * -3.0;
} else if (y <= 1900000000000.0) {
tmp = z * (x * 6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (4.0 + (z * -6.0)) tmp = 0 if y <= -8e-74: tmp = t_0 elif y <= -1.65e-274: tmp = x * (z * 6.0) elif y <= 4.2e-171: tmp = x * -3.0 elif y <= 1900000000000.0: tmp = z * (x * 6.0) 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 <= -8e-74) tmp = t_0; elseif (y <= -1.65e-274) tmp = Float64(x * Float64(z * 6.0)); elseif (y <= 4.2e-171) tmp = Float64(x * -3.0); elseif (y <= 1900000000000.0) tmp = Float64(z * Float64(x * 6.0)); 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 <= -8e-74) tmp = t_0; elseif (y <= -1.65e-274) tmp = x * (z * 6.0); elseif (y <= 4.2e-171) tmp = x * -3.0; elseif (y <= 1900000000000.0) tmp = z * (x * 6.0); 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, -8e-74], t$95$0, If[LessEqual[y, -1.65e-274], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e-171], N[(x * -3.0), $MachinePrecision], If[LessEqual[y, 1900000000000.0], N[(z * N[(x * 6.0), $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 -8 \cdot 10^{-74}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.65 \cdot 10^{-274}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-171}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;y \leq 1900000000000:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -7.99999999999999966e-74 or 1.9e12 < 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 77.1%
if -7.99999999999999966e-74 < y < -1.6499999999999999e-274Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
flip3-+23.7%
clear-num23.6%
clear-num23.6%
flip3-+99.4%
+-commutative99.4%
associate-*l*99.6%
fma-def99.6%
Applied egg-rr99.5%
Taylor expanded in x around -inf 82.6%
associate-/r*82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in z around inf 55.4%
associate-/r/55.2%
associate-*r*55.4%
*-commutative55.4%
associate-*l*55.4%
metadata-eval55.4%
Applied egg-rr55.4%
if -1.6499999999999999e-274 < y < 4.2e-171Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 94.6%
Taylor expanded in z around 0 60.8%
distribute-rgt1-in60.8%
metadata-eval60.8%
*-commutative60.8%
Simplified60.8%
if 4.2e-171 < y < 1.9e12Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
flip3-+18.8%
clear-num18.8%
clear-num18.8%
flip3-+99.5%
+-commutative99.5%
associate-*l*99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in x around -inf 77.0%
associate-/r*77.0%
*-commutative77.0%
Simplified77.0%
Taylor expanded in z around inf 51.0%
associate-/r/51.0%
associate-*r*51.1%
*-commutative51.1%
metadata-eval51.1%
Applied egg-rr51.1%
Final simplification67.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.66) (not (<= z 0.58))) (+ x (* -6.0 (* (- y x) z))) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.66) || !(z <= 0.58)) {
tmp = x + (-6.0 * ((y - x) * z));
} else {
tmp = x + ((y - x) * 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.66d0)) .or. (.not. (z <= 0.58d0))) then
tmp = x + ((-6.0d0) * ((y - x) * z))
else
tmp = x + ((y - x) * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.66) || !(z <= 0.58)) {
tmp = x + (-6.0 * ((y - x) * z));
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.66) or not (z <= 0.58): tmp = x + (-6.0 * ((y - x) * z)) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.66) || !(z <= 0.58)) tmp = Float64(x + Float64(-6.0 * Float64(Float64(y - x) * z))); else tmp = Float64(x + Float64(Float64(y - x) * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.66) || ~((z <= 0.58))) tmp = x + (-6.0 * ((y - x) * z)); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.66], N[Not[LessEqual[z, 0.58]], $MachinePrecision]], N[(x + N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66 \lor \neg \left(z \leq 0.58\right):\\
\;\;\;\;x + -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.660000000000000031 or 0.57999999999999996 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 97.8%
if -0.660000000000000031 < z < 0.57999999999999996Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 96.9%
Final simplification97.3%
(FPCore (x y z) :precision binary64 (+ x (/ (- y x) (/ (/ 1.0 (- 0.6666666666666666 z)) 6.0))))
double code(double x, double y, double z) {
return x + ((y - x) / ((1.0 / (0.6666666666666666 - z)) / 6.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 + ((y - x) / ((1.0d0 / (0.6666666666666666d0 - z)) / 6.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((y - x) / ((1.0 / (0.6666666666666666 - z)) / 6.0));
}
def code(x, y, z): return x + ((y - x) / ((1.0 / (0.6666666666666666 - z)) / 6.0))
function code(x, y, z) return Float64(x + Float64(Float64(y - x) / Float64(Float64(1.0 / Float64(0.6666666666666666 - z)) / 6.0))) end
function tmp = code(x, y, z) tmp = x + ((y - x) / ((1.0 / (0.6666666666666666 - z)) / 6.0)); end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] / N[(N[(1.0 / N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision] / 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - x}{\frac{\frac{1}{0.6666666666666666 - z}}{6}}
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
flip--88.6%
clear-num88.6%
un-div-inv88.7%
clear-num88.7%
flip--99.7%
Applied egg-rr99.7%
associate-/l*99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.8e-73) (not (<= y 1.5e-5))) (* y (+ 4.0 (* z -6.0))) (* x (- -3.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.8e-73) || !(y <= 1.5e-5)) {
tmp = y * (4.0 + (z * -6.0));
} 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 <= (-2.8d-73)) .or. (.not. (y <= 1.5d-5))) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
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 <= -2.8e-73) || !(y <= 1.5e-5)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * (-3.0 - (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.8e-73) or not (y <= 1.5e-5): tmp = y * (4.0 + (z * -6.0)) else: tmp = x * (-3.0 - (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.8e-73) || !(y <= 1.5e-5)) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); 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 <= -2.8e-73) || ~((y <= 1.5e-5))) tmp = y * (4.0 + (z * -6.0)); else tmp = x * (-3.0 - (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.8e-73], N[Not[LessEqual[y, 1.5e-5]], $MachinePrecision]], N[(y * N[(4.0 + N[(z * -6.0), $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 -2.8 \cdot 10^{-73} \lor \neg \left(y \leq 1.5 \cdot 10^{-5}\right):\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 - z \cdot -6\right)\\
\end{array}
\end{array}
if y < -2.80000000000000012e-73 or 1.50000000000000004e-5 < 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 76.7%
if -2.80000000000000012e-73 < y < 1.50000000000000004e-5Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
flip3-+22.3%
clear-num22.2%
clear-num22.3%
flip3-+99.4%
+-commutative99.4%
associate-*l*99.6%
fma-def99.6%
Applied egg-rr99.5%
Taylor expanded in x around -inf 85.4%
associate-/r*85.4%
*-commutative85.4%
Simplified85.4%
associate-/l/85.4%
associate-/r/85.5%
metadata-eval85.5%
associate-*r*85.5%
neg-mul-185.5%
neg-sub085.5%
associate--r+85.5%
metadata-eval85.5%
Applied egg-rr85.5%
Final simplification80.6%
(FPCore (x y z) :precision binary64 (+ x (* (- 0.6666666666666666 z) (* (- y x) 6.0))))
double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.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 + ((0.6666666666666666d0 - z) * ((y - x) * 6.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.0));
}
def code(x, y, z): return x + ((0.6666666666666666 - z) * ((y - x) * 6.0))
function code(x, y, z) return Float64(x + Float64(Float64(0.6666666666666666 - z) * Float64(Float64(y - x) * 6.0))) end
function tmp = code(x, y, z) tmp = x + ((0.6666666666666666 - z) * ((y - x) * 6.0)); end
code[x_, y_, z_] := N[(x + N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(0.6666666666666666 - z\right) \cdot \left(\left(y - x\right) \cdot 6\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z) :precision binary64 (if (<= x -1.05e+28) (* x -3.0) (if (<= x 1.05e+117) (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.05e+28) {
tmp = x * -3.0;
} else if (x <= 1.05e+117) {
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 (x <= (-1.05d+28)) then
tmp = x * (-3.0d0)
else if (x <= 1.05d+117) 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 (x <= -1.05e+28) {
tmp = x * -3.0;
} else if (x <= 1.05e+117) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.05e+28: tmp = x * -3.0 elif x <= 1.05e+117: tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.05e+28) tmp = Float64(x * -3.0); elseif (x <= 1.05e+117) 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 (x <= -1.05e+28) tmp = x * -3.0; elseif (x <= 1.05e+117) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.05e+28], N[(x * -3.0), $MachinePrecision], If[LessEqual[x, 1.05e+117], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+28}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+117}:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if x < -1.04999999999999995e28 or 1.0500000000000001e117 < x Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 83.2%
Taylor expanded in z around 0 43.1%
distribute-rgt1-in43.1%
metadata-eval43.1%
*-commutative43.1%
Simplified43.1%
if -1.04999999999999995e28 < x < 1.0500000000000001e117Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.7%
sub-neg99.7%
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 68.8%
Taylor expanded in z around 0 37.9%
Final simplification40.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.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 54.6%
Taylor expanded in z around 0 26.4%
distribute-rgt1-in26.4%
metadata-eval26.4%
*-commutative26.4%
Simplified26.4%
Final simplification26.4%
herbie shell --seed 2023297
(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))))