
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (fma (- y x) (fma z -6.0 4.0) x))
double code(double x, double y, double z) {
return fma((y - x), fma(z, -6.0, 4.0), x);
}
function code(x, y, z) return fma(Float64(y - x), fma(z, -6.0, 4.0), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(z * -6.0 + 4.0), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, \mathsf{fma}\left(z, -6, 4\right), x\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (fma (- y x) (* 6.0 (- 0.6666666666666666 z)) x))
double code(double x, double y, double z) {
return fma((y - x), (6.0 * (0.6666666666666666 - z)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(6.0 * Float64(0.6666666666666666 - z)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 6 \cdot \left(0.6666666666666666 - z\right), x\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))) (t_1 (* -6.0 (* y z))))
(if (<= z -2.1e+158)
t_0
(if (<= z -0.6)
t_1
(if (<= z -4.2e-81)
(* x -3.0)
(if (<= z -5.6e-183)
(* y 4.0)
(if (<= z -4.2e-233)
(* x -3.0)
(if (<= z -2.7e-250)
(* y 4.0)
(if (<= z 9e-260)
(* x -3.0)
(if (<= z 1.2e-159)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (<= z 4.4e+279) t_0 t_1))))))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -2.1e+158) {
tmp = t_0;
} else if (z <= -0.6) {
tmp = t_1;
} else if (z <= -4.2e-81) {
tmp = x * -3.0;
} else if (z <= -5.6e-183) {
tmp = y * 4.0;
} else if (z <= -4.2e-233) {
tmp = x * -3.0;
} else if (z <= -2.7e-250) {
tmp = y * 4.0;
} else if (z <= 9e-260) {
tmp = x * -3.0;
} else if (z <= 1.2e-159) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 4.4e+279) {
tmp = t_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 * (x * z)
t_1 = (-6.0d0) * (y * z)
if (z <= (-2.1d+158)) then
tmp = t_0
else if (z <= (-0.6d0)) then
tmp = t_1
else if (z <= (-4.2d-81)) then
tmp = x * (-3.0d0)
else if (z <= (-5.6d-183)) then
tmp = y * 4.0d0
else if (z <= (-4.2d-233)) then
tmp = x * (-3.0d0)
else if (z <= (-2.7d-250)) then
tmp = y * 4.0d0
else if (z <= 9d-260) then
tmp = x * (-3.0d0)
else if (z <= 1.2d-159) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if (z <= 4.4d+279) then
tmp = t_0
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 * (x * z);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -2.1e+158) {
tmp = t_0;
} else if (z <= -0.6) {
tmp = t_1;
} else if (z <= -4.2e-81) {
tmp = x * -3.0;
} else if (z <= -5.6e-183) {
tmp = y * 4.0;
} else if (z <= -4.2e-233) {
tmp = x * -3.0;
} else if (z <= -2.7e-250) {
tmp = y * 4.0;
} else if (z <= 9e-260) {
tmp = x * -3.0;
} else if (z <= 1.2e-159) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 4.4e+279) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) t_1 = -6.0 * (y * z) tmp = 0 if z <= -2.1e+158: tmp = t_0 elif z <= -0.6: tmp = t_1 elif z <= -4.2e-81: tmp = x * -3.0 elif z <= -5.6e-183: tmp = y * 4.0 elif z <= -4.2e-233: tmp = x * -3.0 elif z <= -2.7e-250: tmp = y * 4.0 elif z <= 9e-260: tmp = x * -3.0 elif z <= 1.2e-159: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif z <= 4.4e+279: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) t_1 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -2.1e+158) tmp = t_0; elseif (z <= -0.6) tmp = t_1; elseif (z <= -4.2e-81) tmp = Float64(x * -3.0); elseif (z <= -5.6e-183) tmp = Float64(y * 4.0); elseif (z <= -4.2e-233) tmp = Float64(x * -3.0); elseif (z <= -2.7e-250) tmp = Float64(y * 4.0); elseif (z <= 9e-260) tmp = Float64(x * -3.0); elseif (z <= 1.2e-159) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif (z <= 4.4e+279) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); t_1 = -6.0 * (y * z); tmp = 0.0; if (z <= -2.1e+158) tmp = t_0; elseif (z <= -0.6) tmp = t_1; elseif (z <= -4.2e-81) tmp = x * -3.0; elseif (z <= -5.6e-183) tmp = y * 4.0; elseif (z <= -4.2e-233) tmp = x * -3.0; elseif (z <= -2.7e-250) tmp = y * 4.0; elseif (z <= 9e-260) tmp = x * -3.0; elseif (z <= 1.2e-159) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif (z <= 4.4e+279) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+158], t$95$0, If[LessEqual[z, -0.6], t$95$1, If[LessEqual[z, -4.2e-81], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -5.6e-183], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4.2e-233], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.7e-250], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 9e-260], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.2e-159], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.4e+279], t$95$0, t$95$1]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
t_1 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+158}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -0.6:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-81}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-183}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-233}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.7 \cdot 10^{-250}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-260}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-159}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+279}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.0999999999999999e158 or 0.5 < z < 4.3999999999999999e279Initial program 99.9%
Taylor expanded in z around 0 98.6%
Taylor expanded in x around inf 62.2%
Taylor expanded in z around inf 60.7%
if -2.0999999999999999e158 < z < -0.599999999999999978 or 4.3999999999999999e279 < z Initial program 99.8%
+-commutative99.8%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
neg-mul-199.9%
associate-*r*99.9%
*-commutative99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 64.6%
Taylor expanded in z around inf 63.7%
*-commutative63.7%
Simplified63.7%
if -0.599999999999999978 < z < -4.1999999999999998e-81 or -5.5999999999999997e-183 < z < -4.1999999999999997e-233 or -2.70000000000000002e-250 < z < 8.9999999999999995e-260 or 1.19999999999999999e-159 < z < 0.5Initial program 99.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 64.7%
Taylor expanded in z around 0 63.0%
*-commutative63.0%
Simplified63.0%
if -4.1999999999999998e-81 < z < -5.5999999999999997e-183 or -4.1999999999999997e-233 < z < -2.70000000000000002e-250 or 8.9999999999999995e-260 < z < 1.19999999999999999e-159Initial program 99.5%
+-commutative99.5%
associate-*l*100.0%
fma-def100.0%
sub-neg100.0%
+-commutative100.0%
distribute-lft-in100.0%
neg-mul-1100.0%
associate-*r*100.0%
*-commutative100.0%
fma-def100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 75.7%
Taylor expanded in z around 0 75.7%
*-commutative75.7%
Simplified75.7%
Final simplification65.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* x 6.0))) (t_1 (* -6.0 (* y z))))
(if (<= z -9e+157)
t_0
(if (<= z -0.26)
t_1
(if (<= z -4.2e-83)
(* x -3.0)
(if (<= z -4.1e-181)
(* y 4.0)
(if (<= z -5.5e-233)
(* x -3.0)
(if (<= z -1.35e-249)
(* y 4.0)
(if (<= z 5e-262)
(* x -3.0)
(if (<= z 4.2e-162)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (<= z 4.5e+280) t_0 t_1))))))))))))
double code(double x, double y, double z) {
double t_0 = z * (x * 6.0);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -9e+157) {
tmp = t_0;
} else if (z <= -0.26) {
tmp = t_1;
} else if (z <= -4.2e-83) {
tmp = x * -3.0;
} else if (z <= -4.1e-181) {
tmp = y * 4.0;
} else if (z <= -5.5e-233) {
tmp = x * -3.0;
} else if (z <= -1.35e-249) {
tmp = y * 4.0;
} else if (z <= 5e-262) {
tmp = x * -3.0;
} else if (z <= 4.2e-162) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 4.5e+280) {
tmp = t_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 = z * (x * 6.0d0)
t_1 = (-6.0d0) * (y * z)
if (z <= (-9d+157)) then
tmp = t_0
else if (z <= (-0.26d0)) then
tmp = t_1
else if (z <= (-4.2d-83)) then
tmp = x * (-3.0d0)
else if (z <= (-4.1d-181)) then
tmp = y * 4.0d0
else if (z <= (-5.5d-233)) then
tmp = x * (-3.0d0)
else if (z <= (-1.35d-249)) then
tmp = y * 4.0d0
else if (z <= 5d-262) then
tmp = x * (-3.0d0)
else if (z <= 4.2d-162) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if (z <= 4.5d+280) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (x * 6.0);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -9e+157) {
tmp = t_0;
} else if (z <= -0.26) {
tmp = t_1;
} else if (z <= -4.2e-83) {
tmp = x * -3.0;
} else if (z <= -4.1e-181) {
tmp = y * 4.0;
} else if (z <= -5.5e-233) {
tmp = x * -3.0;
} else if (z <= -1.35e-249) {
tmp = y * 4.0;
} else if (z <= 5e-262) {
tmp = x * -3.0;
} else if (z <= 4.2e-162) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 4.5e+280) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = z * (x * 6.0) t_1 = -6.0 * (y * z) tmp = 0 if z <= -9e+157: tmp = t_0 elif z <= -0.26: tmp = t_1 elif z <= -4.2e-83: tmp = x * -3.0 elif z <= -4.1e-181: tmp = y * 4.0 elif z <= -5.5e-233: tmp = x * -3.0 elif z <= -1.35e-249: tmp = y * 4.0 elif z <= 5e-262: tmp = x * -3.0 elif z <= 4.2e-162: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif z <= 4.5e+280: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(x * 6.0)) t_1 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -9e+157) tmp = t_0; elseif (z <= -0.26) tmp = t_1; elseif (z <= -4.2e-83) tmp = Float64(x * -3.0); elseif (z <= -4.1e-181) tmp = Float64(y * 4.0); elseif (z <= -5.5e-233) tmp = Float64(x * -3.0); elseif (z <= -1.35e-249) tmp = Float64(y * 4.0); elseif (z <= 5e-262) tmp = Float64(x * -3.0); elseif (z <= 4.2e-162) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif (z <= 4.5e+280) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (x * 6.0); t_1 = -6.0 * (y * z); tmp = 0.0; if (z <= -9e+157) tmp = t_0; elseif (z <= -0.26) tmp = t_1; elseif (z <= -4.2e-83) tmp = x * -3.0; elseif (z <= -4.1e-181) tmp = y * 4.0; elseif (z <= -5.5e-233) tmp = x * -3.0; elseif (z <= -1.35e-249) tmp = y * 4.0; elseif (z <= 5e-262) tmp = x * -3.0; elseif (z <= 4.2e-162) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif (z <= 4.5e+280) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9e+157], t$95$0, If[LessEqual[z, -0.26], t$95$1, If[LessEqual[z, -4.2e-83], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -4.1e-181], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -5.5e-233], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.35e-249], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5e-262], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.2e-162], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.5e+280], t$95$0, t$95$1]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(x \cdot 6\right)\\
t_1 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -9 \cdot 10^{+157}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -0.26:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-83}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{-181}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-233}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-249}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-262}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{-162}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+280}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.9999999999999997e157 or 0.5 < z < 4.5000000000000001e280Initial program 99.9%
Taylor expanded in z around 0 98.6%
Taylor expanded in x around inf 62.2%
Taylor expanded in z around inf 60.7%
*-commutative60.7%
associate-*l*60.8%
Simplified60.8%
if -8.9999999999999997e157 < z < -0.26000000000000001 or 4.5000000000000001e280 < z Initial program 99.8%
+-commutative99.8%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
neg-mul-199.9%
associate-*r*99.9%
*-commutative99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 64.6%
Taylor expanded in z around inf 63.7%
*-commutative63.7%
Simplified63.7%
if -0.26000000000000001 < z < -4.1999999999999998e-83 or -4.1000000000000001e-181 < z < -5.50000000000000005e-233 or -1.35e-249 < z < 4.99999999999999992e-262 or 4.2e-162 < z < 0.5Initial program 99.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 64.7%
Taylor expanded in z around 0 63.0%
*-commutative63.0%
Simplified63.0%
if -4.1999999999999998e-83 < z < -4.1000000000000001e-181 or -5.50000000000000005e-233 < z < -1.35e-249 or 4.99999999999999992e-262 < z < 4.2e-162Initial program 99.5%
+-commutative99.5%
associate-*l*100.0%
fma-def100.0%
sub-neg100.0%
+-commutative100.0%
distribute-lft-in100.0%
neg-mul-1100.0%
associate-*r*100.0%
*-commutative100.0%
fma-def100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 75.7%
Taylor expanded in z around 0 75.7%
*-commutative75.7%
Simplified75.7%
Final simplification65.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* x 6.0))))
(if (<= z -4.2e+159)
t_0
(if (<= z -0.215)
(* y (* z -6.0))
(if (<= z -3.4e-81)
(* x -3.0)
(if (<= z -1.65e-181)
(* y 4.0)
(if (<= z -3.8e-233)
(* x -3.0)
(if (<= z -1e-252)
(* y 4.0)
(if (<= z 1.25e-261)
(* x -3.0)
(if (<= z 2.1e-157)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (<= z 1.45e+280) t_0 (* -6.0 (* y z))))))))))))))
double code(double x, double y, double z) {
double t_0 = z * (x * 6.0);
double tmp;
if (z <= -4.2e+159) {
tmp = t_0;
} else if (z <= -0.215) {
tmp = y * (z * -6.0);
} else if (z <= -3.4e-81) {
tmp = x * -3.0;
} else if (z <= -1.65e-181) {
tmp = y * 4.0;
} else if (z <= -3.8e-233) {
tmp = x * -3.0;
} else if (z <= -1e-252) {
tmp = y * 4.0;
} else if (z <= 1.25e-261) {
tmp = x * -3.0;
} else if (z <= 2.1e-157) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 1.45e+280) {
tmp = t_0;
} else {
tmp = -6.0 * (y * 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 = z * (x * 6.0d0)
if (z <= (-4.2d+159)) then
tmp = t_0
else if (z <= (-0.215d0)) then
tmp = y * (z * (-6.0d0))
else if (z <= (-3.4d-81)) then
tmp = x * (-3.0d0)
else if (z <= (-1.65d-181)) then
tmp = y * 4.0d0
else if (z <= (-3.8d-233)) then
tmp = x * (-3.0d0)
else if (z <= (-1d-252)) then
tmp = y * 4.0d0
else if (z <= 1.25d-261) then
tmp = x * (-3.0d0)
else if (z <= 2.1d-157) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if (z <= 1.45d+280) then
tmp = t_0
else
tmp = (-6.0d0) * (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * (x * 6.0);
double tmp;
if (z <= -4.2e+159) {
tmp = t_0;
} else if (z <= -0.215) {
tmp = y * (z * -6.0);
} else if (z <= -3.4e-81) {
tmp = x * -3.0;
} else if (z <= -1.65e-181) {
tmp = y * 4.0;
} else if (z <= -3.8e-233) {
tmp = x * -3.0;
} else if (z <= -1e-252) {
tmp = y * 4.0;
} else if (z <= 1.25e-261) {
tmp = x * -3.0;
} else if (z <= 2.1e-157) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 1.45e+280) {
tmp = t_0;
} else {
tmp = -6.0 * (y * z);
}
return tmp;
}
def code(x, y, z): t_0 = z * (x * 6.0) tmp = 0 if z <= -4.2e+159: tmp = t_0 elif z <= -0.215: tmp = y * (z * -6.0) elif z <= -3.4e-81: tmp = x * -3.0 elif z <= -1.65e-181: tmp = y * 4.0 elif z <= -3.8e-233: tmp = x * -3.0 elif z <= -1e-252: tmp = y * 4.0 elif z <= 1.25e-261: tmp = x * -3.0 elif z <= 2.1e-157: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif z <= 1.45e+280: tmp = t_0 else: tmp = -6.0 * (y * z) return tmp
function code(x, y, z) t_0 = Float64(z * Float64(x * 6.0)) tmp = 0.0 if (z <= -4.2e+159) tmp = t_0; elseif (z <= -0.215) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= -3.4e-81) tmp = Float64(x * -3.0); elseif (z <= -1.65e-181) tmp = Float64(y * 4.0); elseif (z <= -3.8e-233) tmp = Float64(x * -3.0); elseif (z <= -1e-252) tmp = Float64(y * 4.0); elseif (z <= 1.25e-261) tmp = Float64(x * -3.0); elseif (z <= 2.1e-157) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif (z <= 1.45e+280) tmp = t_0; else tmp = Float64(-6.0 * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (x * 6.0); tmp = 0.0; if (z <= -4.2e+159) tmp = t_0; elseif (z <= -0.215) tmp = y * (z * -6.0); elseif (z <= -3.4e-81) tmp = x * -3.0; elseif (z <= -1.65e-181) tmp = y * 4.0; elseif (z <= -3.8e-233) tmp = x * -3.0; elseif (z <= -1e-252) tmp = y * 4.0; elseif (z <= 1.25e-261) tmp = x * -3.0; elseif (z <= 2.1e-157) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif (z <= 1.45e+280) tmp = t_0; else tmp = -6.0 * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+159], t$95$0, If[LessEqual[z, -0.215], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.4e-81], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.65e-181], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -3.8e-233], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1e-252], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.25e-261], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.1e-157], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.45e+280], t$95$0, N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(x \cdot 6\right)\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{+159}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -0.215:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-81}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-181}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-233}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1 \cdot 10^{-252}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-261}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-157}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+280}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if z < -4.19999999999999978e159 or 0.5 < z < 1.44999999999999993e280Initial program 99.9%
Taylor expanded in z around 0 98.6%
Taylor expanded in x around inf 62.2%
Taylor expanded in z around inf 60.7%
*-commutative60.7%
associate-*l*60.8%
Simplified60.8%
if -4.19999999999999978e159 < z < -0.214999999999999997Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 58.7%
Taylor expanded in z around inf 57.7%
if -0.214999999999999997 < z < -3.3999999999999999e-81 or -1.65000000000000004e-181 < z < -3.8e-233 or -9.99999999999999943e-253 < z < 1.24999999999999995e-261 or 2.1e-157 < z < 0.5Initial program 99.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 64.7%
Taylor expanded in z around 0 63.0%
*-commutative63.0%
Simplified63.0%
if -3.3999999999999999e-81 < z < -1.65000000000000004e-181 or -3.8e-233 < z < -9.99999999999999943e-253 or 1.24999999999999995e-261 < z < 2.1e-157Initial program 99.5%
+-commutative99.5%
associate-*l*100.0%
fma-def100.0%
sub-neg100.0%
+-commutative100.0%
distribute-lft-in100.0%
neg-mul-1100.0%
associate-*r*100.0%
*-commutative100.0%
fma-def100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 75.7%
Taylor expanded in z around 0 75.7%
*-commutative75.7%
Simplified75.7%
if 1.44999999999999993e280 < z Initial program 100.0%
+-commutative100.0%
associate-*l*100.0%
fma-def100.0%
sub-neg100.0%
+-commutative100.0%
distribute-lft-in100.0%
neg-mul-1100.0%
associate-*r*100.0%
*-commutative100.0%
fma-def100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 100.0%
Taylor expanded in z around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification65.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -0.002)
t_0
(if (<= z -1.1e-82)
(* x -3.0)
(if (<= z -8.6e-182)
(* y 4.0)
(if (<= z -4.8e-233)
(* x -3.0)
(if (<= z -2.8e-253)
(* y 4.0)
(if (<= z 1.3e-262)
(* x -3.0)
(if (<= z 3.9e-161)
(* 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 - x) * z);
double tmp;
if (z <= -0.002) {
tmp = t_0;
} else if (z <= -1.1e-82) {
tmp = x * -3.0;
} else if (z <= -8.6e-182) {
tmp = y * 4.0;
} else if (z <= -4.8e-233) {
tmp = x * -3.0;
} else if (z <= -2.8e-253) {
tmp = y * 4.0;
} else if (z <= 1.3e-262) {
tmp = x * -3.0;
} else if (z <= 3.9e-161) {
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 - x) * z)
if (z <= (-0.002d0)) then
tmp = t_0
else if (z <= (-1.1d-82)) then
tmp = x * (-3.0d0)
else if (z <= (-8.6d-182)) then
tmp = y * 4.0d0
else if (z <= (-4.8d-233)) then
tmp = x * (-3.0d0)
else if (z <= (-2.8d-253)) then
tmp = y * 4.0d0
else if (z <= 1.3d-262) then
tmp = x * (-3.0d0)
else if (z <= 3.9d-161) 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 - x) * z);
double tmp;
if (z <= -0.002) {
tmp = t_0;
} else if (z <= -1.1e-82) {
tmp = x * -3.0;
} else if (z <= -8.6e-182) {
tmp = y * 4.0;
} else if (z <= -4.8e-233) {
tmp = x * -3.0;
} else if (z <= -2.8e-253) {
tmp = y * 4.0;
} else if (z <= 1.3e-262) {
tmp = x * -3.0;
} else if (z <= 3.9e-161) {
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 - x) * z) tmp = 0 if z <= -0.002: tmp = t_0 elif z <= -1.1e-82: tmp = x * -3.0 elif z <= -8.6e-182: tmp = y * 4.0 elif z <= -4.8e-233: tmp = x * -3.0 elif z <= -2.8e-253: tmp = y * 4.0 elif z <= 1.3e-262: tmp = x * -3.0 elif z <= 3.9e-161: 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(Float64(y - x) * z)) tmp = 0.0 if (z <= -0.002) tmp = t_0; elseif (z <= -1.1e-82) tmp = Float64(x * -3.0); elseif (z <= -8.6e-182) tmp = Float64(y * 4.0); elseif (z <= -4.8e-233) tmp = Float64(x * -3.0); elseif (z <= -2.8e-253) tmp = Float64(y * 4.0); elseif (z <= 1.3e-262) tmp = Float64(x * -3.0); elseif (z <= 3.9e-161) 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 - x) * z); tmp = 0.0; if (z <= -0.002) tmp = t_0; elseif (z <= -1.1e-82) tmp = x * -3.0; elseif (z <= -8.6e-182) tmp = y * 4.0; elseif (z <= -4.8e-233) tmp = x * -3.0; elseif (z <= -2.8e-253) tmp = y * 4.0; elseif (z <= 1.3e-262) tmp = x * -3.0; elseif (z <= 3.9e-161) 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[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.002], t$95$0, If[LessEqual[z, -1.1e-82], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -8.6e-182], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4.8e-233], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2.8e-253], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.3e-262], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.9e-161], 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(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -0.002:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-82}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -8.6 \cdot 10^{-182}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-233}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{-253}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-262}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-161}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -2e-3 or 0.5 < z Initial program 99.9%
associate-*r*99.7%
metadata-eval99.7%
+-commutative99.7%
flip-+27.7%
pow227.7%
metadata-eval27.7%
associate-*r*27.6%
fma-neg27.6%
metadata-eval27.6%
Applied egg-rr27.6%
Taylor expanded in z around inf 98.2%
sub-neg98.2%
*-commutative98.2%
associate-+r+98.2%
associate-*r*98.1%
*-commutative98.1%
distribute-rgt-out99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.5%
if -2e-3 < z < -1.09999999999999993e-82 or -8.6e-182 < z < -4.7999999999999998e-233 or -2.80000000000000006e-253 < z < 1.2999999999999999e-262 or 3.89999999999999973e-161 < z < 0.5Initial program 99.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 64.7%
Taylor expanded in z around 0 63.0%
*-commutative63.0%
Simplified63.0%
if -1.09999999999999993e-82 < z < -8.6e-182 or -4.7999999999999998e-233 < z < -2.80000000000000006e-253 or 1.2999999999999999e-262 < z < 3.89999999999999973e-161Initial program 99.5%
+-commutative99.5%
associate-*l*100.0%
fma-def100.0%
sub-neg100.0%
+-commutative100.0%
distribute-lft-in100.0%
neg-mul-1100.0%
associate-*r*100.0%
*-commutative100.0%
fma-def100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 75.7%
Taylor expanded in z around 0 75.7%
*-commutative75.7%
Simplified75.7%
Final simplification82.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.88)
t_0
(if (<= z -4.7e-81)
(* x -3.0)
(if (<= z -1.3e-181)
(* y 4.0)
(if (<= z -5.8e-233)
(* x -3.0)
(if (<= z -9.6e-254)
(* y 4.0)
(if (<= z 6e-260)
(* x -3.0)
(if (<= z 1.7e-157)
(* y 4.0)
(if (<= z 0.54) (* x -3.0) t_0))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.88) {
tmp = t_0;
} else if (z <= -4.7e-81) {
tmp = x * -3.0;
} else if (z <= -1.3e-181) {
tmp = y * 4.0;
} else if (z <= -5.8e-233) {
tmp = x * -3.0;
} else if (z <= -9.6e-254) {
tmp = y * 4.0;
} else if (z <= 6e-260) {
tmp = x * -3.0;
} else if (z <= 1.7e-157) {
tmp = y * 4.0;
} else if (z <= 0.54) {
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 <= (-0.88d0)) then
tmp = t_0
else if (z <= (-4.7d-81)) then
tmp = x * (-3.0d0)
else if (z <= (-1.3d-181)) then
tmp = y * 4.0d0
else if (z <= (-5.8d-233)) then
tmp = x * (-3.0d0)
else if (z <= (-9.6d-254)) then
tmp = y * 4.0d0
else if (z <= 6d-260) then
tmp = x * (-3.0d0)
else if (z <= 1.7d-157) then
tmp = y * 4.0d0
else if (z <= 0.54d0) 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 <= -0.88) {
tmp = t_0;
} else if (z <= -4.7e-81) {
tmp = x * -3.0;
} else if (z <= -1.3e-181) {
tmp = y * 4.0;
} else if (z <= -5.8e-233) {
tmp = x * -3.0;
} else if (z <= -9.6e-254) {
tmp = y * 4.0;
} else if (z <= 6e-260) {
tmp = x * -3.0;
} else if (z <= 1.7e-157) {
tmp = y * 4.0;
} else if (z <= 0.54) {
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 <= -0.88: tmp = t_0 elif z <= -4.7e-81: tmp = x * -3.0 elif z <= -1.3e-181: tmp = y * 4.0 elif z <= -5.8e-233: tmp = x * -3.0 elif z <= -9.6e-254: tmp = y * 4.0 elif z <= 6e-260: tmp = x * -3.0 elif z <= 1.7e-157: tmp = y * 4.0 elif z <= 0.54: 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 <= -0.88) tmp = t_0; elseif (z <= -4.7e-81) tmp = Float64(x * -3.0); elseif (z <= -1.3e-181) tmp = Float64(y * 4.0); elseif (z <= -5.8e-233) tmp = Float64(x * -3.0); elseif (z <= -9.6e-254) tmp = Float64(y * 4.0); elseif (z <= 6e-260) tmp = Float64(x * -3.0); elseif (z <= 1.7e-157) tmp = Float64(y * 4.0); elseif (z <= 0.54) 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 <= -0.88) tmp = t_0; elseif (z <= -4.7e-81) tmp = x * -3.0; elseif (z <= -1.3e-181) tmp = y * 4.0; elseif (z <= -5.8e-233) tmp = x * -3.0; elseif (z <= -9.6e-254) tmp = y * 4.0; elseif (z <= 6e-260) tmp = x * -3.0; elseif (z <= 1.7e-157) tmp = y * 4.0; elseif (z <= 0.54) 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, -0.88], t$95$0, If[LessEqual[z, -4.7e-81], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.3e-181], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -5.8e-233], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -9.6e-254], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6e-260], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.7e-157], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.54], 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 -0.88:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.7 \cdot 10^{-81}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-181}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-233}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -9.6 \cdot 10^{-254}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-260}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-157}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.54:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -0.880000000000000004 or 0.54000000000000004 < z Initial program 99.9%
+-commutative99.9%
associate-*l*99.7%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 46.9%
Taylor expanded in z around inf 45.0%
*-commutative45.0%
Simplified45.0%
if -0.880000000000000004 < z < -4.70000000000000029e-81 or -1.29999999999999999e-181 < z < -5.79999999999999964e-233 or -9.60000000000000007e-254 < z < 6.0000000000000001e-260 or 1.69999999999999989e-157 < z < 0.54000000000000004Initial program 99.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 64.7%
Taylor expanded in z around 0 63.0%
*-commutative63.0%
Simplified63.0%
if -4.70000000000000029e-81 < z < -1.29999999999999999e-181 or -5.79999999999999964e-233 < z < -9.60000000000000007e-254 or 6.0000000000000001e-260 < z < 1.69999999999999989e-157Initial program 99.5%
+-commutative99.5%
associate-*l*100.0%
fma-def100.0%
sub-neg100.0%
+-commutative100.0%
distribute-lft-in100.0%
neg-mul-1100.0%
associate-*r*100.0%
*-commutative100.0%
fma-def100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 75.7%
Taylor expanded in z around 0 75.7%
*-commutative75.7%
Simplified75.7%
Final simplification57.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))))
(if (<= z -6200000000.0)
t_0
(if (<= z -7.5e-181)
(* y (+ 4.0 (* z -6.0)))
(if (<= z -3.8e-233)
(* x -3.0)
(if (<= z -5e-253)
(* y 4.0)
(if (<= z 1.2e-261)
(* x -3.0)
(if (<= z 1.4e-152)
(* 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 - x) * z);
double tmp;
if (z <= -6200000000.0) {
tmp = t_0;
} else if (z <= -7.5e-181) {
tmp = y * (4.0 + (z * -6.0));
} else if (z <= -3.8e-233) {
tmp = x * -3.0;
} else if (z <= -5e-253) {
tmp = y * 4.0;
} else if (z <= 1.2e-261) {
tmp = x * -3.0;
} else if (z <= 1.4e-152) {
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 - x) * z)
if (z <= (-6200000000.0d0)) then
tmp = t_0
else if (z <= (-7.5d-181)) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else if (z <= (-3.8d-233)) then
tmp = x * (-3.0d0)
else if (z <= (-5d-253)) then
tmp = y * 4.0d0
else if (z <= 1.2d-261) then
tmp = x * (-3.0d0)
else if (z <= 1.4d-152) 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 - x) * z);
double tmp;
if (z <= -6200000000.0) {
tmp = t_0;
} else if (z <= -7.5e-181) {
tmp = y * (4.0 + (z * -6.0));
} else if (z <= -3.8e-233) {
tmp = x * -3.0;
} else if (z <= -5e-253) {
tmp = y * 4.0;
} else if (z <= 1.2e-261) {
tmp = x * -3.0;
} else if (z <= 1.4e-152) {
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 - x) * z) tmp = 0 if z <= -6200000000.0: tmp = t_0 elif z <= -7.5e-181: tmp = y * (4.0 + (z * -6.0)) elif z <= -3.8e-233: tmp = x * -3.0 elif z <= -5e-253: tmp = y * 4.0 elif z <= 1.2e-261: tmp = x * -3.0 elif z <= 1.4e-152: 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(Float64(y - x) * z)) tmp = 0.0 if (z <= -6200000000.0) tmp = t_0; elseif (z <= -7.5e-181) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); elseif (z <= -3.8e-233) tmp = Float64(x * -3.0); elseif (z <= -5e-253) tmp = Float64(y * 4.0); elseif (z <= 1.2e-261) tmp = Float64(x * -3.0); elseif (z <= 1.4e-152) 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 - x) * z); tmp = 0.0; if (z <= -6200000000.0) tmp = t_0; elseif (z <= -7.5e-181) tmp = y * (4.0 + (z * -6.0)); elseif (z <= -3.8e-233) tmp = x * -3.0; elseif (z <= -5e-253) tmp = y * 4.0; elseif (z <= 1.2e-261) tmp = x * -3.0; elseif (z <= 1.4e-152) 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[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6200000000.0], t$95$0, If[LessEqual[z, -7.5e-181], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.8e-233], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -5e-253], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 1.2e-261], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.4e-152], 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(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -6200000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-181}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-233}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-253}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-261}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-152}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -6.2e9 or 0.5 < z Initial program 99.9%
associate-*r*99.8%
metadata-eval99.8%
+-commutative99.8%
flip-+27.1%
pow227.1%
metadata-eval27.1%
associate-*r*27.0%
fma-neg27.0%
metadata-eval27.0%
Applied egg-rr27.0%
Taylor expanded in z around inf 98.2%
sub-neg98.2%
*-commutative98.2%
associate-+r+98.2%
associate-*r*98.1%
*-commutative98.1%
distribute-rgt-out99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.7%
if -6.2e9 < z < -7.5000000000000002e-181Initial program 99.3%
+-commutative99.3%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 58.7%
if -7.5000000000000002e-181 < z < -3.8e-233 or -4.99999999999999971e-253 < z < 1.20000000000000007e-261 or 1.39999999999999992e-152 < z < 0.5Initial program 99.3%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 64.2%
Taylor expanded in z around 0 62.3%
*-commutative62.3%
Simplified62.3%
if -3.8e-233 < z < -4.99999999999999971e-253 or 1.20000000000000007e-261 < z < 1.39999999999999992e-152Initial program 99.8%
+-commutative99.8%
associate-*l*100.0%
fma-def100.0%
sub-neg100.0%
+-commutative100.0%
distribute-lft-in100.0%
neg-mul-1100.0%
associate-*r*100.0%
*-commutative100.0%
fma-def100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 83.4%
Taylor expanded in z around 0 83.4%
*-commutative83.4%
Simplified83.4%
Final simplification80.5%
(FPCore (x y z) :precision binary64 (if (<= z -0.66) (+ x (* (- y x) (* z -6.0))) (if (<= z 0.54) (+ (* x -3.0) (* y 4.0)) (+ x (* z (* 6.0 (- x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.54) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = x + (z * (6.0 * (x - y)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.66d0)) then
tmp = x + ((y - x) * (z * (-6.0d0)))
else if (z <= 0.54d0) then
tmp = (x * (-3.0d0)) + (y * 4.0d0)
else
tmp = x + (z * (6.0d0 * (x - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.54) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = x + (z * (6.0 * (x - y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = x + ((y - x) * (z * -6.0)) elif z <= 0.54: tmp = (x * -3.0) + (y * 4.0) else: tmp = x + (z * (6.0 * (x - y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(x + Float64(Float64(y - x) * Float64(z * -6.0))); elseif (z <= 0.54) tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); else tmp = Float64(x + Float64(z * Float64(6.0 * Float64(x - y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = x + ((y - x) * (z * -6.0)); elseif (z <= 0.54) tmp = (x * -3.0) + (y * 4.0); else tmp = x + (z * (6.0 * (x - y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.54], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;x + \left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.54:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(6 \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.9%
Taylor expanded in z around inf 99.3%
associate-*r*99.3%
*-commutative99.3%
Simplified99.3%
if -0.660000000000000031 < z < 0.54000000000000004Initial program 99.4%
Taylor expanded in z around 0 98.5%
Taylor expanded in x around 0 98.5%
if 0.54000000000000004 < z Initial program 99.9%
Taylor expanded in z around inf 96.0%
neg-mul-196.0%
Simplified96.0%
Final simplification98.0%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.85e+39) (not (<= y 1.2e-18))) (* y (+ 4.0 (* z -6.0))) (* x (- (* z 6.0) 3.0))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.85e+39) || !(y <= 1.2e-18)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * ((z * 6.0) - 3.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.85d+39)) .or. (.not. (y <= 1.2d-18))) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else
tmp = x * ((z * 6.0d0) - 3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.85e+39) || !(y <= 1.2e-18)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * ((z * 6.0) - 3.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.85e+39) or not (y <= 1.2e-18): tmp = y * (4.0 + (z * -6.0)) else: tmp = x * ((z * 6.0) - 3.0) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.85e+39) || !(y <= 1.2e-18)) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); else tmp = Float64(x * Float64(Float64(z * 6.0) - 3.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.85e+39) || ~((y <= 1.2e-18))) tmp = y * (4.0 + (z * -6.0)); else tmp = x * ((z * 6.0) - 3.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.85e+39], N[Not[LessEqual[y, 1.2e-18]], $MachinePrecision]], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(z * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{+39} \lor \neg \left(y \leq 1.2 \cdot 10^{-18}\right):\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6 - 3\right)\\
\end{array}
\end{array}
if y < -1.85000000000000006e39 or 1.19999999999999997e-18 < y Initial program 99.6%
+-commutative99.6%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
neg-mul-199.9%
associate-*r*99.9%
*-commutative99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 76.5%
if -1.85000000000000006e39 < y < 1.19999999999999997e-18Initial program 99.6%
Taylor expanded in z around 0 99.0%
Taylor expanded in x around inf 79.4%
Final simplification77.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.58) (not (<= z 0.6))) (* -6.0 (* (- y x) z)) (+ (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.6)) {
tmp = -6.0 * ((y - x) * z);
} else {
tmp = (x * -3.0) + (y * 4.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-0.58d0)) .or. (.not. (z <= 0.6d0))) then
tmp = (-6.0d0) * ((y - x) * z)
else
tmp = (x * (-3.0d0)) + (y * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.6)) {
tmp = -6.0 * ((y - x) * z);
} else {
tmp = (x * -3.0) + (y * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.58) or not (z <= 0.6): tmp = -6.0 * ((y - x) * z) else: tmp = (x * -3.0) + (y * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.58) || !(z <= 0.6)) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); else tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.58) || ~((z <= 0.6))) tmp = -6.0 * ((y - x) * z); else tmp = (x * -3.0) + (y * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.58], N[Not[LessEqual[z, 0.6]], $MachinePrecision]], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58 \lor \neg \left(z \leq 0.6\right):\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\end{array}
\end{array}
if z < -0.57999999999999996 or 0.599999999999999978 < z Initial program 99.9%
associate-*r*99.7%
metadata-eval99.7%
+-commutative99.7%
flip-+27.7%
pow227.7%
metadata-eval27.7%
associate-*r*27.6%
fma-neg27.6%
metadata-eval27.6%
Applied egg-rr27.6%
Taylor expanded in z around inf 98.2%
sub-neg98.2%
*-commutative98.2%
associate-+r+98.2%
associate-*r*98.1%
*-commutative98.1%
distribute-rgt-out99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.5%
if -0.57999999999999996 < z < 0.599999999999999978Initial program 99.4%
Taylor expanded in z around 0 98.5%
Taylor expanded in x around 0 98.5%
Final simplification98.0%
(FPCore (x y z) :precision binary64 (if (<= z -0.66) (+ x (* (- y x) (* z -6.0))) (if (<= z 0.6) (+ (* x -3.0) (* y 4.0)) (* -6.0 (* (- y x) z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.6) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = -6.0 * ((y - x) * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.66d0)) then
tmp = x + ((y - x) * (z * (-6.0d0)))
else if (z <= 0.6d0) then
tmp = (x * (-3.0d0)) + (y * 4.0d0)
else
tmp = (-6.0d0) * ((y - x) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.6) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = -6.0 * ((y - x) * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = x + ((y - x) * (z * -6.0)) elif z <= 0.6: tmp = (x * -3.0) + (y * 4.0) else: tmp = -6.0 * ((y - x) * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(x + Float64(Float64(y - x) * Float64(z * -6.0))); elseif (z <= 0.6) tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); else tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = x + ((y - x) * (z * -6.0)); elseif (z <= 0.6) tmp = (x * -3.0) + (y * 4.0); else tmp = -6.0 * ((y - x) * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.6], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;x + \left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.9%
Taylor expanded in z around inf 99.3%
associate-*r*99.3%
*-commutative99.3%
Simplified99.3%
if -0.660000000000000031 < z < 0.599999999999999978Initial program 99.4%
Taylor expanded in z around 0 98.5%
Taylor expanded in x around 0 98.5%
if 0.599999999999999978 < z Initial program 99.9%
associate-*r*99.6%
metadata-eval99.6%
+-commutative99.6%
flip-+32.5%
pow232.5%
metadata-eval32.5%
associate-*r*32.4%
fma-neg32.5%
metadata-eval32.5%
Applied egg-rr32.5%
Taylor expanded in z around inf 96.7%
sub-neg96.7%
*-commutative96.7%
associate-+r+96.7%
associate-*r*96.6%
*-commutative96.6%
distribute-rgt-out99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 95.9%
Final simplification98.0%
(FPCore (x y z) :precision binary64 (+ x (* 6.0 (* (- x y) (- z 0.6666666666666666)))))
double code(double x, double y, double z) {
return x + (6.0 * ((x - y) * (z - 0.6666666666666666)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (6.0d0 * ((x - y) * (z - 0.6666666666666666d0)))
end function
public static double code(double x, double y, double z) {
return x + (6.0 * ((x - y) * (z - 0.6666666666666666)));
}
def code(x, y, z): return x + (6.0 * ((x - y) * (z - 0.6666666666666666)))
function code(x, y, z) return Float64(x + Float64(6.0 * Float64(Float64(x - y) * Float64(z - 0.6666666666666666)))) end
function tmp = code(x, y, z) tmp = x + (6.0 * ((x - y) * (z - 0.6666666666666666))); end
code[x_, y_, z_] := N[(x + N[(6.0 * N[(N[(x - y), $MachinePrecision] * N[(z - 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + 6 \cdot \left(\left(x - y\right) \cdot \left(z - 0.6666666666666666\right)\right)
\end{array}
Initial program 99.6%
Taylor expanded in z around 0 99.6%
neg-mul-199.6%
+-commutative99.6%
sub-neg99.6%
Simplified99.6%
Taylor expanded in z around 0 99.4%
associate-*r*99.4%
distribute-rgt-out99.8%
metadata-eval99.8%
metadata-eval99.8%
associate-*r*99.8%
neg-mul-199.8%
distribute-lft-in99.8%
sub-neg99.8%
*-commutative99.8%
associate-*l*99.5%
Simplified99.5%
Final simplification99.5%
(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%
Taylor expanded in z around 0 99.6%
neg-mul-199.6%
+-commutative99.6%
sub-neg99.6%
Simplified99.6%
Final simplification99.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(y - x) * Float64(6.0 * Float64(0.6666666666666666 - z)))) end
function tmp = code(x, y, z) tmp = x + ((y - x) * (6.0 * (0.6666666666666666 - z))); end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)
\end{array}
Initial program 99.6%
associate-*l*99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (if (<= x -2.5e+85) (* x -3.0) (if (<= x 1.15e-32) (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if (x <= -2.5e+85) {
tmp = x * -3.0;
} else if (x <= 1.15e-32) {
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 <= (-2.5d+85)) then
tmp = x * (-3.0d0)
else if (x <= 1.15d-32) 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 <= -2.5e+85) {
tmp = x * -3.0;
} else if (x <= 1.15e-32) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -2.5e+85: tmp = x * -3.0 elif x <= 1.15e-32: tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if (x <= -2.5e+85) tmp = Float64(x * -3.0); elseif (x <= 1.15e-32) 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 <= -2.5e+85) tmp = x * -3.0; elseif (x <= 1.15e-32) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -2.5e+85], N[(x * -3.0), $MachinePrecision], If[LessEqual[x, 1.15e-32], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+85}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-32}:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if x < -2.5e85 or 1.15e-32 < x Initial program 99.7%
Taylor expanded in z around 0 99.1%
Taylor expanded in x around inf 76.3%
Taylor expanded in z around 0 38.7%
*-commutative38.7%
Simplified38.7%
if -2.5e85 < x < 1.15e-32Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
neg-mul-199.8%
associate-*r*99.8%
*-commutative99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 74.2%
Taylor expanded in z around 0 43.3%
*-commutative43.3%
Simplified43.3%
Final simplification41.0%
(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%
Taylor expanded in z around 0 99.4%
Taylor expanded in x around inf 51.5%
Taylor expanded in z around 0 26.2%
*-commutative26.2%
Simplified26.2%
Final simplification26.2%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.6%
Taylor expanded in y around inf 48.6%
Taylor expanded in x around inf 2.7%
Final simplification2.7%
herbie shell --seed 2023230
(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))))