
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (fma (- y x) (+ 4.0 (* z -6.0)) x))
double code(double x, double y, double z) {
return fma((y - x), (4.0 + (z * -6.0)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(4.0 + Float64(z * -6.0)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.7%
sub-neg99.7%
distribute-rgt-in99.7%
metadata-eval99.7%
metadata-eval99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
metadata-eval99.7%
Simplified99.7%
(FPCore (x y z)
:precision binary64
(if (<= z -5.5e+37)
(* z (* y -6.0))
(if (<= z -0.5)
(* 6.0 (* x z))
(if (<= z 1.1e-202)
(* x -3.0)
(if (<= z 0.65) (* y 4.0) (* -6.0 (* y z)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.5e+37) {
tmp = z * (y * -6.0);
} else if (z <= -0.5) {
tmp = 6.0 * (x * z);
} else if (z <= 1.1e-202) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.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) :: tmp
if (z <= (-5.5d+37)) then
tmp = z * (y * (-6.0d0))
else if (z <= (-0.5d0)) then
tmp = 6.0d0 * (x * z)
else if (z <= 1.1d-202) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = (-6.0d0) * (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5.5e+37) {
tmp = z * (y * -6.0);
} else if (z <= -0.5) {
tmp = 6.0 * (x * z);
} else if (z <= 1.1e-202) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = -6.0 * (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.5e+37: tmp = z * (y * -6.0) elif z <= -0.5: tmp = 6.0 * (x * z) elif z <= 1.1e-202: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 else: tmp = -6.0 * (y * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.5e+37) tmp = Float64(z * Float64(y * -6.0)); elseif (z <= -0.5) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= 1.1e-202) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = Float64(-6.0 * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.5e+37) tmp = z * (y * -6.0); elseif (z <= -0.5) tmp = 6.0 * (x * z); elseif (z <= 1.1e-202) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = -6.0 * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.5e+37], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.5], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-202], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+37}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\mathbf{elif}\;z \leq -0.5:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-202}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if z < -5.50000000000000016e37Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 96.2%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around inf 68.5%
*-commutative68.5%
*-commutative68.5%
associate-*r*68.5%
*-commutative68.5%
Simplified68.5%
if -5.50000000000000016e37 < z < -0.5Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 86.2%
sub-neg86.2%
distribute-rgt-in86.2%
metadata-eval86.2%
distribute-lft-neg-in86.2%
associate-+r+86.2%
metadata-eval86.2%
distribute-rgt-neg-in86.2%
metadata-eval86.2%
Simplified86.2%
Taylor expanded in z around inf 83.1%
if -0.5 < z < 1.10000000000000004e-202Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 56.4%
sub-neg56.4%
distribute-rgt-in56.4%
metadata-eval56.4%
distribute-lft-neg-in56.4%
associate-+r+56.4%
metadata-eval56.4%
distribute-rgt-neg-in56.4%
metadata-eval56.4%
Simplified56.4%
Taylor expanded in z around 0 54.9%
*-commutative54.9%
Simplified54.9%
if 1.10000000000000004e-202 < z < 0.650000000000000022Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around 0 98.0%
Taylor expanded in x around 0 54.0%
*-commutative54.0%
Simplified54.0%
if 0.650000000000000022 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 95.8%
Taylor expanded in z around inf 98.0%
Taylor expanded in y around inf 59.1%
*-commutative59.1%
Simplified59.1%
Final simplification59.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -5.1e+38)
t_0
(if (<= z -0.5)
(* 6.0 (* x z))
(if (<= z 9.8e-203) (* x -3.0) (if (<= z 0.65) (* y 4.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -5.1e+38) {
tmp = t_0;
} else if (z <= -0.5) {
tmp = 6.0 * (x * z);
} else if (z <= 9.8e-203) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-5.1d+38)) then
tmp = t_0
else if (z <= (-0.5d0)) then
tmp = 6.0d0 * (x * z)
else if (z <= 9.8d-203) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -5.1e+38) {
tmp = t_0;
} else if (z <= -0.5) {
tmp = 6.0 * (x * z);
} else if (z <= 9.8e-203) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -5.1e+38: tmp = t_0 elif z <= -0.5: tmp = 6.0 * (x * z) elif z <= 9.8e-203: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -5.1e+38) tmp = t_0; elseif (z <= -0.5) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= 9.8e-203) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -5.1e+38) tmp = t_0; elseif (z <= -0.5) tmp = 6.0 * (x * z); elseif (z <= 9.8e-203) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.1e+38], t$95$0, If[LessEqual[z, -0.5], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.8e-203], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -5.1 \cdot 10^{+38}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -0.5:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-203}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -5.1000000000000001e38 or 0.650000000000000022 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 96.0%
Taylor expanded in z around inf 99.0%
Taylor expanded in y around inf 64.1%
*-commutative64.1%
Simplified64.1%
if -5.1000000000000001e38 < z < -0.5Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 86.2%
sub-neg86.2%
distribute-rgt-in86.2%
metadata-eval86.2%
distribute-lft-neg-in86.2%
associate-+r+86.2%
metadata-eval86.2%
distribute-rgt-neg-in86.2%
metadata-eval86.2%
Simplified86.2%
Taylor expanded in z around inf 83.1%
if -0.5 < z < 9.7999999999999999e-203Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 56.4%
sub-neg56.4%
distribute-rgt-in56.4%
metadata-eval56.4%
distribute-lft-neg-in56.4%
associate-+r+56.4%
metadata-eval56.4%
distribute-rgt-neg-in56.4%
metadata-eval56.4%
Simplified56.4%
Taylor expanded in z around 0 54.9%
*-commutative54.9%
Simplified54.9%
if 9.7999999999999999e-203 < z < 0.650000000000000022Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around 0 98.0%
Taylor expanded in x around 0 54.0%
*-commutative54.0%
Simplified54.0%
Final simplification59.4%
(FPCore (x y z)
:precision binary64
(if (<= z -1.2e+37)
(* z (* y -6.0))
(if (<= z -0.00084)
(* x (* z (- 6.0 (/ 3.0 z))))
(if (<= z 5.4e-8) (+ (* y 4.0) (* x -3.0)) (* y (+ 4.0 (* z -6.0)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.2e+37) {
tmp = z * (y * -6.0);
} else if (z <= -0.00084) {
tmp = x * (z * (6.0 - (3.0 / z)));
} else if (z <= 5.4e-8) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.2d+37)) then
tmp = z * (y * (-6.0d0))
else if (z <= (-0.00084d0)) then
tmp = x * (z * (6.0d0 - (3.0d0 / z)))
else if (z <= 5.4d-8) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.2e+37) {
tmp = z * (y * -6.0);
} else if (z <= -0.00084) {
tmp = x * (z * (6.0 - (3.0 / z)));
} else if (z <= 5.4e-8) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.2e+37: tmp = z * (y * -6.0) elif z <= -0.00084: tmp = x * (z * (6.0 - (3.0 / z))) elif z <= 5.4e-8: tmp = (y * 4.0) + (x * -3.0) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.2e+37) tmp = Float64(z * Float64(y * -6.0)); elseif (z <= -0.00084) tmp = Float64(x * Float64(z * Float64(6.0 - Float64(3.0 / z)))); elseif (z <= 5.4e-8) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.2e+37) tmp = z * (y * -6.0); elseif (z <= -0.00084) tmp = x * (z * (6.0 - (3.0 / z))); elseif (z <= 5.4e-8) tmp = (y * 4.0) + (x * -3.0); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.2e+37], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.00084], N[(x * N[(z * N[(6.0 - N[(3.0 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e-8], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+37}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\mathbf{elif}\;z \leq -0.00084:\\
\;\;\;\;x \cdot \left(z \cdot \left(6 - \frac{3}{z}\right)\right)\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-8}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if z < -1.2e37Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 96.2%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around inf 68.5%
*-commutative68.5%
*-commutative68.5%
associate-*r*68.5%
*-commutative68.5%
Simplified68.5%
if -1.2e37 < z < -8.4000000000000003e-4Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 85.2%
sub-neg85.2%
distribute-rgt-in85.2%
metadata-eval85.2%
distribute-lft-neg-in85.2%
associate-+r+85.2%
metadata-eval85.2%
distribute-rgt-neg-in85.2%
metadata-eval85.2%
Simplified85.2%
Taylor expanded in z around inf 85.2%
associate-*r/85.2%
metadata-eval85.2%
Simplified85.2%
if -8.4000000000000003e-4 < z < 5.40000000000000005e-8Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 98.3%
if 5.40000000000000005e-8 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-define99.6%
sub-neg99.6%
distribute-rgt-in99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-out99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 60.5%
Final simplification83.3%
(FPCore (x y z)
:precision binary64
(if (<= z -1.9e+40)
(* z (* y -6.0))
(if (<= z -0.0008)
(* x (+ -3.0 (* z 6.0)))
(if (<= z 7.5e-6) (+ (* y 4.0) (* x -3.0)) (* y (+ 4.0 (* z -6.0)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.9e+40) {
tmp = z * (y * -6.0);
} else if (z <= -0.0008) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 7.5e-6) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.9d+40)) then
tmp = z * (y * (-6.0d0))
else if (z <= (-0.0008d0)) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else if (z <= 7.5d-6) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.9e+40) {
tmp = z * (y * -6.0);
} else if (z <= -0.0008) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 7.5e-6) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.9e+40: tmp = z * (y * -6.0) elif z <= -0.0008: tmp = x * (-3.0 + (z * 6.0)) elif z <= 7.5e-6: tmp = (y * 4.0) + (x * -3.0) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.9e+40) tmp = Float64(z * Float64(y * -6.0)); elseif (z <= -0.0008) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); elseif (z <= 7.5e-6) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.9e+40) tmp = z * (y * -6.0); elseif (z <= -0.0008) tmp = x * (-3.0 + (z * 6.0)); elseif (z <= 7.5e-6) tmp = (y * 4.0) + (x * -3.0); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.9e+40], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.0008], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e-6], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+40}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\mathbf{elif}\;z \leq -0.0008:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-6}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if z < -1.90000000000000002e40Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 96.2%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around inf 68.5%
*-commutative68.5%
*-commutative68.5%
associate-*r*68.5%
*-commutative68.5%
Simplified68.5%
if -1.90000000000000002e40 < z < -8.00000000000000038e-4Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 85.2%
sub-neg85.2%
distribute-rgt-in85.2%
metadata-eval85.2%
distribute-lft-neg-in85.2%
associate-+r+85.2%
metadata-eval85.2%
distribute-rgt-neg-in85.2%
metadata-eval85.2%
Simplified85.2%
if -8.00000000000000038e-4 < z < 7.50000000000000019e-6Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 98.3%
if 7.50000000000000019e-6 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-define99.6%
sub-neg99.6%
distribute-rgt-in99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-out99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 60.5%
Final simplification83.3%
(FPCore (x y z)
:precision binary64
(if (<= z -5e+38)
(* z (* y -6.0))
(if (<= z -0.0008)
(* x (+ -3.0 (* z 6.0)))
(if (<= z 1.1e-9) (+ x (* (- y x) 4.0)) (* y (+ 4.0 (* z -6.0)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5e+38) {
tmp = z * (y * -6.0);
} else if (z <= -0.0008) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 1.1e-9) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-5d+38)) then
tmp = z * (y * (-6.0d0))
else if (z <= (-0.0008d0)) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else if (z <= 1.1d-9) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5e+38) {
tmp = z * (y * -6.0);
} else if (z <= -0.0008) {
tmp = x * (-3.0 + (z * 6.0));
} else if (z <= 1.1e-9) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5e+38: tmp = z * (y * -6.0) elif z <= -0.0008: tmp = x * (-3.0 + (z * 6.0)) elif z <= 1.1e-9: tmp = x + ((y - x) * 4.0) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5e+38) tmp = Float64(z * Float64(y * -6.0)); elseif (z <= -0.0008) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); elseif (z <= 1.1e-9) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5e+38) tmp = z * (y * -6.0); elseif (z <= -0.0008) tmp = x * (-3.0 + (z * 6.0)); elseif (z <= 1.1e-9) tmp = x + ((y - x) * 4.0); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5e+38], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -0.0008], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e-9], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+38}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\mathbf{elif}\;z \leq -0.0008:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-9}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if z < -4.9999999999999997e38Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 96.2%
Taylor expanded in z around inf 99.8%
Taylor expanded in y around inf 68.5%
*-commutative68.5%
*-commutative68.5%
associate-*r*68.5%
*-commutative68.5%
Simplified68.5%
if -4.9999999999999997e38 < z < -8.00000000000000038e-4Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 85.2%
sub-neg85.2%
distribute-rgt-in85.2%
metadata-eval85.2%
distribute-lft-neg-in85.2%
associate-+r+85.2%
metadata-eval85.2%
distribute-rgt-neg-in85.2%
metadata-eval85.2%
Simplified85.2%
if -8.00000000000000038e-4 < z < 1.0999999999999999e-9Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 98.3%
if 1.0999999999999999e-9 < z Initial program 99.7%
+-commutative99.7%
associate-*l*99.7%
fma-define99.6%
sub-neg99.6%
distribute-rgt-in99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-out99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around inf 60.5%
Final simplification83.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))))
(if (<= x -1.05e-214)
t_0
(if (<= x 3.8e-270) (* -6.0 (* y z)) (if (<= x 3.6e-98) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -1.05e-214) {
tmp = t_0;
} else if (x <= 3.8e-270) {
tmp = -6.0 * (y * z);
} else if (x <= 3.6e-98) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * ((-3.0d0) + (z * 6.0d0))
if (x <= (-1.05d-214)) then
tmp = t_0
else if (x <= 3.8d-270) then
tmp = (-6.0d0) * (y * z)
else if (x <= 3.6d-98) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -1.05e-214) {
tmp = t_0;
} else if (x <= 3.8e-270) {
tmp = -6.0 * (y * z);
} else if (x <= 3.6e-98) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) tmp = 0 if x <= -1.05e-214: tmp = t_0 elif x <= 3.8e-270: tmp = -6.0 * (y * z) elif x <= 3.6e-98: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) tmp = 0.0 if (x <= -1.05e-214) tmp = t_0; elseif (x <= 3.8e-270) tmp = Float64(-6.0 * Float64(y * z)); elseif (x <= 3.6e-98) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); tmp = 0.0; if (x <= -1.05e-214) tmp = t_0; elseif (x <= 3.8e-270) tmp = -6.0 * (y * z); elseif (x <= 3.6e-98) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e-214], t$95$0, If[LessEqual[x, 3.8e-270], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.6e-98], N[(y * 4.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{-214}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-270}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-98}:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.04999999999999996e-214 or 3.6000000000000002e-98 < x Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 67.0%
sub-neg67.0%
distribute-rgt-in67.0%
metadata-eval67.0%
distribute-lft-neg-in67.0%
associate-+r+67.0%
metadata-eval67.0%
distribute-rgt-neg-in67.0%
metadata-eval67.0%
Simplified67.0%
if -1.04999999999999996e-214 < x < 3.80000000000000041e-270Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around inf 59.1%
Taylor expanded in y around inf 58.1%
*-commutative58.1%
Simplified58.1%
if 3.80000000000000041e-270 < x < 3.6000000000000002e-98Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 57.0%
Taylor expanded in x around 0 52.0%
*-commutative52.0%
Simplified52.0%
Final simplification63.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -5.5e+23)
t_0
(if (<= z 1.02e-202) (* x -3.0) (if (<= z 0.65) (* y 4.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -5.5e+23) {
tmp = t_0;
} else if (z <= 1.02e-202) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-5.5d+23)) then
tmp = t_0
else if (z <= 1.02d-202) then
tmp = x * (-3.0d0)
else if (z <= 0.65d0) then
tmp = y * 4.0d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -5.5e+23) {
tmp = t_0;
} else if (z <= 1.02e-202) {
tmp = x * -3.0;
} else if (z <= 0.65) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -5.5e+23: tmp = t_0 elif z <= 1.02e-202: tmp = x * -3.0 elif z <= 0.65: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -5.5e+23) tmp = t_0; elseif (z <= 1.02e-202) tmp = Float64(x * -3.0); elseif (z <= 0.65) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -5.5e+23) tmp = t_0; elseif (z <= 1.02e-202) tmp = x * -3.0; elseif (z <= 0.65) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+23], t$95$0, If[LessEqual[z, 1.02e-202], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.65], N[(y * 4.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+23}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{-202}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -5.50000000000000004e23 or 0.650000000000000022 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 96.2%
Taylor expanded in z around inf 99.0%
Taylor expanded in y around inf 62.2%
*-commutative62.2%
Simplified62.2%
if -5.50000000000000004e23 < z < 1.01999999999999997e-202Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 57.3%
sub-neg57.3%
distribute-rgt-in57.3%
metadata-eval57.3%
distribute-lft-neg-in57.3%
associate-+r+57.3%
metadata-eval57.3%
distribute-rgt-neg-in57.3%
metadata-eval57.3%
Simplified57.3%
Taylor expanded in z around 0 54.0%
*-commutative54.0%
Simplified54.0%
if 1.01999999999999997e-202 < z < 0.650000000000000022Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 99.7%
Taylor expanded in z around 0 98.0%
Taylor expanded in x around 0 54.0%
*-commutative54.0%
Simplified54.0%
Final simplification57.7%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.58) (not (<= z 0.55))) (* z (+ (* y -6.0) (* x 6.0))) (+ (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.55)) {
tmp = z * ((y * -6.0) + (x * 6.0));
} else {
tmp = (y * 4.0) + (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 <= (-0.58d0)) .or. (.not. (z <= 0.55d0))) then
tmp = z * ((y * (-6.0d0)) + (x * 6.0d0))
else
tmp = (y * 4.0d0) + (x * (-3.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.55)) {
tmp = z * ((y * -6.0) + (x * 6.0));
} else {
tmp = (y * 4.0) + (x * -3.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.58) or not (z <= 0.55): tmp = z * ((y * -6.0) + (x * 6.0)) else: tmp = (y * 4.0) + (x * -3.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.58) || !(z <= 0.55)) tmp = Float64(z * Float64(Float64(y * -6.0) + Float64(x * 6.0))); else tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.58) || ~((z <= 0.55))) tmp = z * ((y * -6.0) + (x * 6.0)); else tmp = (y * 4.0) + (x * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.58], N[Not[LessEqual[z, 0.55]], $MachinePrecision]], N[(z * N[(N[(y * -6.0), $MachinePrecision] + N[(x * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58 \lor \neg \left(z \leq 0.55\right):\\
\;\;\;\;z \cdot \left(y \cdot -6 + x \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\end{array}
\end{array}
if z < -0.57999999999999996 or 0.55000000000000004 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 96.2%
Taylor expanded in z around inf 98.8%
if -0.57999999999999996 < z < 0.55000000000000004Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 96.7%
Final simplification97.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -5.8e+128) (not (<= x 3.1e-46))) (* x (+ -3.0 (* z 6.0))) (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -5.8e+128) || !(x <= 3.1e-46)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-5.8d+128)) .or. (.not. (x <= 3.1d-46))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -5.8e+128) || !(x <= 3.1e-46)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -5.8e+128) or not (x <= 3.1e-46): tmp = x * (-3.0 + (z * 6.0)) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -5.8e+128) || !(x <= 3.1e-46)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -5.8e+128) || ~((x <= 3.1e-46))) tmp = x * (-3.0 + (z * 6.0)); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.8e+128], N[Not[LessEqual[x, 3.1e-46]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{+128} \lor \neg \left(x \leq 3.1 \cdot 10^{-46}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -5.8000000000000001e128 or 3.1000000000000001e-46 < x Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 83.7%
sub-neg83.7%
distribute-rgt-in83.7%
metadata-eval83.7%
distribute-lft-neg-in83.7%
associate-+r+83.7%
metadata-eval83.7%
distribute-rgt-neg-in83.7%
metadata-eval83.7%
Simplified83.7%
if -5.8000000000000001e128 < x < 3.1000000000000001e-46Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 76.2%
Final simplification79.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.15e-78) (not (<= x 7.2e-93))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.15e-78) || !(x <= 7.2e-93)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-2.15d-78)) .or. (.not. (x <= 7.2d-93))) then
tmp = x * (-3.0d0)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2.15e-78) || !(x <= 7.2e-93)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.15e-78) or not (x <= 7.2e-93): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.15e-78) || !(x <= 7.2e-93)) tmp = Float64(x * -3.0); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.15e-78) || ~((x <= 7.2e-93))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.15e-78], N[Not[LessEqual[x, 7.2e-93]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.15 \cdot 10^{-78} \lor \neg \left(x \leq 7.2 \cdot 10^{-93}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -2.14999999999999997e-78 or 7.2000000000000003e-93 < x Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 72.1%
sub-neg72.1%
distribute-rgt-in72.1%
metadata-eval72.1%
distribute-lft-neg-in72.1%
associate-+r+72.1%
metadata-eval72.1%
distribute-rgt-neg-in72.1%
metadata-eval72.1%
Simplified72.1%
Taylor expanded in z around 0 41.6%
*-commutative41.6%
Simplified41.6%
if -2.14999999999999997e-78 < x < 7.2000000000000003e-93Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 54.6%
Taylor expanded in x around 0 45.6%
*-commutative45.6%
Simplified45.6%
Final simplification43.2%
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- 0.6666666666666666 z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * (0.6666666666666666 - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * (0.6666666666666666d0 - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * (0.6666666666666666 - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * (0.6666666666666666 - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(0.6666666666666666 - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * (0.6666666666666666 - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(0.6666666666666666 - z\right)
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 50.2%
sub-neg50.2%
distribute-rgt-in50.2%
metadata-eval50.2%
distribute-lft-neg-in50.2%
associate-+r+50.2%
metadata-eval50.2%
distribute-rgt-neg-in50.2%
metadata-eval50.2%
Simplified50.2%
Taylor expanded in z around 0 29.7%
*-commutative29.7%
Simplified29.7%
herbie shell --seed 2024118
(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))))