
(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 15 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) (* 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 (* y z))) (t_1 (+ x (* y 4.0))))
(if (<= z -5e+51)
(* y (* z -6.0))
(if (<= z -4500.0)
(* z (* x 6.0))
(if (<= z -7.5)
t_0
(if (<= z -4.5e-295)
(* x -3.0)
(if (<= z 4.6e-101)
t_1
(if (<= z 8e-72)
(* x -3.0)
(if (<= z 1.05)
t_1
(if (<= z 6.5e+85) t_0 (* 6.0 (* x z))))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double t_1 = x + (y * 4.0);
double tmp;
if (z <= -5e+51) {
tmp = y * (z * -6.0);
} else if (z <= -4500.0) {
tmp = z * (x * 6.0);
} else if (z <= -7.5) {
tmp = t_0;
} else if (z <= -4.5e-295) {
tmp = x * -3.0;
} else if (z <= 4.6e-101) {
tmp = t_1;
} else if (z <= 8e-72) {
tmp = x * -3.0;
} else if (z <= 1.05) {
tmp = t_1;
} else if (z <= 6.5e+85) {
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) :: t_1
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
t_1 = x + (y * 4.0d0)
if (z <= (-5d+51)) then
tmp = y * (z * (-6.0d0))
else if (z <= (-4500.0d0)) then
tmp = z * (x * 6.0d0)
else if (z <= (-7.5d0)) then
tmp = t_0
else if (z <= (-4.5d-295)) then
tmp = x * (-3.0d0)
else if (z <= 4.6d-101) then
tmp = t_1
else if (z <= 8d-72) then
tmp = x * (-3.0d0)
else if (z <= 1.05d0) then
tmp = t_1
else if (z <= 6.5d+85) 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 t_1 = x + (y * 4.0);
double tmp;
if (z <= -5e+51) {
tmp = y * (z * -6.0);
} else if (z <= -4500.0) {
tmp = z * (x * 6.0);
} else if (z <= -7.5) {
tmp = t_0;
} else if (z <= -4.5e-295) {
tmp = x * -3.0;
} else if (z <= 4.6e-101) {
tmp = t_1;
} else if (z <= 8e-72) {
tmp = x * -3.0;
} else if (z <= 1.05) {
tmp = t_1;
} else if (z <= 6.5e+85) {
tmp = t_0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) t_1 = x + (y * 4.0) tmp = 0 if z <= -5e+51: tmp = y * (z * -6.0) elif z <= -4500.0: tmp = z * (x * 6.0) elif z <= -7.5: tmp = t_0 elif z <= -4.5e-295: tmp = x * -3.0 elif z <= 4.6e-101: tmp = t_1 elif z <= 8e-72: tmp = x * -3.0 elif z <= 1.05: tmp = t_1 elif z <= 6.5e+85: tmp = t_0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) t_1 = Float64(x + Float64(y * 4.0)) tmp = 0.0 if (z <= -5e+51) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= -4500.0) tmp = Float64(z * Float64(x * 6.0)); elseif (z <= -7.5) tmp = t_0; elseif (z <= -4.5e-295) tmp = Float64(x * -3.0); elseif (z <= 4.6e-101) tmp = t_1; elseif (z <= 8e-72) tmp = Float64(x * -3.0); elseif (z <= 1.05) tmp = t_1; elseif (z <= 6.5e+85) 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); t_1 = x + (y * 4.0); tmp = 0.0; if (z <= -5e+51) tmp = y * (z * -6.0); elseif (z <= -4500.0) tmp = z * (x * 6.0); elseif (z <= -7.5) tmp = t_0; elseif (z <= -4.5e-295) tmp = x * -3.0; elseif (z <= 4.6e-101) tmp = t_1; elseif (z <= 8e-72) tmp = x * -3.0; elseif (z <= 1.05) tmp = t_1; elseif (z <= 6.5e+85) 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]}, Block[{t$95$1 = N[(x + N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+51], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4500.0], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -7.5], t$95$0, If[LessEqual[z, -4.5e-295], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.6e-101], t$95$1, If[LessEqual[z, 8e-72], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.05], t$95$1, If[LessEqual[z, 6.5e+85], 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)\\
t_1 := x + y \cdot 4\\
\mathbf{if}\;z \leq -5 \cdot 10^{+51}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -4500:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq -7.5:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-295}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-72}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.05:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+85}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -5e51Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
associate-*l*99.7%
*-commutative99.7%
associate-*r*99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 59.2%
*-commutative59.2%
associate-*r*61.1%
*-commutative61.1%
Simplified61.1%
if -5e51 < z < -4500Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 82.3%
*-commutative82.3%
+-commutative82.3%
sub-neg82.3%
distribute-rgt-in82.0%
metadata-eval82.0%
metadata-eval82.0%
neg-mul-182.0%
associate-*r*82.0%
*-commutative82.0%
distribute-lft-in82.0%
+-commutative82.0%
distribute-lft-in82.0%
associate-+r+82.0%
metadata-eval82.0%
metadata-eval82.0%
metadata-eval82.0%
distribute-lft-in82.0%
+-commutative82.0%
distribute-rgt-in82.0%
*-commutative82.0%
associate-*l*82.0%
metadata-eval82.0%
metadata-eval82.0%
Simplified82.0%
Taylor expanded in z around inf 70.7%
associate-*r*70.7%
*-commutative70.7%
associate-*r*70.9%
Simplified70.9%
if -4500 < z < -7.5 or 1.05000000000000004 < z < 6.4999999999999994e85Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
+-commutative99.7%
associate-*l*99.9%
*-commutative99.9%
associate-*r*99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 92.6%
Taylor expanded in y around inf 69.9%
*-commutative69.9%
Simplified69.9%
if -7.5 < z < -4.5000000000000002e-295 or 4.5999999999999999e-101 < z < 7.9999999999999997e-72Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 64.4%
*-commutative64.4%
+-commutative64.4%
sub-neg64.4%
distribute-rgt-in64.4%
metadata-eval64.4%
metadata-eval64.4%
neg-mul-164.4%
associate-*r*64.4%
*-commutative64.4%
distribute-lft-in64.4%
+-commutative64.4%
distribute-lft-in64.4%
associate-+r+64.4%
metadata-eval64.4%
metadata-eval64.4%
metadata-eval64.4%
distribute-lft-in64.4%
+-commutative64.4%
distribute-rgt-in64.4%
*-commutative64.4%
associate-*l*64.4%
metadata-eval64.4%
metadata-eval64.4%
Simplified64.4%
Taylor expanded in z around 0 63.2%
*-commutative63.2%
Simplified63.2%
if -4.5000000000000002e-295 < z < 4.5999999999999999e-101 or 7.9999999999999997e-72 < z < 1.05000000000000004Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 65.9%
associate-*r*65.9%
Simplified65.9%
Taylor expanded in z around 0 65.5%
if 6.4999999999999994e85 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 66.9%
*-commutative66.9%
+-commutative66.9%
sub-neg66.9%
distribute-rgt-in66.9%
metadata-eval66.9%
metadata-eval66.9%
neg-mul-166.9%
associate-*r*66.9%
*-commutative66.9%
distribute-lft-in66.9%
+-commutative66.9%
distribute-lft-in66.9%
associate-+r+66.9%
metadata-eval66.9%
metadata-eval66.9%
metadata-eval66.9%
distribute-lft-in66.9%
+-commutative66.9%
distribute-rgt-in66.9%
*-commutative66.9%
associate-*l*66.9%
metadata-eval66.9%
metadata-eval66.9%
Simplified66.9%
Taylor expanded in z around inf 66.9%
Final simplification64.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))) (t_1 (* -6.0 (* y z))))
(if (<= z -8.2e+192)
t_0
(if (<= z -3.4e+53)
t_1
(if (<= z -1150000.0)
t_0
(if (<= z -0.8)
t_1
(if (<= z 0.6) (* x -3.0) (if (<= z 7e+89) t_1 t_0))))))))
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 <= -8.2e+192) {
tmp = t_0;
} else if (z <= -3.4e+53) {
tmp = t_1;
} else if (z <= -1150000.0) {
tmp = t_0;
} else if (z <= -0.8) {
tmp = t_1;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else if (z <= 7e+89) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 6.0d0 * (x * z)
t_1 = (-6.0d0) * (y * z)
if (z <= (-8.2d+192)) then
tmp = t_0
else if (z <= (-3.4d+53)) then
tmp = t_1
else if (z <= (-1150000.0d0)) then
tmp = t_0
else if (z <= (-0.8d0)) then
tmp = t_1
else if (z <= 0.6d0) then
tmp = x * (-3.0d0)
else if (z <= 7d+89) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -8.2e+192) {
tmp = t_0;
} else if (z <= -3.4e+53) {
tmp = t_1;
} else if (z <= -1150000.0) {
tmp = t_0;
} else if (z <= -0.8) {
tmp = t_1;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else if (z <= 7e+89) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) t_1 = -6.0 * (y * z) tmp = 0 if z <= -8.2e+192: tmp = t_0 elif z <= -3.4e+53: tmp = t_1 elif z <= -1150000.0: tmp = t_0 elif z <= -0.8: tmp = t_1 elif z <= 0.6: tmp = x * -3.0 elif z <= 7e+89: tmp = t_1 else: tmp = t_0 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 <= -8.2e+192) tmp = t_0; elseif (z <= -3.4e+53) tmp = t_1; elseif (z <= -1150000.0) tmp = t_0; elseif (z <= -0.8) tmp = t_1; elseif (z <= 0.6) tmp = Float64(x * -3.0); elseif (z <= 7e+89) tmp = t_1; else tmp = t_0; 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 <= -8.2e+192) tmp = t_0; elseif (z <= -3.4e+53) tmp = t_1; elseif (z <= -1150000.0) tmp = t_0; elseif (z <= -0.8) tmp = t_1; elseif (z <= 0.6) tmp = x * -3.0; elseif (z <= 7e+89) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.2e+192], t$95$0, If[LessEqual[z, -3.4e+53], t$95$1, If[LessEqual[z, -1150000.0], t$95$0, If[LessEqual[z, -0.8], t$95$1, If[LessEqual[z, 0.6], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 7e+89], t$95$1, t$95$0]]]]]]]]
\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 -8.2 \cdot 10^{+192}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{+53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1150000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -0.8:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+89}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -8.20000000000000006e192 or -3.39999999999999998e53 < z < -1.15e6 or 7.0000000000000001e89 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 68.0%
*-commutative68.0%
+-commutative68.0%
sub-neg68.0%
distribute-rgt-in68.0%
metadata-eval68.0%
metadata-eval68.0%
neg-mul-168.0%
associate-*r*68.0%
*-commutative68.0%
distribute-lft-in68.0%
+-commutative68.0%
distribute-lft-in68.0%
associate-+r+68.0%
metadata-eval68.0%
metadata-eval68.0%
metadata-eval68.0%
distribute-lft-in68.0%
+-commutative68.0%
distribute-rgt-in68.0%
*-commutative68.0%
associate-*l*68.0%
metadata-eval68.0%
metadata-eval68.0%
Simplified68.0%
Taylor expanded in z around inf 66.9%
if -8.20000000000000006e192 < z < -3.39999999999999998e53 or -1.15e6 < z < -0.80000000000000004 or 0.599999999999999978 < z < 7.0000000000000001e89Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
+-commutative99.7%
associate-*l*99.7%
*-commutative99.7%
associate-*r*99.7%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 97.7%
Taylor expanded in y around inf 69.4%
*-commutative69.4%
Simplified69.4%
if -0.80000000000000004 < z < 0.599999999999999978Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 52.7%
*-commutative52.7%
+-commutative52.7%
sub-neg52.7%
distribute-rgt-in52.7%
metadata-eval52.7%
metadata-eval52.7%
neg-mul-152.7%
associate-*r*52.7%
*-commutative52.7%
distribute-lft-in52.7%
+-commutative52.7%
distribute-lft-in52.7%
associate-+r+52.7%
metadata-eval52.7%
metadata-eval52.7%
metadata-eval52.7%
distribute-lft-in52.7%
+-commutative52.7%
distribute-rgt-in52.7%
*-commutative52.7%
associate-*l*52.7%
metadata-eval52.7%
metadata-eval52.7%
Simplified52.7%
Taylor expanded in z around 0 51.8%
*-commutative51.8%
Simplified51.8%
Final simplification59.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* 6.0 z))) (t_1 (* -6.0 (* y z))))
(if (<= z -5e+193)
t_0
(if (<= z -2.5e+51)
t_1
(if (<= z -135.0)
t_0
(if (<= z -1.65)
t_1
(if (<= z 0.68)
(* x -3.0)
(if (<= z 2.25e+85) t_1 (* 6.0 (* x z))))))))))
double code(double x, double y, double z) {
double t_0 = x * (6.0 * z);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -5e+193) {
tmp = t_0;
} else if (z <= -2.5e+51) {
tmp = t_1;
} else if (z <= -135.0) {
tmp = t_0;
} else if (z <= -1.65) {
tmp = t_1;
} else if (z <= 0.68) {
tmp = x * -3.0;
} else if (z <= 2.25e+85) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = x * (6.0d0 * z)
t_1 = (-6.0d0) * (y * z)
if (z <= (-5d+193)) then
tmp = t_0
else if (z <= (-2.5d+51)) then
tmp = t_1
else if (z <= (-135.0d0)) then
tmp = t_0
else if (z <= (-1.65d0)) then
tmp = t_1
else if (z <= 0.68d0) then
tmp = x * (-3.0d0)
else if (z <= 2.25d+85) then
tmp = t_1
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 = x * (6.0 * z);
double t_1 = -6.0 * (y * z);
double tmp;
if (z <= -5e+193) {
tmp = t_0;
} else if (z <= -2.5e+51) {
tmp = t_1;
} else if (z <= -135.0) {
tmp = t_0;
} else if (z <= -1.65) {
tmp = t_1;
} else if (z <= 0.68) {
tmp = x * -3.0;
} else if (z <= 2.25e+85) {
tmp = t_1;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = x * (6.0 * z) t_1 = -6.0 * (y * z) tmp = 0 if z <= -5e+193: tmp = t_0 elif z <= -2.5e+51: tmp = t_1 elif z <= -135.0: tmp = t_0 elif z <= -1.65: tmp = t_1 elif z <= 0.68: tmp = x * -3.0 elif z <= 2.25e+85: tmp = t_1 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(6.0 * z)) t_1 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -5e+193) tmp = t_0; elseif (z <= -2.5e+51) tmp = t_1; elseif (z <= -135.0) tmp = t_0; elseif (z <= -1.65) tmp = t_1; elseif (z <= 0.68) tmp = Float64(x * -3.0); elseif (z <= 2.25e+85) tmp = t_1; else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (6.0 * z); t_1 = -6.0 * (y * z); tmp = 0.0; if (z <= -5e+193) tmp = t_0; elseif (z <= -2.5e+51) tmp = t_1; elseif (z <= -135.0) tmp = t_0; elseif (z <= -1.65) tmp = t_1; elseif (z <= 0.68) tmp = x * -3.0; elseif (z <= 2.25e+85) tmp = t_1; else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(6.0 * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5e+193], t$95$0, If[LessEqual[z, -2.5e+51], t$95$1, If[LessEqual[z, -135.0], t$95$0, If[LessEqual[z, -1.65], t$95$1, If[LessEqual[z, 0.68], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.25e+85], t$95$1, N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(6 \cdot z\right)\\
t_1 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -5 \cdot 10^{+193}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{+51}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -135:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.65:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+85}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -4.99999999999999972e193 or -2.5e51 < z < -135Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 70.3%
*-commutative70.3%
+-commutative70.3%
sub-neg70.3%
distribute-rgt-in70.2%
metadata-eval70.2%
metadata-eval70.2%
neg-mul-170.2%
associate-*r*70.2%
*-commutative70.2%
distribute-lft-in70.2%
+-commutative70.2%
distribute-lft-in70.2%
associate-+r+70.2%
metadata-eval70.2%
metadata-eval70.2%
metadata-eval70.2%
distribute-lft-in70.2%
+-commutative70.2%
distribute-rgt-in70.2%
*-commutative70.2%
associate-*l*70.2%
metadata-eval70.2%
metadata-eval70.2%
Simplified70.2%
Taylor expanded in z around inf 66.9%
*-commutative66.9%
Simplified66.9%
if -4.99999999999999972e193 < z < -2.5e51 or -135 < z < -1.6499999999999999 or 0.680000000000000049 < z < 2.25000000000000003e85Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
+-commutative99.7%
associate-*l*99.7%
*-commutative99.7%
associate-*r*99.7%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 97.7%
Taylor expanded in y around inf 69.4%
*-commutative69.4%
Simplified69.4%
if -1.6499999999999999 < z < 0.680000000000000049Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 52.7%
*-commutative52.7%
+-commutative52.7%
sub-neg52.7%
distribute-rgt-in52.7%
metadata-eval52.7%
metadata-eval52.7%
neg-mul-152.7%
associate-*r*52.7%
*-commutative52.7%
distribute-lft-in52.7%
+-commutative52.7%
distribute-lft-in52.7%
associate-+r+52.7%
metadata-eval52.7%
metadata-eval52.7%
metadata-eval52.7%
distribute-lft-in52.7%
+-commutative52.7%
distribute-rgt-in52.7%
*-commutative52.7%
associate-*l*52.7%
metadata-eval52.7%
metadata-eval52.7%
Simplified52.7%
Taylor expanded in z around 0 51.8%
*-commutative51.8%
Simplified51.8%
if 2.25000000000000003e85 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 66.9%
*-commutative66.9%
+-commutative66.9%
sub-neg66.9%
distribute-rgt-in66.9%
metadata-eval66.9%
metadata-eval66.9%
neg-mul-166.9%
associate-*r*66.9%
*-commutative66.9%
distribute-lft-in66.9%
+-commutative66.9%
distribute-lft-in66.9%
associate-+r+66.9%
metadata-eval66.9%
metadata-eval66.9%
metadata-eval66.9%
distribute-lft-in66.9%
+-commutative66.9%
distribute-rgt-in66.9%
*-commutative66.9%
associate-*l*66.9%
metadata-eval66.9%
metadata-eval66.9%
Simplified66.9%
Taylor expanded in z around inf 66.9%
Final simplification59.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* y 4.0))) (t_1 (* -6.0 (* (- y x) z))))
(if (<= z -0.115)
t_1
(if (<= z -3.8e-294)
(* x -3.0)
(if (<= z 2.55e-101)
t_0
(if (<= z 8.4e-72) (* x -3.0) (if (<= z 0.68) t_0 t_1)))))))
double code(double x, double y, double z) {
double t_0 = x + (y * 4.0);
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.115) {
tmp = t_1;
} else if (z <= -3.8e-294) {
tmp = x * -3.0;
} else if (z <= 2.55e-101) {
tmp = t_0;
} else if (z <= 8.4e-72) {
tmp = x * -3.0;
} else if (z <= 0.68) {
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 = x + (y * 4.0d0)
t_1 = (-6.0d0) * ((y - x) * z)
if (z <= (-0.115d0)) then
tmp = t_1
else if (z <= (-3.8d-294)) then
tmp = x * (-3.0d0)
else if (z <= 2.55d-101) then
tmp = t_0
else if (z <= 8.4d-72) then
tmp = x * (-3.0d0)
else if (z <= 0.68d0) 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 = x + (y * 4.0);
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.115) {
tmp = t_1;
} else if (z <= -3.8e-294) {
tmp = x * -3.0;
} else if (z <= 2.55e-101) {
tmp = t_0;
} else if (z <= 8.4e-72) {
tmp = x * -3.0;
} else if (z <= 0.68) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x + (y * 4.0) t_1 = -6.0 * ((y - x) * z) tmp = 0 if z <= -0.115: tmp = t_1 elif z <= -3.8e-294: tmp = x * -3.0 elif z <= 2.55e-101: tmp = t_0 elif z <= 8.4e-72: tmp = x * -3.0 elif z <= 0.68: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y * 4.0)) t_1 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -0.115) tmp = t_1; elseif (z <= -3.8e-294) tmp = Float64(x * -3.0); elseif (z <= 2.55e-101) tmp = t_0; elseif (z <= 8.4e-72) tmp = Float64(x * -3.0); elseif (z <= 0.68) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (y * 4.0); t_1 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -0.115) tmp = t_1; elseif (z <= -3.8e-294) tmp = x * -3.0; elseif (z <= 2.55e-101) tmp = t_0; elseif (z <= 8.4e-72) tmp = x * -3.0; elseif (z <= 0.68) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.115], t$95$1, If[LessEqual[z, -3.8e-294], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.55e-101], t$95$0, If[LessEqual[z, 8.4e-72], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.68], t$95$0, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + y \cdot 4\\
t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -0.115:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-294}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-101}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 8.4 \cdot 10^{-72}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -0.115000000000000005 or 0.680000000000000049 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
associate-*r*99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 98.2%
if -0.115000000000000005 < z < -3.8e-294 or 2.5500000000000001e-101 < z < 8.4e-72Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 64.4%
*-commutative64.4%
+-commutative64.4%
sub-neg64.4%
distribute-rgt-in64.4%
metadata-eval64.4%
metadata-eval64.4%
neg-mul-164.4%
associate-*r*64.4%
*-commutative64.4%
distribute-lft-in64.4%
+-commutative64.4%
distribute-lft-in64.4%
associate-+r+64.4%
metadata-eval64.4%
metadata-eval64.4%
metadata-eval64.4%
distribute-lft-in64.4%
+-commutative64.4%
distribute-rgt-in64.4%
*-commutative64.4%
associate-*l*64.4%
metadata-eval64.4%
metadata-eval64.4%
Simplified64.4%
Taylor expanded in z around 0 63.2%
*-commutative63.2%
Simplified63.2%
if -3.8e-294 < z < 2.5500000000000001e-101 or 8.4e-72 < z < 0.680000000000000049Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 65.9%
associate-*r*65.9%
Simplified65.9%
Taylor expanded in z around 0 65.5%
Final simplification80.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* (- y x) z))) (t_1 (+ x (* y 4.0))))
(if (<= z -1400000000.0)
t_0
(if (<= z -2.4e-294)
(* x (+ -3.0 (* 6.0 z)))
(if (<= z 2.6e-104)
t_1
(if (<= z 6.8e-72) (* x -3.0) (if (<= z 0.68) t_1 t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double t_1 = x + (y * 4.0);
double tmp;
if (z <= -1400000000.0) {
tmp = t_0;
} else if (z <= -2.4e-294) {
tmp = x * (-3.0 + (6.0 * z));
} else if (z <= 2.6e-104) {
tmp = t_1;
} else if (z <= 6.8e-72) {
tmp = x * -3.0;
} else if (z <= 0.68) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-6.0d0) * ((y - x) * z)
t_1 = x + (y * 4.0d0)
if (z <= (-1400000000.0d0)) then
tmp = t_0
else if (z <= (-2.4d-294)) then
tmp = x * ((-3.0d0) + (6.0d0 * z))
else if (z <= 2.6d-104) then
tmp = t_1
else if (z <= 6.8d-72) then
tmp = x * (-3.0d0)
else if (z <= 0.68d0) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * ((y - x) * z);
double t_1 = x + (y * 4.0);
double tmp;
if (z <= -1400000000.0) {
tmp = t_0;
} else if (z <= -2.4e-294) {
tmp = x * (-3.0 + (6.0 * z));
} else if (z <= 2.6e-104) {
tmp = t_1;
} else if (z <= 6.8e-72) {
tmp = x * -3.0;
} else if (z <= 0.68) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * ((y - x) * z) t_1 = x + (y * 4.0) tmp = 0 if z <= -1400000000.0: tmp = t_0 elif z <= -2.4e-294: tmp = x * (-3.0 + (6.0 * z)) elif z <= 2.6e-104: tmp = t_1 elif z <= 6.8e-72: tmp = x * -3.0 elif z <= 0.68: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(Float64(y - x) * z)) t_1 = Float64(x + Float64(y * 4.0)) tmp = 0.0 if (z <= -1400000000.0) tmp = t_0; elseif (z <= -2.4e-294) tmp = Float64(x * Float64(-3.0 + Float64(6.0 * z))); elseif (z <= 2.6e-104) tmp = t_1; elseif (z <= 6.8e-72) tmp = Float64(x * -3.0); elseif (z <= 0.68) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * ((y - x) * z); t_1 = x + (y * 4.0); tmp = 0.0; if (z <= -1400000000.0) tmp = t_0; elseif (z <= -2.4e-294) tmp = x * (-3.0 + (6.0 * z)); elseif (z <= 2.6e-104) tmp = t_1; elseif (z <= 6.8e-72) tmp = x * -3.0; elseif (z <= 0.68) tmp = t_1; 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]}, Block[{t$95$1 = N[(x + N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1400000000.0], t$95$0, If[LessEqual[z, -2.4e-294], N[(x * N[(-3.0 + N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e-104], t$95$1, If[LessEqual[z, 6.8e-72], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.68], t$95$1, t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
t_1 := x + y \cdot 4\\
\mathbf{if}\;z \leq -1400000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-294}:\\
\;\;\;\;x \cdot \left(-3 + 6 \cdot z\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-104}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-72}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1.4e9 or 0.680000000000000049 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
associate-*r*99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 99.5%
if -1.4e9 < z < -2.39999999999999997e-294Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 62.9%
*-commutative62.9%
+-commutative62.9%
sub-neg62.9%
distribute-rgt-in62.9%
metadata-eval62.9%
metadata-eval62.9%
neg-mul-162.9%
associate-*r*62.9%
*-commutative62.9%
distribute-lft-in62.9%
+-commutative62.9%
distribute-lft-in62.9%
associate-+r+62.9%
metadata-eval62.9%
metadata-eval62.9%
metadata-eval62.9%
distribute-lft-in62.9%
+-commutative62.9%
distribute-rgt-in62.9%
*-commutative62.9%
associate-*l*62.9%
metadata-eval62.9%
metadata-eval62.9%
Simplified62.9%
if -2.39999999999999997e-294 < z < 2.60000000000000003e-104 or 6.7999999999999997e-72 < z < 0.680000000000000049Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 65.9%
associate-*r*65.9%
Simplified65.9%
Taylor expanded in z around 0 65.5%
if 2.60000000000000003e-104 < z < 6.7999999999999997e-72Initial program 99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in x around inf 78.3%
*-commutative78.3%
+-commutative78.3%
sub-neg78.3%
distribute-rgt-in78.3%
metadata-eval78.3%
metadata-eval78.3%
neg-mul-178.3%
associate-*r*78.3%
*-commutative78.3%
distribute-lft-in78.3%
+-commutative78.3%
distribute-lft-in78.3%
associate-+r+78.3%
metadata-eval78.3%
metadata-eval78.3%
metadata-eval78.3%
distribute-lft-in78.3%
+-commutative78.3%
distribute-rgt-in78.3%
*-commutative78.3%
associate-*l*78.3%
metadata-eval78.3%
metadata-eval78.3%
Simplified78.3%
Taylor expanded in z around 0 78.3%
*-commutative78.3%
Simplified78.3%
Final simplification80.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* y 4.0))))
(if (<= z -410000000.0)
(* z (* (- y x) -6.0))
(if (<= z -1.16e-294)
(* x (+ -3.0 (* 6.0 z)))
(if (<= z 2.45e-104)
t_0
(if (<= z 5e-73)
(* x -3.0)
(if (<= z 0.68) t_0 (* -6.0 (* (- y x) z)))))))))
double code(double x, double y, double z) {
double t_0 = x + (y * 4.0);
double tmp;
if (z <= -410000000.0) {
tmp = z * ((y - x) * -6.0);
} else if (z <= -1.16e-294) {
tmp = x * (-3.0 + (6.0 * z));
} else if (z <= 2.45e-104) {
tmp = t_0;
} else if (z <= 5e-73) {
tmp = x * -3.0;
} else if (z <= 0.68) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = x + (y * 4.0d0)
if (z <= (-410000000.0d0)) then
tmp = z * ((y - x) * (-6.0d0))
else if (z <= (-1.16d-294)) then
tmp = x * ((-3.0d0) + (6.0d0 * z))
else if (z <= 2.45d-104) then
tmp = t_0
else if (z <= 5d-73) then
tmp = x * (-3.0d0)
else if (z <= 0.68d0) then
tmp = t_0
else
tmp = (-6.0d0) * ((y - x) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (y * 4.0);
double tmp;
if (z <= -410000000.0) {
tmp = z * ((y - x) * -6.0);
} else if (z <= -1.16e-294) {
tmp = x * (-3.0 + (6.0 * z));
} else if (z <= 2.45e-104) {
tmp = t_0;
} else if (z <= 5e-73) {
tmp = x * -3.0;
} else if (z <= 0.68) {
tmp = t_0;
} else {
tmp = -6.0 * ((y - x) * z);
}
return tmp;
}
def code(x, y, z): t_0 = x + (y * 4.0) tmp = 0 if z <= -410000000.0: tmp = z * ((y - x) * -6.0) elif z <= -1.16e-294: tmp = x * (-3.0 + (6.0 * z)) elif z <= 2.45e-104: tmp = t_0 elif z <= 5e-73: tmp = x * -3.0 elif z <= 0.68: tmp = t_0 else: tmp = -6.0 * ((y - x) * z) return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y * 4.0)) tmp = 0.0 if (z <= -410000000.0) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); elseif (z <= -1.16e-294) tmp = Float64(x * Float64(-3.0 + Float64(6.0 * z))); elseif (z <= 2.45e-104) tmp = t_0; elseif (z <= 5e-73) tmp = Float64(x * -3.0); elseif (z <= 0.68) tmp = t_0; else tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (y * 4.0); tmp = 0.0; if (z <= -410000000.0) tmp = z * ((y - x) * -6.0); elseif (z <= -1.16e-294) tmp = x * (-3.0 + (6.0 * z)); elseif (z <= 2.45e-104) tmp = t_0; elseif (z <= 5e-73) tmp = x * -3.0; elseif (z <= 0.68) tmp = t_0; else tmp = -6.0 * ((y - x) * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -410000000.0], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.16e-294], N[(x * N[(-3.0 + N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.45e-104], t$95$0, If[LessEqual[z, 5e-73], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.68], t$95$0, N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + y \cdot 4\\
\mathbf{if}\;z \leq -410000000:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{elif}\;z \leq -1.16 \cdot 10^{-294}:\\
\;\;\;\;x \cdot \left(-3 + 6 \cdot z\right)\\
\mathbf{elif}\;z \leq 2.45 \cdot 10^{-104}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-73}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\end{array}
\end{array}
if z < -4.1e8Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
associate-*l*99.7%
*-commutative99.7%
associate-*r*99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 99.6%
*-commutative99.6%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
if -4.1e8 < z < -1.16000000000000006e-294Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 62.9%
*-commutative62.9%
+-commutative62.9%
sub-neg62.9%
distribute-rgt-in62.9%
metadata-eval62.9%
metadata-eval62.9%
neg-mul-162.9%
associate-*r*62.9%
*-commutative62.9%
distribute-lft-in62.9%
+-commutative62.9%
distribute-lft-in62.9%
associate-+r+62.9%
metadata-eval62.9%
metadata-eval62.9%
metadata-eval62.9%
distribute-lft-in62.9%
+-commutative62.9%
distribute-rgt-in62.9%
*-commutative62.9%
associate-*l*62.9%
metadata-eval62.9%
metadata-eval62.9%
Simplified62.9%
if -1.16000000000000006e-294 < z < 2.4500000000000001e-104 or 4.9999999999999998e-73 < z < 0.680000000000000049Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 65.9%
associate-*r*65.9%
Simplified65.9%
Taylor expanded in z around 0 65.5%
if 2.4500000000000001e-104 < z < 4.9999999999999998e-73Initial program 99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in x around inf 78.3%
*-commutative78.3%
+-commutative78.3%
sub-neg78.3%
distribute-rgt-in78.3%
metadata-eval78.3%
metadata-eval78.3%
neg-mul-178.3%
associate-*r*78.3%
*-commutative78.3%
distribute-lft-in78.3%
+-commutative78.3%
distribute-lft-in78.3%
associate-+r+78.3%
metadata-eval78.3%
metadata-eval78.3%
metadata-eval78.3%
distribute-lft-in78.3%
+-commutative78.3%
distribute-rgt-in78.3%
*-commutative78.3%
associate-*l*78.3%
metadata-eval78.3%
metadata-eval78.3%
Simplified78.3%
Taylor expanded in z around 0 78.3%
*-commutative78.3%
Simplified78.3%
if 0.680000000000000049 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
associate-*r*99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.4%
Final simplification80.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (+ 4.0 (* z -6.0)))))
(if (<= z -410000000.0)
(* z (* (- y x) -6.0))
(if (<= z -9.5e-295)
(* x (+ -3.0 (* 6.0 z)))
(if (<= z 1.26e-102)
t_0
(if (<= z 6.5e-72)
(* x -3.0)
(if (<= z 4.2e+15) t_0 (* -6.0 (* (- y x) z)))))))))
double code(double x, double y, double z) {
double t_0 = y * (4.0 + (z * -6.0));
double tmp;
if (z <= -410000000.0) {
tmp = z * ((y - x) * -6.0);
} else if (z <= -9.5e-295) {
tmp = x * (-3.0 + (6.0 * z));
} else if (z <= 1.26e-102) {
tmp = t_0;
} else if (z <= 6.5e-72) {
tmp = x * -3.0;
} else if (z <= 4.2e+15) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = y * (4.0d0 + (z * (-6.0d0)))
if (z <= (-410000000.0d0)) then
tmp = z * ((y - x) * (-6.0d0))
else if (z <= (-9.5d-295)) then
tmp = x * ((-3.0d0) + (6.0d0 * z))
else if (z <= 1.26d-102) then
tmp = t_0
else if (z <= 6.5d-72) then
tmp = x * (-3.0d0)
else if (z <= 4.2d+15) then
tmp = t_0
else
tmp = (-6.0d0) * ((y - x) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (4.0 + (z * -6.0));
double tmp;
if (z <= -410000000.0) {
tmp = z * ((y - x) * -6.0);
} else if (z <= -9.5e-295) {
tmp = x * (-3.0 + (6.0 * z));
} else if (z <= 1.26e-102) {
tmp = t_0;
} else if (z <= 6.5e-72) {
tmp = x * -3.0;
} else if (z <= 4.2e+15) {
tmp = t_0;
} else {
tmp = -6.0 * ((y - x) * z);
}
return tmp;
}
def code(x, y, z): t_0 = y * (4.0 + (z * -6.0)) tmp = 0 if z <= -410000000.0: tmp = z * ((y - x) * -6.0) elif z <= -9.5e-295: tmp = x * (-3.0 + (6.0 * z)) elif z <= 1.26e-102: tmp = t_0 elif z <= 6.5e-72: tmp = x * -3.0 elif z <= 4.2e+15: tmp = t_0 else: tmp = -6.0 * ((y - x) * z) return tmp
function code(x, y, z) t_0 = Float64(y * Float64(4.0 + Float64(z * -6.0))) tmp = 0.0 if (z <= -410000000.0) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); elseif (z <= -9.5e-295) tmp = Float64(x * Float64(-3.0 + Float64(6.0 * z))); elseif (z <= 1.26e-102) tmp = t_0; elseif (z <= 6.5e-72) tmp = Float64(x * -3.0); elseif (z <= 4.2e+15) tmp = t_0; else tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (4.0 + (z * -6.0)); tmp = 0.0; if (z <= -410000000.0) tmp = z * ((y - x) * -6.0); elseif (z <= -9.5e-295) tmp = x * (-3.0 + (6.0 * z)); elseif (z <= 1.26e-102) tmp = t_0; elseif (z <= 6.5e-72) tmp = x * -3.0; elseif (z <= 4.2e+15) tmp = t_0; else tmp = -6.0 * ((y - x) * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -410000000.0], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9.5e-295], N[(x * N[(-3.0 + N[(6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.26e-102], t$95$0, If[LessEqual[z, 6.5e-72], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.2e+15], t$95$0, N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{if}\;z \leq -410000000:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-295}:\\
\;\;\;\;x \cdot \left(-3 + 6 \cdot z\right)\\
\mathbf{elif}\;z \leq 1.26 \cdot 10^{-102}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-72}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+15}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\end{array}
\end{array}
if z < -4.1e8Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
associate-*l*99.7%
*-commutative99.7%
associate-*r*99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 99.6%
*-commutative99.6%
associate-*r*99.8%
*-commutative99.8%
Simplified99.8%
if -4.1e8 < z < -9.5e-295Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 62.9%
*-commutative62.9%
+-commutative62.9%
sub-neg62.9%
distribute-rgt-in62.9%
metadata-eval62.9%
metadata-eval62.9%
neg-mul-162.9%
associate-*r*62.9%
*-commutative62.9%
distribute-lft-in62.9%
+-commutative62.9%
distribute-lft-in62.9%
associate-+r+62.9%
metadata-eval62.9%
metadata-eval62.9%
metadata-eval62.9%
distribute-lft-in62.9%
+-commutative62.9%
distribute-rgt-in62.9%
*-commutative62.9%
associate-*l*62.9%
metadata-eval62.9%
metadata-eval62.9%
Simplified62.9%
if -9.5e-295 < z < 1.2600000000000001e-102 or 6.4999999999999997e-72 < z < 4.2e15Initial program 99.4%
+-commutative99.4%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
distribute-rgt-neg-out99.9%
distribute-lft-neg-in99.9%
*-commutative99.9%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 68.3%
if 1.2600000000000001e-102 < z < 6.4999999999999997e-72Initial program 99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in x around inf 78.3%
*-commutative78.3%
+-commutative78.3%
sub-neg78.3%
distribute-rgt-in78.3%
metadata-eval78.3%
metadata-eval78.3%
neg-mul-178.3%
associate-*r*78.3%
*-commutative78.3%
distribute-lft-in78.3%
+-commutative78.3%
distribute-lft-in78.3%
associate-+r+78.3%
metadata-eval78.3%
metadata-eval78.3%
metadata-eval78.3%
distribute-lft-in78.3%
+-commutative78.3%
distribute-rgt-in78.3%
*-commutative78.3%
associate-*l*78.3%
metadata-eval78.3%
metadata-eval78.3%
Simplified78.3%
Taylor expanded in z around 0 78.3%
*-commutative78.3%
Simplified78.3%
if 4.2e15 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
associate-*r*99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.8%
Final simplification81.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -2.6e+52)
(* y (* z -6.0))
(if (<= z -1600.0)
(* x (* 6.0 z))
(if (<= z -1.4)
t_0
(if (<= z 0.68)
(* x -3.0)
(if (<= z 4.4e+89) 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 <= -2.6e+52) {
tmp = y * (z * -6.0);
} else if (z <= -1600.0) {
tmp = x * (6.0 * z);
} else if (z <= -1.4) {
tmp = t_0;
} else if (z <= 0.68) {
tmp = x * -3.0;
} else if (z <= 4.4e+89) {
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 <= (-2.6d+52)) then
tmp = y * (z * (-6.0d0))
else if (z <= (-1600.0d0)) then
tmp = x * (6.0d0 * z)
else if (z <= (-1.4d0)) then
tmp = t_0
else if (z <= 0.68d0) then
tmp = x * (-3.0d0)
else if (z <= 4.4d+89) 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 <= -2.6e+52) {
tmp = y * (z * -6.0);
} else if (z <= -1600.0) {
tmp = x * (6.0 * z);
} else if (z <= -1.4) {
tmp = t_0;
} else if (z <= 0.68) {
tmp = x * -3.0;
} else if (z <= 4.4e+89) {
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 <= -2.6e+52: tmp = y * (z * -6.0) elif z <= -1600.0: tmp = x * (6.0 * z) elif z <= -1.4: tmp = t_0 elif z <= 0.68: tmp = x * -3.0 elif z <= 4.4e+89: 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 <= -2.6e+52) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= -1600.0) tmp = Float64(x * Float64(6.0 * z)); elseif (z <= -1.4) tmp = t_0; elseif (z <= 0.68) tmp = Float64(x * -3.0); elseif (z <= 4.4e+89) 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 <= -2.6e+52) tmp = y * (z * -6.0); elseif (z <= -1600.0) tmp = x * (6.0 * z); elseif (z <= -1.4) tmp = t_0; elseif (z <= 0.68) tmp = x * -3.0; elseif (z <= 4.4e+89) 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, -2.6e+52], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1600.0], N[(x * N[(6.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.4], t$95$0, If[LessEqual[z, 0.68], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.4e+89], 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 -2.6 \cdot 10^{+52}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -1600:\\
\;\;\;\;x \cdot \left(6 \cdot z\right)\\
\mathbf{elif}\;z \leq -1.4:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+89}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -2.6e52Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
associate-*l*99.7%
*-commutative99.7%
associate-*r*99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 59.2%
*-commutative59.2%
associate-*r*61.1%
*-commutative61.1%
Simplified61.1%
if -2.6e52 < z < -1600Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 82.3%
*-commutative82.3%
+-commutative82.3%
sub-neg82.3%
distribute-rgt-in82.0%
metadata-eval82.0%
metadata-eval82.0%
neg-mul-182.0%
associate-*r*82.0%
*-commutative82.0%
distribute-lft-in82.0%
+-commutative82.0%
distribute-lft-in82.0%
associate-+r+82.0%
metadata-eval82.0%
metadata-eval82.0%
metadata-eval82.0%
distribute-lft-in82.0%
+-commutative82.0%
distribute-rgt-in82.0%
*-commutative82.0%
associate-*l*82.0%
metadata-eval82.0%
metadata-eval82.0%
Simplified82.0%
Taylor expanded in z around inf 70.7%
*-commutative70.7%
Simplified70.7%
if -1600 < z < -1.3999999999999999 or 0.680000000000000049 < z < 4.4e89Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
+-commutative99.7%
associate-*l*99.9%
*-commutative99.9%
associate-*r*99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 92.6%
Taylor expanded in y around inf 69.9%
*-commutative69.9%
Simplified69.9%
if -1.3999999999999999 < z < 0.680000000000000049Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 52.7%
*-commutative52.7%
+-commutative52.7%
sub-neg52.7%
distribute-rgt-in52.7%
metadata-eval52.7%
metadata-eval52.7%
neg-mul-152.7%
associate-*r*52.7%
*-commutative52.7%
distribute-lft-in52.7%
+-commutative52.7%
distribute-lft-in52.7%
associate-+r+52.7%
metadata-eval52.7%
metadata-eval52.7%
metadata-eval52.7%
distribute-lft-in52.7%
+-commutative52.7%
distribute-rgt-in52.7%
*-commutative52.7%
associate-*l*52.7%
metadata-eval52.7%
metadata-eval52.7%
Simplified52.7%
Taylor expanded in z around 0 51.8%
*-commutative51.8%
Simplified51.8%
if 4.4e89 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 66.9%
*-commutative66.9%
+-commutative66.9%
sub-neg66.9%
distribute-rgt-in66.9%
metadata-eval66.9%
metadata-eval66.9%
neg-mul-166.9%
associate-*r*66.9%
*-commutative66.9%
distribute-lft-in66.9%
+-commutative66.9%
distribute-lft-in66.9%
associate-+r+66.9%
metadata-eval66.9%
metadata-eval66.9%
metadata-eval66.9%
distribute-lft-in66.9%
+-commutative66.9%
distribute-rgt-in66.9%
*-commutative66.9%
associate-*l*66.9%
metadata-eval66.9%
metadata-eval66.9%
Simplified66.9%
Taylor expanded in z around inf 66.9%
Final simplification57.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -4.5e+52)
(* y (* z -6.0))
(if (<= z -1600.0)
(* z (* x 6.0))
(if (<= z -0.95)
t_0
(if (<= z 0.5)
(* x -3.0)
(if (<= z 8.6e+85) 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 <= -4.5e+52) {
tmp = y * (z * -6.0);
} else if (z <= -1600.0) {
tmp = z * (x * 6.0);
} else if (z <= -0.95) {
tmp = t_0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 8.6e+85) {
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 <= (-4.5d+52)) then
tmp = y * (z * (-6.0d0))
else if (z <= (-1600.0d0)) then
tmp = z * (x * 6.0d0)
else if (z <= (-0.95d0)) then
tmp = t_0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if (z <= 8.6d+85) 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 <= -4.5e+52) {
tmp = y * (z * -6.0);
} else if (z <= -1600.0) {
tmp = z * (x * 6.0);
} else if (z <= -0.95) {
tmp = t_0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 8.6e+85) {
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 <= -4.5e+52: tmp = y * (z * -6.0) elif z <= -1600.0: tmp = z * (x * 6.0) elif z <= -0.95: tmp = t_0 elif z <= 0.5: tmp = x * -3.0 elif z <= 8.6e+85: 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 <= -4.5e+52) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= -1600.0) tmp = Float64(z * Float64(x * 6.0)); elseif (z <= -0.95) tmp = t_0; elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif (z <= 8.6e+85) 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 <= -4.5e+52) tmp = y * (z * -6.0); elseif (z <= -1600.0) tmp = z * (x * 6.0); elseif (z <= -0.95) tmp = t_0; elseif (z <= 0.5) tmp = x * -3.0; elseif (z <= 8.6e+85) 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, -4.5e+52], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1600.0], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.95], t$95$0, If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8.6e+85], 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 -4.5 \cdot 10^{+52}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -1600:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq -0.95:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{+85}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -4.5e52Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
associate-*l*99.7%
*-commutative99.7%
associate-*r*99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 99.7%
*-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in y around inf 59.2%
*-commutative59.2%
associate-*r*61.1%
*-commutative61.1%
Simplified61.1%
if -4.5e52 < z < -1600Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 82.3%
*-commutative82.3%
+-commutative82.3%
sub-neg82.3%
distribute-rgt-in82.0%
metadata-eval82.0%
metadata-eval82.0%
neg-mul-182.0%
associate-*r*82.0%
*-commutative82.0%
distribute-lft-in82.0%
+-commutative82.0%
distribute-lft-in82.0%
associate-+r+82.0%
metadata-eval82.0%
metadata-eval82.0%
metadata-eval82.0%
distribute-lft-in82.0%
+-commutative82.0%
distribute-rgt-in82.0%
*-commutative82.0%
associate-*l*82.0%
metadata-eval82.0%
metadata-eval82.0%
Simplified82.0%
Taylor expanded in z around inf 70.7%
associate-*r*70.7%
*-commutative70.7%
associate-*r*70.9%
Simplified70.9%
if -1600 < z < -0.94999999999999996 or 0.5 < z < 8.5999999999999998e85Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
+-commutative99.7%
associate-*l*99.9%
*-commutative99.9%
associate-*r*99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 92.6%
Taylor expanded in y around inf 69.9%
*-commutative69.9%
Simplified69.9%
if -0.94999999999999996 < z < 0.5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 52.7%
*-commutative52.7%
+-commutative52.7%
sub-neg52.7%
distribute-rgt-in52.7%
metadata-eval52.7%
metadata-eval52.7%
neg-mul-152.7%
associate-*r*52.7%
*-commutative52.7%
distribute-lft-in52.7%
+-commutative52.7%
distribute-lft-in52.7%
associate-+r+52.7%
metadata-eval52.7%
metadata-eval52.7%
metadata-eval52.7%
distribute-lft-in52.7%
+-commutative52.7%
distribute-rgt-in52.7%
*-commutative52.7%
associate-*l*52.7%
metadata-eval52.7%
metadata-eval52.7%
Simplified52.7%
Taylor expanded in z around 0 51.8%
*-commutative51.8%
Simplified51.8%
if 8.5999999999999998e85 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 66.9%
*-commutative66.9%
+-commutative66.9%
sub-neg66.9%
distribute-rgt-in66.9%
metadata-eval66.9%
metadata-eval66.9%
neg-mul-166.9%
associate-*r*66.9%
*-commutative66.9%
distribute-lft-in66.9%
+-commutative66.9%
distribute-lft-in66.9%
associate-+r+66.9%
metadata-eval66.9%
metadata-eval66.9%
metadata-eval66.9%
distribute-lft-in66.9%
+-commutative66.9%
distribute-rgt-in66.9%
*-commutative66.9%
associate-*l*66.9%
metadata-eval66.9%
metadata-eval66.9%
Simplified66.9%
Taylor expanded in z around inf 66.9%
Final simplification57.9%
(FPCore (x y z) :precision binary64 (if (<= z -0.55) (* z (* (- y x) -6.0)) (if (<= z 0.55) (+ (* y 4.0) (* x -3.0)) (* -6.0 (* (- y x) z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.55) {
tmp = z * ((y - x) * -6.0);
} else if (z <= 0.55) {
tmp = (y * 4.0) + (x * -3.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.55d0)) then
tmp = z * ((y - x) * (-6.0d0))
else if (z <= 0.55d0) then
tmp = (y * 4.0d0) + (x * (-3.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.55) {
tmp = z * ((y - x) * -6.0);
} else if (z <= 0.55) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = -6.0 * ((y - x) * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.55: tmp = z * ((y - x) * -6.0) elif z <= 0.55: tmp = (y * 4.0) + (x * -3.0) else: tmp = -6.0 * ((y - x) * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.55) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); elseif (z <= 0.55) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.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.55) tmp = z * ((y - x) * -6.0); elseif (z <= 0.55) tmp = (y * 4.0) + (x * -3.0); else tmp = -6.0 * ((y - x) * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.55], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.55], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.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.55:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\end{array}
\end{array}
if z < -0.55000000000000004Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
associate-*l*99.7%
*-commutative99.7%
associate-*r*99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 97.1%
*-commutative97.1%
associate-*r*97.2%
*-commutative97.2%
Simplified97.2%
if -0.55000000000000004 < z < 0.55000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 99.6%
fma-def99.7%
associate-*r*99.7%
Simplified99.7%
Taylor expanded in z around 0 98.6%
if 0.55000000000000004 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
associate-*r*99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 99.4%
Final simplification98.4%
(FPCore (x y z) :precision binary64 (+ x (* (- 0.6666666666666666 z) (* (- y x) 6.0))))
double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.0));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((0.6666666666666666d0 - z) * ((y - x) * 6.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.0));
}
def code(x, y, z): return x + ((0.6666666666666666 - z) * ((y - x) * 6.0))
function code(x, y, z) return Float64(x + Float64(Float64(0.6666666666666666 - z) * Float64(Float64(y - x) * 6.0))) end
function tmp = code(x, y, z) tmp = x + ((0.6666666666666666 - z) * ((y - x) * 6.0)); end
code[x_, y_, z_] := N[(x + N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(0.6666666666666666 - z\right) \cdot \left(\left(y - x\right) \cdot 6\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.95) (not (<= z 0.55))) (* -6.0 (* y z)) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.95) || !(z <= 0.55)) {
tmp = -6.0 * (y * z);
} 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 ((z <= (-1.95d0)) .or. (.not. (z <= 0.55d0))) then
tmp = (-6.0d0) * (y * z)
else
tmp = x * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.95) || !(z <= 0.55)) {
tmp = -6.0 * (y * z);
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.95) or not (z <= 0.55): tmp = -6.0 * (y * z) else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.95) || !(z <= 0.55)) tmp = Float64(-6.0 * Float64(y * z)); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.95) || ~((z <= 0.55))) tmp = -6.0 * (y * z); else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.95], N[Not[LessEqual[z, 0.55]], $MachinePrecision]], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \lor \neg \left(z \leq 0.55\right):\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if z < -1.94999999999999996 or 0.55000000000000004 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
associate-*l*99.8%
*-commutative99.8%
associate-*r*99.7%
fma-def99.7%
Applied egg-rr99.7%
Taylor expanded in z around inf 98.2%
Taylor expanded in y around inf 49.3%
*-commutative49.3%
Simplified49.3%
if -1.94999999999999996 < z < 0.55000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 52.7%
*-commutative52.7%
+-commutative52.7%
sub-neg52.7%
distribute-rgt-in52.7%
metadata-eval52.7%
metadata-eval52.7%
neg-mul-152.7%
associate-*r*52.7%
*-commutative52.7%
distribute-lft-in52.7%
+-commutative52.7%
distribute-lft-in52.7%
associate-+r+52.7%
metadata-eval52.7%
metadata-eval52.7%
metadata-eval52.7%
distribute-lft-in52.7%
+-commutative52.7%
distribute-rgt-in52.7%
*-commutative52.7%
associate-*l*52.7%
metadata-eval52.7%
metadata-eval52.7%
Simplified52.7%
Taylor expanded in z around 0 51.8%
*-commutative51.8%
Simplified51.8%
Final simplification50.6%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 54.2%
*-commutative54.2%
+-commutative54.2%
sub-neg54.2%
distribute-rgt-in54.2%
metadata-eval54.2%
metadata-eval54.2%
neg-mul-154.2%
associate-*r*54.2%
*-commutative54.2%
distribute-lft-in54.2%
+-commutative54.2%
distribute-lft-in54.2%
associate-+r+54.2%
metadata-eval54.2%
metadata-eval54.2%
metadata-eval54.2%
distribute-lft-in54.2%
+-commutative54.2%
distribute-rgt-in54.2%
*-commutative54.2%
associate-*l*54.2%
metadata-eval54.2%
metadata-eval54.2%
Simplified54.2%
Taylor expanded in z around 0 29.0%
*-commutative29.0%
Simplified29.0%
Final simplification29.0%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 48.7%
associate-*r*48.7%
Simplified48.7%
Taylor expanded in x around inf 2.5%
Final simplification2.5%
herbie shell --seed 2023279
(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))))