
(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 14 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.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
(FPCore (x y z)
:precision binary64
(if (<= z -0.66)
(* -6.0 (* y z))
(if (<= z -7.1e-149)
(* x -3.0)
(if (<= z 8e-149)
(* y 4.0)
(if (<= z 0.52)
(* x -3.0)
(if (<= z 2.4e+249) (* z (* y -6.0)) (* x (* z 6.0))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = -6.0 * (y * z);
} else if (z <= -7.1e-149) {
tmp = x * -3.0;
} else if (z <= 8e-149) {
tmp = y * 4.0;
} else if (z <= 0.52) {
tmp = x * -3.0;
} else if (z <= 2.4e+249) {
tmp = z * (y * -6.0);
} else {
tmp = x * (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 (z <= (-0.66d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-7.1d-149)) then
tmp = x * (-3.0d0)
else if (z <= 8d-149) then
tmp = y * 4.0d0
else if (z <= 0.52d0) then
tmp = x * (-3.0d0)
else if (z <= 2.4d+249) then
tmp = z * (y * (-6.0d0))
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = -6.0 * (y * z);
} else if (z <= -7.1e-149) {
tmp = x * -3.0;
} else if (z <= 8e-149) {
tmp = y * 4.0;
} else if (z <= 0.52) {
tmp = x * -3.0;
} else if (z <= 2.4e+249) {
tmp = z * (y * -6.0);
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = -6.0 * (y * z) elif z <= -7.1e-149: tmp = x * -3.0 elif z <= 8e-149: tmp = y * 4.0 elif z <= 0.52: tmp = x * -3.0 elif z <= 2.4e+249: tmp = z * (y * -6.0) else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -7.1e-149) tmp = Float64(x * -3.0); elseif (z <= 8e-149) tmp = Float64(y * 4.0); elseif (z <= 0.52) tmp = Float64(x * -3.0); elseif (z <= 2.4e+249) tmp = Float64(z * Float64(y * -6.0)); else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = -6.0 * (y * z); elseif (z <= -7.1e-149) tmp = x * -3.0; elseif (z <= 8e-149) tmp = y * 4.0; elseif (z <= 0.52) tmp = x * -3.0; elseif (z <= 2.4e+249) tmp = z * (y * -6.0); else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.1e-149], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8e-149], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.4e+249], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -7.1 \cdot 10^{-149}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-149}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{+249}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
add-cube-cbrt99.6%
fma-define99.6%
pow299.6%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 94.4%
associate-*r*94.4%
metadata-eval94.4%
distribute-lft-neg-in94.4%
distribute-lft-neg-in94.4%
*-commutative94.4%
distribute-rgt-neg-in94.4%
distribute-lft-neg-in94.4%
metadata-eval94.4%
*-commutative94.4%
Simplified94.4%
Taylor expanded in y around inf 54.7%
*-commutative54.7%
Simplified54.7%
if -0.660000000000000031 < z < -7.1000000000000002e-149 or 7.99999999999999983e-149 < z < 0.52000000000000002Initial program 99.3%
+-commutative99.3%
associate-*l*99.7%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 62.5%
*-lft-identity62.5%
*-commutative62.5%
+-commutative62.5%
*-commutative62.5%
fma-define62.5%
associate-*r*62.5%
fma-define62.5%
distribute-lft-in62.5%
neg-mul-162.5%
distribute-lft-neg-in62.5%
metadata-eval62.5%
metadata-eval62.5%
distribute-rgt-in62.4%
+-commutative62.4%
sub-neg62.4%
distribute-rgt-in62.4%
sub-neg62.4%
distribute-rgt-in62.5%
metadata-eval62.5%
distribute-lft-neg-in62.5%
associate-+r+62.5%
Simplified62.5%
Taylor expanded in z around 0 61.4%
*-commutative61.4%
Simplified61.4%
if -7.1000000000000002e-149 < z < 7.99999999999999983e-149Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
add-cube-cbrt99.2%
fma-define99.2%
pow299.2%
associate-*l*99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 61.1%
Taylor expanded in z around 0 61.3%
*-commutative61.3%
Simplified61.3%
if 0.52000000000000002 < z < 2.4e249Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
add-cube-cbrt99.7%
fma-define99.7%
pow299.7%
associate-*l*99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 96.5%
associate-*r*96.5%
metadata-eval96.5%
distribute-lft-neg-in96.5%
distribute-lft-neg-in96.5%
*-commutative96.5%
distribute-rgt-neg-in96.5%
distribute-lft-neg-in96.5%
metadata-eval96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in y around inf 56.8%
associate-*r*56.9%
*-commutative56.9%
Simplified56.9%
if 2.4e249 < z Initial program 99.9%
+-commutative99.9%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 72.7%
*-lft-identity72.7%
*-commutative72.7%
+-commutative72.7%
*-commutative72.7%
fma-define72.6%
associate-*r*72.6%
fma-define72.7%
distribute-lft-in72.7%
neg-mul-172.7%
distribute-lft-neg-in72.7%
metadata-eval72.7%
metadata-eval72.7%
distribute-rgt-in72.7%
+-commutative72.7%
sub-neg72.7%
distribute-rgt-in72.7%
sub-neg72.7%
distribute-rgt-in72.7%
metadata-eval72.7%
distribute-lft-neg-in72.7%
associate-+r+72.7%
Simplified72.7%
Taylor expanded in z around inf 72.7%
Final simplification59.4%
(FPCore (x y z)
:precision binary64
(if (<= z -1.25)
(* -6.0 (* y z))
(if (<= z -1.22e-147)
(* x -3.0)
(if (<= z 5.3e-154)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (<= z 6.8e+246) (* y (* z -6.0)) (* x (* z 6.0))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.25) {
tmp = -6.0 * (y * z);
} else if (z <= -1.22e-147) {
tmp = x * -3.0;
} else if (z <= 5.3e-154) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 6.8e+246) {
tmp = y * (z * -6.0);
} else {
tmp = x * (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 (z <= (-1.25d0)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-1.22d-147)) then
tmp = x * (-3.0d0)
else if (z <= 5.3d-154) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if (z <= 6.8d+246) then
tmp = y * (z * (-6.0d0))
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.25) {
tmp = -6.0 * (y * z);
} else if (z <= -1.22e-147) {
tmp = x * -3.0;
} else if (z <= 5.3e-154) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 6.8e+246) {
tmp = y * (z * -6.0);
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.25: tmp = -6.0 * (y * z) elif z <= -1.22e-147: tmp = x * -3.0 elif z <= 5.3e-154: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif z <= 6.8e+246: tmp = y * (z * -6.0) else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.25) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -1.22e-147) tmp = Float64(x * -3.0); elseif (z <= 5.3e-154) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif (z <= 6.8e+246) tmp = Float64(y * Float64(z * -6.0)); else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.25) tmp = -6.0 * (y * z); elseif (z <= -1.22e-147) tmp = x * -3.0; elseif (z <= 5.3e-154) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif (z <= 6.8e+246) tmp = y * (z * -6.0); else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.25], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.22e-147], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 5.3e-154], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.8e+246], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -1.22 \cdot 10^{-147}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{-154}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+246}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if z < -1.25Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
add-cube-cbrt99.6%
fma-define99.6%
pow299.6%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 94.4%
associate-*r*94.4%
metadata-eval94.4%
distribute-lft-neg-in94.4%
distribute-lft-neg-in94.4%
*-commutative94.4%
distribute-rgt-neg-in94.4%
distribute-lft-neg-in94.4%
metadata-eval94.4%
*-commutative94.4%
Simplified94.4%
Taylor expanded in y around inf 54.7%
*-commutative54.7%
Simplified54.7%
if -1.25 < z < -1.21999999999999995e-147 or 5.3000000000000002e-154 < z < 0.5Initial program 99.3%
+-commutative99.3%
associate-*l*99.7%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 62.5%
*-lft-identity62.5%
*-commutative62.5%
+-commutative62.5%
*-commutative62.5%
fma-define62.5%
associate-*r*62.5%
fma-define62.5%
distribute-lft-in62.5%
neg-mul-162.5%
distribute-lft-neg-in62.5%
metadata-eval62.5%
metadata-eval62.5%
distribute-rgt-in62.4%
+-commutative62.4%
sub-neg62.4%
distribute-rgt-in62.4%
sub-neg62.4%
distribute-rgt-in62.5%
metadata-eval62.5%
distribute-lft-neg-in62.5%
associate-+r+62.5%
Simplified62.5%
Taylor expanded in z around 0 61.4%
*-commutative61.4%
Simplified61.4%
if -1.21999999999999995e-147 < z < 5.3000000000000002e-154Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
add-cube-cbrt99.2%
fma-define99.2%
pow299.2%
associate-*l*99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 61.1%
Taylor expanded in z around 0 61.3%
*-commutative61.3%
Simplified61.3%
if 0.5 < z < 6.79999999999999977e246Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
add-cube-cbrt99.7%
fma-define99.7%
pow299.7%
associate-*l*99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 96.5%
associate-*r*96.5%
metadata-eval96.5%
distribute-lft-neg-in96.5%
distribute-lft-neg-in96.5%
*-commutative96.5%
distribute-rgt-neg-in96.5%
distribute-lft-neg-in96.5%
metadata-eval96.5%
*-commutative96.5%
Simplified96.5%
Taylor expanded in y around inf 56.9%
if 6.79999999999999977e246 < z Initial program 99.9%
+-commutative99.9%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 72.7%
*-lft-identity72.7%
*-commutative72.7%
+-commutative72.7%
*-commutative72.7%
fma-define72.6%
associate-*r*72.6%
fma-define72.7%
distribute-lft-in72.7%
neg-mul-172.7%
distribute-lft-neg-in72.7%
metadata-eval72.7%
metadata-eval72.7%
distribute-rgt-in72.7%
+-commutative72.7%
sub-neg72.7%
distribute-rgt-in72.7%
sub-neg72.7%
distribute-rgt-in72.7%
metadata-eval72.7%
distribute-lft-neg-in72.7%
associate-+r+72.7%
Simplified72.7%
Taylor expanded in z around inf 72.7%
Final simplification59.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -1.7)
t_0
(if (<= z -7e-148)
(* x -3.0)
(if (<= z 8.4e-146)
(* y 4.0)
(if (<= z 0.66)
(* x -3.0)
(if (<= z 9.5e+219) t_0 (* 6.0 (* x z)))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -1.7) {
tmp = t_0;
} else if (z <= -7e-148) {
tmp = x * -3.0;
} else if (z <= 8.4e-146) {
tmp = y * 4.0;
} else if (z <= 0.66) {
tmp = x * -3.0;
} else if (z <= 9.5e+219) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-1.7d0)) then
tmp = t_0
else if (z <= (-7d-148)) then
tmp = x * (-3.0d0)
else if (z <= 8.4d-146) then
tmp = y * 4.0d0
else if (z <= 0.66d0) then
tmp = x * (-3.0d0)
else if (z <= 9.5d+219) then
tmp = t_0
else
tmp = 6.0d0 * (x * z)
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.7) {
tmp = t_0;
} else if (z <= -7e-148) {
tmp = x * -3.0;
} else if (z <= 8.4e-146) {
tmp = y * 4.0;
} else if (z <= 0.66) {
tmp = x * -3.0;
} else if (z <= 9.5e+219) {
tmp = t_0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -1.7: tmp = t_0 elif z <= -7e-148: tmp = x * -3.0 elif z <= 8.4e-146: tmp = y * 4.0 elif z <= 0.66: tmp = x * -3.0 elif z <= 9.5e+219: tmp = t_0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -1.7) tmp = t_0; elseif (z <= -7e-148) tmp = Float64(x * -3.0); elseif (z <= 8.4e-146) tmp = Float64(y * 4.0); elseif (z <= 0.66) tmp = Float64(x * -3.0); elseif (z <= 9.5e+219) tmp = t_0; else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -1.7) tmp = t_0; elseif (z <= -7e-148) tmp = x * -3.0; elseif (z <= 8.4e-146) tmp = y * 4.0; elseif (z <= 0.66) tmp = x * -3.0; elseif (z <= 9.5e+219) tmp = t_0; else tmp = 6.0 * (x * z); 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.7], t$95$0, If[LessEqual[z, -7e-148], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8.4e-146], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.66], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 9.5e+219], t$95$0, N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.7:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-148}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 8.4 \cdot 10^{-146}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+219}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -1.69999999999999996 or 0.660000000000000031 < z < 9.49999999999999959e219Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
add-cube-cbrt99.7%
fma-define99.7%
pow299.7%
associate-*l*99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 95.4%
associate-*r*95.4%
metadata-eval95.4%
distribute-lft-neg-in95.4%
distribute-lft-neg-in95.4%
*-commutative95.4%
distribute-rgt-neg-in95.4%
distribute-lft-neg-in95.4%
metadata-eval95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in y around inf 55.9%
*-commutative55.9%
Simplified55.9%
if -1.69999999999999996 < z < -7.0000000000000001e-148 or 8.3999999999999996e-146 < z < 0.660000000000000031Initial program 99.3%
+-commutative99.3%
associate-*l*99.7%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 62.5%
*-lft-identity62.5%
*-commutative62.5%
+-commutative62.5%
*-commutative62.5%
fma-define62.5%
associate-*r*62.5%
fma-define62.5%
distribute-lft-in62.5%
neg-mul-162.5%
distribute-lft-neg-in62.5%
metadata-eval62.5%
metadata-eval62.5%
distribute-rgt-in62.4%
+-commutative62.4%
sub-neg62.4%
distribute-rgt-in62.4%
sub-neg62.4%
distribute-rgt-in62.5%
metadata-eval62.5%
distribute-lft-neg-in62.5%
associate-+r+62.5%
Simplified62.5%
Taylor expanded in z around 0 61.4%
*-commutative61.4%
Simplified61.4%
if -7.0000000000000001e-148 < z < 8.3999999999999996e-146Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
add-cube-cbrt99.2%
fma-define99.2%
pow299.2%
associate-*l*99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 61.1%
Taylor expanded in z around 0 61.3%
*-commutative61.3%
Simplified61.3%
if 9.49999999999999959e219 < z Initial program 99.9%
+-commutative99.9%
associate-*l*99.7%
fma-define99.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 0 70.2%
*-lft-identity70.2%
*-commutative70.2%
+-commutative70.2%
*-commutative70.2%
fma-define70.1%
associate-*r*70.1%
fma-define70.2%
distribute-lft-in70.2%
neg-mul-170.2%
distribute-lft-neg-in70.2%
metadata-eval70.2%
metadata-eval70.2%
distribute-rgt-in70.2%
+-commutative70.2%
sub-neg70.2%
distribute-rgt-in70.2%
sub-neg70.2%
distribute-rgt-in70.2%
metadata-eval70.2%
distribute-lft-neg-in70.2%
associate-+r+70.2%
Simplified70.2%
Taylor expanded in z around inf 70.2%
*-commutative70.2%
Simplified70.2%
Final simplification59.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -1.0)
t_0
(if (<= z -7e-150)
(* x -3.0)
(if (<= z 2.6e-147) (* 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 * (y * z);
double tmp;
if (z <= -1.0) {
tmp = t_0;
} else if (z <= -7e-150) {
tmp = x * -3.0;
} else if (z <= 2.6e-147) {
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) * (y * z)
if (z <= (-1.0d0)) then
tmp = t_0
else if (z <= (-7d-150)) then
tmp = x * (-3.0d0)
else if (z <= 2.6d-147) 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 * (y * z);
double tmp;
if (z <= -1.0) {
tmp = t_0;
} else if (z <= -7e-150) {
tmp = x * -3.0;
} else if (z <= 2.6e-147) {
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 * (y * z) tmp = 0 if z <= -1.0: tmp = t_0 elif z <= -7e-150: tmp = x * -3.0 elif z <= 2.6e-147: 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(y * z)) tmp = 0.0 if (z <= -1.0) tmp = t_0; elseif (z <= -7e-150) tmp = Float64(x * -3.0); elseif (z <= 2.6e-147) 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 * (y * z); tmp = 0.0; if (z <= -1.0) tmp = t_0; elseif (z <= -7e-150) tmp = x * -3.0; elseif (z <= 2.6e-147) 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[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.0], t$95$0, If[LessEqual[z, -7e-150], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.6e-147], 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(y \cdot z\right)\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-150}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-147}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1 or 0.5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
add-cube-cbrt99.7%
fma-define99.7%
pow299.7%
associate-*l*99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 95.9%
associate-*r*96.0%
metadata-eval96.0%
distribute-lft-neg-in96.0%
distribute-lft-neg-in96.0%
*-commutative96.0%
distribute-rgt-neg-in96.0%
distribute-lft-neg-in96.0%
metadata-eval96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in y around inf 53.1%
*-commutative53.1%
Simplified53.1%
if -1 < z < -6.9999999999999996e-150 or 2.5999999999999999e-147 < z < 0.5Initial program 99.3%
+-commutative99.3%
associate-*l*99.7%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 62.5%
*-lft-identity62.5%
*-commutative62.5%
+-commutative62.5%
*-commutative62.5%
fma-define62.5%
associate-*r*62.5%
fma-define62.5%
distribute-lft-in62.5%
neg-mul-162.5%
distribute-lft-neg-in62.5%
metadata-eval62.5%
metadata-eval62.5%
distribute-rgt-in62.4%
+-commutative62.4%
sub-neg62.4%
distribute-rgt-in62.4%
sub-neg62.4%
distribute-rgt-in62.5%
metadata-eval62.5%
distribute-lft-neg-in62.5%
associate-+r+62.5%
Simplified62.5%
Taylor expanded in z around 0 61.4%
*-commutative61.4%
Simplified61.4%
if -6.9999999999999996e-150 < z < 2.5999999999999999e-147Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
add-cube-cbrt99.2%
fma-define99.2%
pow299.2%
associate-*l*99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 61.1%
Taylor expanded in z around 0 61.3%
*-commutative61.3%
Simplified61.3%
Final simplification56.9%
(FPCore (x y z) :precision binary64 (if (or (<= x -4.5e+40) (not (<= x 7.6e+84))) (* x (+ -3.0 (* z 6.0))) (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -4.5e+40) || !(x <= 7.6e+84)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-4.5d+40)) .or. (.not. (x <= 7.6d+84))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -4.5e+40) || !(x <= 7.6e+84)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -4.5e+40) or not (x <= 7.6e+84): tmp = x * (-3.0 + (z * 6.0)) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -4.5e+40) || !(x <= 7.6e+84)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -4.5e+40) || ~((x <= 7.6e+84))) tmp = x * (-3.0 + (z * 6.0)); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -4.5e+40], N[Not[LessEqual[x, 7.6e+84]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+40} \lor \neg \left(x \leq 7.6 \cdot 10^{+84}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -4.50000000000000032e40 or 7.6000000000000002e84 < x Initial program 99.4%
+-commutative99.4%
associate-*l*99.7%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 83.8%
*-lft-identity83.8%
*-commutative83.8%
+-commutative83.8%
*-commutative83.8%
fma-define83.8%
associate-*r*83.8%
fma-define83.8%
distribute-lft-in83.8%
neg-mul-183.8%
distribute-lft-neg-in83.8%
metadata-eval83.8%
metadata-eval83.8%
distribute-rgt-in83.8%
+-commutative83.8%
sub-neg83.8%
distribute-rgt-in83.8%
sub-neg83.8%
distribute-rgt-in83.8%
metadata-eval83.8%
distribute-lft-neg-in83.8%
associate-+r+83.8%
Simplified83.8%
if -4.50000000000000032e40 < x < 7.6000000000000002e84Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 74.5%
Final simplification78.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.35e+42) (not (<= x 2.8e+85))) (* x (+ -3.0 (* z 6.0))) (* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.35e+42) || !(x <= 2.8e+85)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.35d+42)) .or. (.not. (x <= 2.8d+85))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.35e+42) || !(x <= 2.8e+85)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.35e+42) or not (x <= 2.8e+85): tmp = x * (-3.0 + (z * 6.0)) else: tmp = 6.0 * (y * (0.6666666666666666 - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.35e+42) || !(x <= 2.8e+85)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.35e+42) || ~((x <= 2.8e+85))) tmp = x * (-3.0 + (z * 6.0)); else tmp = 6.0 * (y * (0.6666666666666666 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.35e+42], N[Not[LessEqual[x, 2.8e+85]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+42} \lor \neg \left(x \leq 2.8 \cdot 10^{+85}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -1.35e42 or 2.7999999999999999e85 < x Initial program 99.4%
+-commutative99.4%
associate-*l*99.7%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 83.8%
*-lft-identity83.8%
*-commutative83.8%
+-commutative83.8%
*-commutative83.8%
fma-define83.8%
associate-*r*83.8%
fma-define83.8%
distribute-lft-in83.8%
neg-mul-183.8%
distribute-lft-neg-in83.8%
metadata-eval83.8%
metadata-eval83.8%
distribute-rgt-in83.8%
+-commutative83.8%
sub-neg83.8%
distribute-rgt-in83.8%
sub-neg83.8%
distribute-rgt-in83.8%
metadata-eval83.8%
distribute-lft-neg-in83.8%
associate-+r+83.8%
Simplified83.8%
if -1.35e42 < x < 2.7999999999999999e85Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
add-cube-cbrt99.5%
fma-define99.5%
pow299.5%
associate-*l*99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 74.4%
Final simplification78.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.9e-107) (not (<= y 4e-63))) (* 6.0 (* y (- 0.6666666666666666 z))) (* 6.0 (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.9e-107) || !(y <= 4e-63)) {
tmp = 6.0 * (y * (0.6666666666666666 - 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 ((y <= (-3.9d-107)) .or. (.not. (y <= 4d-63))) then
tmp = 6.0d0 * (y * (0.6666666666666666d0 - 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 ((y <= -3.9e-107) || !(y <= 4e-63)) {
tmp = 6.0 * (y * (0.6666666666666666 - z));
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.9e-107) or not (y <= 4e-63): tmp = 6.0 * (y * (0.6666666666666666 - z)) else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.9e-107) || !(y <= 4e-63)) tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -3.9e-107) || ~((y <= 4e-63))) tmp = 6.0 * (y * (0.6666666666666666 - z)); else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.9e-107], N[Not[LessEqual[y, 4e-63]], $MachinePrecision]], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{-107} \lor \neg \left(y \leq 4 \cdot 10^{-63}\right):\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if y < -3.9000000000000001e-107 or 4.00000000000000027e-63 < y Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
add-cube-cbrt99.5%
fma-define99.5%
pow299.5%
associate-*l*99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 70.0%
if -3.9000000000000001e-107 < y < 4.00000000000000027e-63Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 81.1%
*-lft-identity81.1%
*-commutative81.1%
+-commutative81.1%
*-commutative81.1%
fma-define81.1%
associate-*r*81.1%
fma-define81.1%
distribute-lft-in81.1%
neg-mul-181.1%
distribute-lft-neg-in81.1%
metadata-eval81.1%
metadata-eval81.1%
distribute-rgt-in81.1%
+-commutative81.1%
sub-neg81.1%
distribute-rgt-in81.1%
sub-neg81.1%
distribute-rgt-in81.2%
metadata-eval81.2%
distribute-lft-neg-in81.2%
associate-+r+81.2%
Simplified81.2%
Taylor expanded in z around inf 52.7%
*-commutative52.7%
Simplified52.7%
Final simplification64.1%
(FPCore (x y z) :precision binary64 (if (<= z -0.58) (* (- y x) (* z -6.0)) (if (<= z 0.65) (+ (* x -3.0) (* y 4.0)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.65) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.58d0)) then
tmp = (y - x) * (z * (-6.0d0))
else if (z <= 0.65d0) then
tmp = (x * (-3.0d0)) + (y * 4.0d0)
else
tmp = z * ((y - x) * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.65) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.58: tmp = (y - x) * (z * -6.0) elif z <= 0.65: tmp = (x * -3.0) + (y * 4.0) else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.58) tmp = Float64(Float64(y - x) * Float64(z * -6.0)); elseif (z <= 0.65) tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); else tmp = Float64(z * Float64(Float64(y - x) * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.58) tmp = (y - x) * (z * -6.0); elseif (z <= 0.65) tmp = (x * -3.0) + (y * 4.0); else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.58], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.65], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.57999999999999996Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
add-cube-cbrt99.6%
fma-define99.6%
pow299.6%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 94.4%
associate-*r*94.4%
metadata-eval94.4%
distribute-lft-neg-in94.4%
distribute-lft-neg-in94.4%
*-commutative94.4%
distribute-rgt-neg-in94.4%
distribute-lft-neg-in94.4%
metadata-eval94.4%
*-commutative94.4%
Simplified94.4%
if -0.57999999999999996 < z < 0.650000000000000022Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 99.1%
Taylor expanded in x around 0 99.1%
if 0.650000000000000022 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
add-cube-cbrt99.7%
fma-define99.7%
pow299.7%
associate-*l*99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 97.2%
associate-*r*97.2%
metadata-eval97.2%
distribute-lft-neg-in97.2%
distribute-lft-neg-in97.2%
*-commutative97.2%
distribute-rgt-neg-in97.2%
distribute-lft-neg-in97.2%
metadata-eval97.2%
*-commutative97.2%
Simplified97.2%
Taylor expanded in y around 0 95.7%
associate-*r*95.8%
associate-*r*95.8%
distribute-rgt-out97.1%
metadata-eval97.1%
associate-*r*97.1%
neg-mul-197.1%
distribute-lft-in97.3%
sub-neg97.3%
Simplified97.3%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (if (<= z -0.65) (* (- y x) (* z -6.0)) (if (<= z 0.66) (+ x (* (- y x) 4.0)) (* z (* (- y x) -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.65) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.66) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.65d0)) then
tmp = (y - x) * (z * (-6.0d0))
else if (z <= 0.66d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = z * ((y - x) * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.65) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.66) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = z * ((y - x) * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.65: tmp = (y - x) * (z * -6.0) elif z <= 0.66: tmp = x + ((y - x) * 4.0) else: tmp = z * ((y - x) * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.65) tmp = Float64(Float64(y - x) * Float64(z * -6.0)); elseif (z <= 0.66) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(z * Float64(Float64(y - x) * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.65) tmp = (y - x) * (z * -6.0); elseif (z <= 0.66) tmp = x + ((y - x) * 4.0); else tmp = z * ((y - x) * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.65], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.66], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.65:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.650000000000000022Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
add-cube-cbrt99.6%
fma-define99.6%
pow299.6%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 94.4%
associate-*r*94.4%
metadata-eval94.4%
distribute-lft-neg-in94.4%
distribute-lft-neg-in94.4%
*-commutative94.4%
distribute-rgt-neg-in94.4%
distribute-lft-neg-in94.4%
metadata-eval94.4%
*-commutative94.4%
Simplified94.4%
if -0.650000000000000022 < z < 0.660000000000000031Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 99.1%
if 0.660000000000000031 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
add-cube-cbrt99.7%
fma-define99.7%
pow299.7%
associate-*l*99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 97.2%
associate-*r*97.2%
metadata-eval97.2%
distribute-lft-neg-in97.2%
distribute-lft-neg-in97.2%
*-commutative97.2%
distribute-rgt-neg-in97.2%
distribute-lft-neg-in97.2%
metadata-eval97.2%
*-commutative97.2%
Simplified97.2%
Taylor expanded in y around 0 95.7%
associate-*r*95.8%
associate-*r*95.8%
distribute-rgt-out97.1%
metadata-eval97.1%
associate-*r*97.1%
neg-mul-197.1%
distribute-lft-in97.3%
sub-neg97.3%
Simplified97.3%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.42e-36) (not (<= x 1.85e+52))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.42e-36) || !(x <= 1.85e+52)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.42d-36)) .or. (.not. (x <= 1.85d+52))) then
tmp = x * (-3.0d0)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.42e-36) || !(x <= 1.85e+52)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.42e-36) or not (x <= 1.85e+52): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.42e-36) || !(x <= 1.85e+52)) tmp = Float64(x * -3.0); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.42e-36) || ~((x <= 1.85e+52))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.42e-36], N[Not[LessEqual[x, 1.85e+52]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.42 \cdot 10^{-36} \lor \neg \left(x \leq 1.85 \cdot 10^{+52}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -1.41999999999999996e-36 or 1.85e52 < x Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 75.9%
*-lft-identity75.9%
*-commutative75.9%
+-commutative75.9%
*-commutative75.9%
fma-define75.9%
associate-*r*75.9%
fma-define75.9%
distribute-lft-in75.9%
neg-mul-175.9%
distribute-lft-neg-in75.9%
metadata-eval75.9%
metadata-eval75.9%
distribute-rgt-in75.9%
+-commutative75.9%
sub-neg75.9%
distribute-rgt-in75.9%
sub-neg75.9%
distribute-rgt-in76.0%
metadata-eval76.0%
distribute-lft-neg-in76.0%
associate-+r+76.0%
Simplified76.0%
Taylor expanded in z around 0 41.4%
*-commutative41.4%
Simplified41.4%
if -1.41999999999999996e-36 < x < 1.85e52Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
add-cube-cbrt99.6%
fma-define99.6%
pow299.6%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 79.2%
Taylor expanded in z around 0 35.5%
*-commutative35.5%
Simplified35.5%
Final simplification38.6%
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- 0.6666666666666666 z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * (0.6666666666666666 - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * (0.6666666666666666d0 - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * (0.6666666666666666 - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * (0.6666666666666666 - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(0.6666666666666666 - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * (0.6666666666666666 - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
(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%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 48.9%
*-lft-identity48.9%
*-commutative48.9%
+-commutative48.9%
*-commutative48.9%
fma-define48.9%
associate-*r*48.9%
fma-define48.9%
distribute-lft-in48.9%
neg-mul-148.9%
distribute-lft-neg-in48.9%
metadata-eval48.9%
metadata-eval48.9%
distribute-rgt-in48.9%
+-commutative48.9%
sub-neg48.9%
distribute-rgt-in48.9%
sub-neg48.9%
distribute-rgt-in48.9%
metadata-eval48.9%
distribute-lft-neg-in48.9%
associate-+r+48.9%
Simplified48.9%
Taylor expanded in z around 0 24.7%
*-commutative24.7%
Simplified24.7%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 52.3%
Taylor expanded in x around inf 2.8%
herbie shell --seed 2024191
(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))))