
(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) (+ 4.0 (* z -6.0)) x))
double code(double x, double y, double z) {
return fma((y - x), (4.0 + (z * -6.0)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(4.0 + Float64(z * -6.0)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))) (t_1 (+ x (* y 4.0))) (t_2 (* x (* z 6.0))))
(if (<= z -2.4e+121)
t_0
(if (<= z -7.6e+74)
t_2
(if (<= z -18000000.0)
t_0
(if (<= z -1.3e-111)
(* x -3.0)
(if (<= z -8e-181)
t_1
(if (<= z -2.9e-270)
(* x -3.0)
(if (<= z 2e-217) t_1 (if (<= z 0.065) (* x -3.0) t_2))))))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double t_1 = x + (y * 4.0);
double t_2 = x * (z * 6.0);
double tmp;
if (z <= -2.4e+121) {
tmp = t_0;
} else if (z <= -7.6e+74) {
tmp = t_2;
} else if (z <= -18000000.0) {
tmp = t_0;
} else if (z <= -1.3e-111) {
tmp = x * -3.0;
} else if (z <= -8e-181) {
tmp = t_1;
} else if (z <= -2.9e-270) {
tmp = x * -3.0;
} else if (z <= 2e-217) {
tmp = t_1;
} else if (z <= 0.065) {
tmp = x * -3.0;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
t_1 = x + (y * 4.0d0)
t_2 = x * (z * 6.0d0)
if (z <= (-2.4d+121)) then
tmp = t_0
else if (z <= (-7.6d+74)) then
tmp = t_2
else if (z <= (-18000000.0d0)) then
tmp = t_0
else if (z <= (-1.3d-111)) then
tmp = x * (-3.0d0)
else if (z <= (-8d-181)) then
tmp = t_1
else if (z <= (-2.9d-270)) then
tmp = x * (-3.0d0)
else if (z <= 2d-217) then
tmp = t_1
else if (z <= 0.065d0) then
tmp = x * (-3.0d0)
else
tmp = t_2
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 t_2 = x * (z * 6.0);
double tmp;
if (z <= -2.4e+121) {
tmp = t_0;
} else if (z <= -7.6e+74) {
tmp = t_2;
} else if (z <= -18000000.0) {
tmp = t_0;
} else if (z <= -1.3e-111) {
tmp = x * -3.0;
} else if (z <= -8e-181) {
tmp = t_1;
} else if (z <= -2.9e-270) {
tmp = x * -3.0;
} else if (z <= 2e-217) {
tmp = t_1;
} else if (z <= 0.065) {
tmp = x * -3.0;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) t_1 = x + (y * 4.0) t_2 = x * (z * 6.0) tmp = 0 if z <= -2.4e+121: tmp = t_0 elif z <= -7.6e+74: tmp = t_2 elif z <= -18000000.0: tmp = t_0 elif z <= -1.3e-111: tmp = x * -3.0 elif z <= -8e-181: tmp = t_1 elif z <= -2.9e-270: tmp = x * -3.0 elif z <= 2e-217: tmp = t_1 elif z <= 0.065: tmp = x * -3.0 else: tmp = t_2 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) t_1 = Float64(x + Float64(y * 4.0)) t_2 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -2.4e+121) tmp = t_0; elseif (z <= -7.6e+74) tmp = t_2; elseif (z <= -18000000.0) tmp = t_0; elseif (z <= -1.3e-111) tmp = Float64(x * -3.0); elseif (z <= -8e-181) tmp = t_1; elseif (z <= -2.9e-270) tmp = Float64(x * -3.0); elseif (z <= 2e-217) tmp = t_1; elseif (z <= 0.065) tmp = Float64(x * -3.0); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); t_1 = x + (y * 4.0); t_2 = x * (z * 6.0); tmp = 0.0; if (z <= -2.4e+121) tmp = t_0; elseif (z <= -7.6e+74) tmp = t_2; elseif (z <= -18000000.0) tmp = t_0; elseif (z <= -1.3e-111) tmp = x * -3.0; elseif (z <= -8e-181) tmp = t_1; elseif (z <= -2.9e-270) tmp = x * -3.0; elseif (z <= 2e-217) tmp = t_1; elseif (z <= 0.065) tmp = x * -3.0; else tmp = t_2; 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]}, Block[{t$95$2 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+121], t$95$0, If[LessEqual[z, -7.6e+74], t$95$2, If[LessEqual[z, -18000000.0], t$95$0, If[LessEqual[z, -1.3e-111], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -8e-181], t$95$1, If[LessEqual[z, -2.9e-270], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2e-217], t$95$1, If[LessEqual[z, 0.065], N[(x * -3.0), $MachinePrecision], t$95$2]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
t_1 := x + y \cdot 4\\
t_2 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+121}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -7.6 \cdot 10^{+74}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -18000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-111}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-181}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-270}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-217}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.065:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -2.4e121 or -7.5999999999999997e74 < z < -1.8e7Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 99.1%
Taylor expanded in y around inf 62.7%
*-commutative62.7%
Simplified62.7%
if -2.4e121 < z < -7.5999999999999997e74 or 0.065000000000000002 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 59.7%
sub-neg59.7%
distribute-rgt-in59.7%
metadata-eval59.7%
distribute-lft-neg-in59.7%
associate-+r+59.7%
metadata-eval59.7%
distribute-rgt-neg-in59.7%
metadata-eval59.7%
Simplified59.7%
Taylor expanded in z around inf 59.5%
if -1.8e7 < z < -1.29999999999999991e-111 or -8.00000000000000038e-181 < z < -2.89999999999999983e-270 or 2.00000000000000016e-217 < z < 0.065000000000000002Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 63.3%
sub-neg63.3%
distribute-rgt-in63.3%
metadata-eval63.3%
distribute-lft-neg-in63.3%
associate-+r+63.3%
metadata-eval63.3%
distribute-rgt-neg-in63.3%
metadata-eval63.3%
Simplified63.3%
Taylor expanded in z around 0 61.1%
*-commutative61.1%
Simplified61.1%
if -1.29999999999999991e-111 < z < -8.00000000000000038e-181 or -2.89999999999999983e-270 < z < 2.00000000000000016e-217Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 68.9%
associate-*r*68.8%
Simplified68.8%
Taylor expanded in z around 0 69.2%
*-commutative69.2%
Simplified69.2%
Final simplification62.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* y 4.0))) (t_1 (* -6.0 (* (- y x) z))))
(if (<= z -0.0146)
t_1
(if (<= z -1.45e-111)
(* x -3.0)
(if (<= z -7.8e-181)
t_0
(if (<= z -5.5e-271)
(* x -3.0)
(if (<= z 2.2e-216) t_0 (if (<= z 0.5) (* x -3.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.0146) {
tmp = t_1;
} else if (z <= -1.45e-111) {
tmp = x * -3.0;
} else if (z <= -7.8e-181) {
tmp = t_0;
} else if (z <= -5.5e-271) {
tmp = x * -3.0;
} else if (z <= 2.2e-216) {
tmp = t_0;
} else if (z <= 0.5) {
tmp = x * -3.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.0146d0)) then
tmp = t_1
else if (z <= (-1.45d-111)) then
tmp = x * (-3.0d0)
else if (z <= (-7.8d-181)) then
tmp = t_0
else if (z <= (-5.5d-271)) then
tmp = x * (-3.0d0)
else if (z <= 2.2d-216) then
tmp = t_0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
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.0146) {
tmp = t_1;
} else if (z <= -1.45e-111) {
tmp = x * -3.0;
} else if (z <= -7.8e-181) {
tmp = t_0;
} else if (z <= -5.5e-271) {
tmp = x * -3.0;
} else if (z <= 2.2e-216) {
tmp = t_0;
} else if (z <= 0.5) {
tmp = x * -3.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.0146: tmp = t_1 elif z <= -1.45e-111: tmp = x * -3.0 elif z <= -7.8e-181: tmp = t_0 elif z <= -5.5e-271: tmp = x * -3.0 elif z <= 2.2e-216: tmp = t_0 elif z <= 0.5: tmp = x * -3.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.0146) tmp = t_1; elseif (z <= -1.45e-111) tmp = Float64(x * -3.0); elseif (z <= -7.8e-181) tmp = t_0; elseif (z <= -5.5e-271) tmp = Float64(x * -3.0); elseif (z <= 2.2e-216) tmp = t_0; elseif (z <= 0.5) tmp = Float64(x * -3.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.0146) tmp = t_1; elseif (z <= -1.45e-111) tmp = x * -3.0; elseif (z <= -7.8e-181) tmp = t_0; elseif (z <= -5.5e-271) tmp = x * -3.0; elseif (z <= 2.2e-216) tmp = t_0; elseif (z <= 0.5) tmp = x * -3.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.0146], t$95$1, If[LessEqual[z, -1.45e-111], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -7.8e-181], t$95$0, If[LessEqual[z, -5.5e-271], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.2e-216], t$95$0, If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], 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.0146:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-111}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-181}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-271}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-216}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.0146000000000000001 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 98.6%
if -0.0146000000000000001 < z < -1.45000000000000001e-111 or -7.800000000000001e-181 < z < -5.4999999999999996e-271 or 2.1999999999999999e-216 < z < 0.5Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 62.2%
sub-neg62.2%
distribute-rgt-in62.2%
metadata-eval62.2%
distribute-lft-neg-in62.2%
associate-+r+62.2%
metadata-eval62.2%
distribute-rgt-neg-in62.2%
metadata-eval62.2%
Simplified62.2%
Taylor expanded in z around 0 61.0%
*-commutative61.0%
Simplified61.0%
if -1.45000000000000001e-111 < z < -7.800000000000001e-181 or -5.4999999999999996e-271 < z < 2.1999999999999999e-216Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 68.9%
associate-*r*68.8%
Simplified68.8%
Taylor expanded in z around 0 69.2%
*-commutative69.2%
Simplified69.2%
Final simplification80.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* y (- 0.6666666666666666 z))))
(t_1 (* -6.0 (* (- y x) z))))
(if (<= z -0.0096)
t_1
(if (<= z -3e-111)
(* x -3.0)
(if (<= z -1.2e-180)
t_0
(if (<= z -2.25e-240)
(* x -3.0)
(if (<= z 3.6e-216) t_0 (if (<= z 0.5) (* x -3.0) t_1))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.0096) {
tmp = t_1;
} else if (z <= -3e-111) {
tmp = x * -3.0;
} else if (z <= -1.2e-180) {
tmp = t_0;
} else if (z <= -2.25e-240) {
tmp = x * -3.0;
} else if (z <= 3.6e-216) {
tmp = t_0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 6.0d0 * (y * (0.6666666666666666d0 - z))
t_1 = (-6.0d0) * ((y - x) * z)
if (z <= (-0.0096d0)) then
tmp = t_1
else if (z <= (-3d-111)) then
tmp = x * (-3.0d0)
else if (z <= (-1.2d-180)) then
tmp = t_0
else if (z <= (-2.25d-240)) then
tmp = x * (-3.0d0)
else if (z <= 3.6d-216) then
tmp = t_0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (y * (0.6666666666666666 - z));
double t_1 = -6.0 * ((y - x) * z);
double tmp;
if (z <= -0.0096) {
tmp = t_1;
} else if (z <= -3e-111) {
tmp = x * -3.0;
} else if (z <= -1.2e-180) {
tmp = t_0;
} else if (z <= -2.25e-240) {
tmp = x * -3.0;
} else if (z <= 3.6e-216) {
tmp = t_0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (y * (0.6666666666666666 - z)) t_1 = -6.0 * ((y - x) * z) tmp = 0 if z <= -0.0096: tmp = t_1 elif z <= -3e-111: tmp = x * -3.0 elif z <= -1.2e-180: tmp = t_0 elif z <= -2.25e-240: tmp = x * -3.0 elif z <= 3.6e-216: tmp = t_0 elif z <= 0.5: tmp = x * -3.0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))) t_1 = Float64(-6.0 * Float64(Float64(y - x) * z)) tmp = 0.0 if (z <= -0.0096) tmp = t_1; elseif (z <= -3e-111) tmp = Float64(x * -3.0); elseif (z <= -1.2e-180) tmp = t_0; elseif (z <= -2.25e-240) tmp = Float64(x * -3.0); elseif (z <= 3.6e-216) tmp = t_0; elseif (z <= 0.5) tmp = Float64(x * -3.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (y * (0.6666666666666666 - z)); t_1 = -6.0 * ((y - x) * z); tmp = 0.0; if (z <= -0.0096) tmp = t_1; elseif (z <= -3e-111) tmp = x * -3.0; elseif (z <= -1.2e-180) tmp = t_0; elseif (z <= -2.25e-240) tmp = x * -3.0; elseif (z <= 3.6e-216) tmp = t_0; elseif (z <= 0.5) tmp = x * -3.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.0096], t$95$1, If[LessEqual[z, -3e-111], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.2e-180], t$95$0, If[LessEqual[z, -2.25e-240], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.6e-216], t$95$0, If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
t_1 := -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{if}\;z \leq -0.0096:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-111}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-180}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{-240}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-216}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.00959999999999999916 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 98.6%
if -0.00959999999999999916 < z < -3.00000000000000008e-111 or -1.1999999999999999e-180 < z < -2.2500000000000001e-240 or 3.5999999999999999e-216 < z < 0.5Initial program 99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in x around inf 63.6%
sub-neg63.6%
distribute-rgt-in63.6%
metadata-eval63.6%
distribute-lft-neg-in63.6%
associate-+r+63.6%
metadata-eval63.6%
distribute-rgt-neg-in63.6%
metadata-eval63.6%
Simplified63.6%
Taylor expanded in z around 0 62.2%
*-commutative62.2%
Simplified62.2%
if -3.00000000000000008e-111 < z < -1.1999999999999999e-180 or -2.2500000000000001e-240 < z < 3.5999999999999999e-216Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 93.7%
Taylor expanded in y around inf 66.0%
*-commutative66.0%
Simplified66.0%
Final simplification80.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))))
(if (<= x -1e+73)
t_0
(if (<= x -7.6e-9)
(* -6.0 (* (- y x) z))
(if (or (<= x -5.3e-108) (not (<= x 3e-5)))
t_0
(* 6.0 (* y (- 0.6666666666666666 z))))))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -1e+73) {
tmp = t_0;
} else if (x <= -7.6e-9) {
tmp = -6.0 * ((y - x) * z);
} else if ((x <= -5.3e-108) || !(x <= 3e-5)) {
tmp = t_0;
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x * ((-3.0d0) + (z * 6.0d0))
if (x <= (-1d+73)) then
tmp = t_0
else if (x <= (-7.6d-9)) then
tmp = (-6.0d0) * ((y - x) * z)
else if ((x <= (-5.3d-108)) .or. (.not. (x <= 3d-5))) then
tmp = t_0
else
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -1e+73) {
tmp = t_0;
} else if (x <= -7.6e-9) {
tmp = -6.0 * ((y - x) * z);
} else if ((x <= -5.3e-108) || !(x <= 3e-5)) {
tmp = t_0;
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) tmp = 0 if x <= -1e+73: tmp = t_0 elif x <= -7.6e-9: tmp = -6.0 * ((y - x) * z) elif (x <= -5.3e-108) or not (x <= 3e-5): tmp = t_0 else: tmp = 6.0 * (y * (0.6666666666666666 - z)) return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) tmp = 0.0 if (x <= -1e+73) tmp = t_0; elseif (x <= -7.6e-9) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif ((x <= -5.3e-108) || !(x <= 3e-5)) tmp = t_0; else tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); tmp = 0.0; if (x <= -1e+73) tmp = t_0; elseif (x <= -7.6e-9) tmp = -6.0 * ((y - x) * z); elseif ((x <= -5.3e-108) || ~((x <= 3e-5))) tmp = t_0; else tmp = 6.0 * (y * (0.6666666666666666 - z)); 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, -1e+73], t$95$0, If[LessEqual[x, -7.6e-9], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -5.3e-108], N[Not[LessEqual[x, 3e-5]], $MachinePrecision]], t$95$0, N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{if}\;x \leq -1 \cdot 10^{+73}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -7.6 \cdot 10^{-9}:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;x \leq -5.3 \cdot 10^{-108} \lor \neg \left(x \leq 3 \cdot 10^{-5}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -9.99999999999999983e72 or -7.60000000000000023e-9 < x < -5.29999999999999989e-108 or 3.00000000000000008e-5 < x Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 77.8%
sub-neg77.8%
distribute-rgt-in77.8%
metadata-eval77.8%
distribute-lft-neg-in77.8%
associate-+r+77.8%
metadata-eval77.8%
distribute-rgt-neg-in77.8%
metadata-eval77.8%
Simplified77.8%
if -9.99999999999999983e72 < x < -7.60000000000000023e-9Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 76.5%
if -5.29999999999999989e-108 < x < 3.00000000000000008e-5Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 97.7%
Taylor expanded in y around inf 84.7%
*-commutative84.7%
Simplified84.7%
Final simplification80.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))))
(if (<= x -1.4e+74)
t_0
(if (<= x -9e-10)
(* -6.0 (* (- y x) z))
(if (or (<= x -3.1e-37) (not (<= x 3.8e-5)))
t_0
(* y (+ 4.0 (* z -6.0))))))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -1.4e+74) {
tmp = t_0;
} else if (x <= -9e-10) {
tmp = -6.0 * ((y - x) * z);
} else if ((x <= -3.1e-37) || !(x <= 3.8e-5)) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = x * ((-3.0d0) + (z * 6.0d0))
if (x <= (-1.4d+74)) then
tmp = t_0
else if (x <= (-9d-10)) then
tmp = (-6.0d0) * ((y - x) * z)
else if ((x <= (-3.1d-37)) .or. (.not. (x <= 3.8d-5))) then
tmp = t_0
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 t_0 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -1.4e+74) {
tmp = t_0;
} else if (x <= -9e-10) {
tmp = -6.0 * ((y - x) * z);
} else if ((x <= -3.1e-37) || !(x <= 3.8e-5)) {
tmp = t_0;
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) tmp = 0 if x <= -1.4e+74: tmp = t_0 elif x <= -9e-10: tmp = -6.0 * ((y - x) * z) elif (x <= -3.1e-37) or not (x <= 3.8e-5): tmp = t_0 else: tmp = y * (4.0 + (z * -6.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.4e+74) tmp = t_0; elseif (x <= -9e-10) tmp = Float64(-6.0 * Float64(Float64(y - x) * z)); elseif ((x <= -3.1e-37) || !(x <= 3.8e-5)) tmp = t_0; else tmp = Float64(y * Float64(4.0 + Float64(z * -6.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.4e+74) tmp = t_0; elseif (x <= -9e-10) tmp = -6.0 * ((y - x) * z); elseif ((x <= -3.1e-37) || ~((x <= 3.8e-5))) tmp = t_0; else tmp = y * (4.0 + (z * -6.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.4e+74], t$95$0, If[LessEqual[x, -9e-10], N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -3.1e-37], N[Not[LessEqual[x, 3.8e-5]], $MachinePrecision]], t$95$0, N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{+74}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -9 \cdot 10^{-10}:\\
\;\;\;\;-6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;x \leq -3.1 \cdot 10^{-37} \lor \neg \left(x \leq 3.8 \cdot 10^{-5}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -1.40000000000000001e74 or -8.9999999999999999e-10 < x < -3.09999999999999993e-37 or 3.8000000000000002e-5 < x Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 81.3%
sub-neg81.3%
distribute-rgt-in81.3%
metadata-eval81.3%
distribute-lft-neg-in81.3%
associate-+r+81.3%
metadata-eval81.3%
distribute-rgt-neg-in81.3%
metadata-eval81.3%
Simplified81.3%
if -1.40000000000000001e74 < x < -8.9999999999999999e-10Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 76.5%
if -3.09999999999999993e-37 < x < 3.8000000000000002e-5Initial program 99.6%
+-commutative99.6%
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 80.3%
Final simplification80.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))) (t_1 (* 6.0 (* x z))))
(if (<= z -7.2e+118)
t_0
(if (<= z -9.5e+74)
t_1
(if (<= z -18000000.0) t_0 (if (<= z 0.065) (* x -3.0) t_1))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double t_1 = 6.0 * (x * z);
double tmp;
if (z <= -7.2e+118) {
tmp = t_0;
} else if (z <= -9.5e+74) {
tmp = t_1;
} else if (z <= -18000000.0) {
tmp = t_0;
} else if (z <= 0.065) {
tmp = x * -3.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
t_1 = 6.0d0 * (x * z)
if (z <= (-7.2d+118)) then
tmp = t_0
else if (z <= (-9.5d+74)) then
tmp = t_1
else if (z <= (-18000000.0d0)) then
tmp = t_0
else if (z <= 0.065d0) then
tmp = x * (-3.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double t_1 = 6.0 * (x * z);
double tmp;
if (z <= -7.2e+118) {
tmp = t_0;
} else if (z <= -9.5e+74) {
tmp = t_1;
} else if (z <= -18000000.0) {
tmp = t_0;
} else if (z <= 0.065) {
tmp = x * -3.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) t_1 = 6.0 * (x * z) tmp = 0 if z <= -7.2e+118: tmp = t_0 elif z <= -9.5e+74: tmp = t_1 elif z <= -18000000.0: tmp = t_0 elif z <= 0.065: tmp = x * -3.0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) t_1 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -7.2e+118) tmp = t_0; elseif (z <= -9.5e+74) tmp = t_1; elseif (z <= -18000000.0) tmp = t_0; elseif (z <= 0.065) tmp = Float64(x * -3.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); t_1 = 6.0 * (x * z); tmp = 0.0; if (z <= -7.2e+118) tmp = t_0; elseif (z <= -9.5e+74) tmp = t_1; elseif (z <= -18000000.0) tmp = t_0; elseif (z <= 0.065) tmp = x * -3.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e+118], t$95$0, If[LessEqual[z, -9.5e+74], t$95$1, If[LessEqual[z, -18000000.0], t$95$0, If[LessEqual[z, 0.065], N[(x * -3.0), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
t_1 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+118}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -18000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.065:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.2e118 or -9.5000000000000006e74 < z < -1.8e7Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 99.1%
Taylor expanded in y around inf 62.7%
*-commutative62.7%
Simplified62.7%
if -7.2e118 < z < -9.5000000000000006e74 or 0.065000000000000002 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 97.2%
Taylor expanded in y around 0 59.4%
if -1.8e7 < z < 0.065000000000000002Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 53.6%
sub-neg53.6%
distribute-rgt-in53.6%
metadata-eval53.6%
distribute-lft-neg-in53.6%
associate-+r+53.6%
metadata-eval53.6%
distribute-rgt-neg-in53.6%
metadata-eval53.6%
Simplified53.6%
Taylor expanded in z around 0 52.1%
*-commutative52.1%
Simplified52.1%
Final simplification56.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))) (t_1 (* x (* z 6.0))))
(if (<= z -7.2e+123)
t_0
(if (<= z -8.5e+74)
t_1
(if (<= z -18000000.0) t_0 (if (<= z 0.065) (* x -3.0) t_1))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double t_1 = x * (z * 6.0);
double tmp;
if (z <= -7.2e+123) {
tmp = t_0;
} else if (z <= -8.5e+74) {
tmp = t_1;
} else if (z <= -18000000.0) {
tmp = t_0;
} else if (z <= 0.065) {
tmp = x * -3.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
t_1 = x * (z * 6.0d0)
if (z <= (-7.2d+123)) then
tmp = t_0
else if (z <= (-8.5d+74)) then
tmp = t_1
else if (z <= (-18000000.0d0)) then
tmp = t_0
else if (z <= 0.065d0) then
tmp = x * (-3.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double t_1 = x * (z * 6.0);
double tmp;
if (z <= -7.2e+123) {
tmp = t_0;
} else if (z <= -8.5e+74) {
tmp = t_1;
} else if (z <= -18000000.0) {
tmp = t_0;
} else if (z <= 0.065) {
tmp = x * -3.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) t_1 = x * (z * 6.0) tmp = 0 if z <= -7.2e+123: tmp = t_0 elif z <= -8.5e+74: tmp = t_1 elif z <= -18000000.0: tmp = t_0 elif z <= 0.065: tmp = x * -3.0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) t_1 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -7.2e+123) tmp = t_0; elseif (z <= -8.5e+74) tmp = t_1; elseif (z <= -18000000.0) tmp = t_0; elseif (z <= 0.065) tmp = Float64(x * -3.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); t_1 = x * (z * 6.0); tmp = 0.0; if (z <= -7.2e+123) tmp = t_0; elseif (z <= -8.5e+74) tmp = t_1; elseif (z <= -18000000.0) tmp = t_0; elseif (z <= 0.065) tmp = x * -3.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.2e+123], t$95$0, If[LessEqual[z, -8.5e+74], t$95$1, If[LessEqual[z, -18000000.0], t$95$0, If[LessEqual[z, 0.065], N[(x * -3.0), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
t_1 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+123}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -18000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.065:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.19999999999999996e123 or -8.50000000000000028e74 < z < -1.8e7Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 99.1%
Taylor expanded in y around inf 62.7%
*-commutative62.7%
Simplified62.7%
if -7.19999999999999996e123 < z < -8.50000000000000028e74 or 0.065000000000000002 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 59.7%
sub-neg59.7%
distribute-rgt-in59.7%
metadata-eval59.7%
distribute-lft-neg-in59.7%
associate-+r+59.7%
metadata-eval59.7%
distribute-rgt-neg-in59.7%
metadata-eval59.7%
Simplified59.7%
Taylor expanded in z around inf 59.5%
if -1.8e7 < z < 0.065000000000000002Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 53.6%
sub-neg53.6%
distribute-rgt-in53.6%
metadata-eval53.6%
distribute-lft-neg-in53.6%
associate-+r+53.6%
metadata-eval53.6%
distribute-rgt-neg-in53.6%
metadata-eval53.6%
Simplified53.6%
Taylor expanded in z around 0 52.1%
*-commutative52.1%
Simplified52.1%
Final simplification56.5%
(FPCore (x y z) :precision binary64 (if (<= z -0.56) (* (- y x) (* z -6.0)) (if (<= z 0.6) (- x (* 4.0 (- x y))) (+ x (* z (* 6.0 (- x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.56) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.6) {
tmp = x - (4.0 * (x - y));
} else {
tmp = x + (z * (6.0 * (x - y)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.56d0)) then
tmp = (y - x) * (z * (-6.0d0))
else if (z <= 0.6d0) then
tmp = x - (4.0d0 * (x - y))
else
tmp = x + (z * (6.0d0 * (x - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.56) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.6) {
tmp = x - (4.0 * (x - y));
} else {
tmp = x + (z * (6.0 * (x - y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.56: tmp = (y - x) * (z * -6.0) elif z <= 0.6: tmp = x - (4.0 * (x - y)) else: tmp = x + (z * (6.0 * (x - y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.56) tmp = Float64(Float64(y - x) * Float64(z * -6.0)); elseif (z <= 0.6) tmp = Float64(x - Float64(4.0 * Float64(x - y))); else tmp = Float64(x + Float64(z * Float64(6.0 * Float64(x - y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.56) tmp = (y - x) * (z * -6.0); elseif (z <= 0.6) tmp = x - (4.0 * (x - y)); else tmp = x + (z * (6.0 * (x - y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.56], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.6], N[(x - N[(4.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.56:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x - 4 \cdot \left(x - y\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(6 \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if z < -0.56000000000000005Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 98.6%
associate-*r*98.9%
*-commutative98.9%
Simplified98.9%
if -0.56000000000000005 < z < 0.599999999999999978Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 97.9%
if 0.599999999999999978 < z Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 98.8%
neg-mul-198.8%
Simplified98.8%
*-commutative98.8%
add-sqr-sqrt0.0%
sqrt-unprod0.6%
sqr-neg0.6%
sqrt-unprod0.6%
add-sqr-sqrt0.6%
cancel-sign-sub0.6%
add-sqr-sqrt0.0%
sqrt-unprod89.4%
sqr-neg89.4%
sqrt-unprod98.3%
add-sqr-sqrt98.8%
*-commutative98.8%
Applied egg-rr98.8%
Final simplification98.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.6) (not (<= z 0.54))) (* (- y x) (* z -6.0)) (- x (* 4.0 (- x y)))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.54)) {
tmp = (y - x) * (z * -6.0);
} else {
tmp = x - (4.0 * (x - y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-0.6d0)) .or. (.not. (z <= 0.54d0))) then
tmp = (y - x) * (z * (-6.0d0))
else
tmp = x - (4.0d0 * (x - y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.54)) {
tmp = (y - x) * (z * -6.0);
} else {
tmp = x - (4.0 * (x - y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.6) or not (z <= 0.54): tmp = (y - x) * (z * -6.0) else: tmp = x - (4.0 * (x - y)) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.6) || !(z <= 0.54)) tmp = Float64(Float64(y - x) * Float64(z * -6.0)); else tmp = Float64(x - Float64(4.0 * Float64(x - y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.6) || ~((z <= 0.54))) tmp = (y - x) * (z * -6.0); else tmp = x - (4.0 * (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.6], N[Not[LessEqual[z, 0.54]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], N[(x - N[(4.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6 \lor \neg \left(z \leq 0.54\right):\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x - 4 \cdot \left(x - y\right)\\
\end{array}
\end{array}
if z < -0.599999999999999978 or 0.54000000000000004 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 98.6%
associate-*r*98.8%
*-commutative98.8%
Simplified98.8%
if -0.599999999999999978 < z < 0.54000000000000004Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 97.9%
Final simplification98.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -18000000.0) (not (<= z 0.65))) (* -6.0 (* y z)) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -18000000.0) || !(z <= 0.65)) {
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 <= (-18000000.0d0)) .or. (.not. (z <= 0.65d0))) 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 <= -18000000.0) || !(z <= 0.65)) {
tmp = -6.0 * (y * z);
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -18000000.0) or not (z <= 0.65): tmp = -6.0 * (y * z) else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -18000000.0) || !(z <= 0.65)) 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 <= -18000000.0) || ~((z <= 0.65))) tmp = -6.0 * (y * z); else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -18000000.0], N[Not[LessEqual[z, 0.65]], $MachinePrecision]], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -18000000 \lor \neg \left(z \leq 0.65\right):\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if z < -1.8e7 or 0.650000000000000022 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.6%
Taylor expanded in z around inf 98.9%
Taylor expanded in y around inf 52.8%
*-commutative52.8%
Simplified52.8%
if -1.8e7 < z < 0.650000000000000022Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around inf 53.2%
sub-neg53.2%
distribute-rgt-in53.2%
metadata-eval53.2%
distribute-lft-neg-in53.2%
associate-+r+53.2%
metadata-eval53.2%
distribute-rgt-neg-in53.2%
metadata-eval53.2%
Simplified53.2%
Taylor expanded in z around 0 51.7%
*-commutative51.7%
Simplified51.7%
Final simplification52.2%
(FPCore (x y z) :precision binary64 (+ x (+ (* -6.0 (* (- y x) z)) (* (- y x) 4.0))))
double code(double x, double y, double z) {
return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.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 + (((-6.0d0) * ((y - x) * z)) + ((y - x) * 4.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0));
}
def code(x, y, z): return x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0))
function code(x, y, z) return Float64(x + Float64(Float64(-6.0 * Float64(Float64(y - x) * z)) + Float64(Float64(y - x) * 4.0))) end
function tmp = code(x, y, z) tmp = x + ((-6.0 * ((y - x) * z)) + ((y - x) * 4.0)); end
code[x_, y_, z_] := N[(x + N[(N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(-6 \cdot \left(\left(y - x\right) \cdot z\right) + \left(y - x\right) \cdot 4\right)
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 99.7%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (+ x (* (* 6.0 (- x y)) (- z 0.6666666666666666))))
double code(double x, double y, double z) {
return x + ((6.0 * (x - y)) * (z - 0.6666666666666666));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((6.0d0 * (x - y)) * (z - 0.6666666666666666d0))
end function
public static double code(double x, double y, double z) {
return x + ((6.0 * (x - y)) * (z - 0.6666666666666666));
}
def code(x, y, z): return x + ((6.0 * (x - y)) * (z - 0.6666666666666666))
function code(x, y, z) return Float64(x + Float64(Float64(6.0 * Float64(x - y)) * Float64(z - 0.6666666666666666))) end
function tmp = code(x, y, z) tmp = x + ((6.0 * (x - y)) * (z - 0.6666666666666666)); end
code[x_, y_, z_] := N[(x + N[(N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] * N[(z - 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(6 \cdot \left(x - y\right)\right) \cdot \left(z - 0.6666666666666666\right)
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.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 52.1%
sub-neg52.1%
distribute-rgt-in52.2%
metadata-eval52.2%
distribute-lft-neg-in52.2%
associate-+r+52.2%
metadata-eval52.2%
distribute-rgt-neg-in52.2%
metadata-eval52.2%
Simplified52.2%
Taylor expanded in z around 0 28.3%
*-commutative28.3%
Simplified28.3%
Final simplification28.3%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around inf 50.2%
associate-*r*50.3%
Simplified50.3%
Taylor expanded in x around inf 2.6%
Final simplification2.6%
herbie shell --seed 2024115
(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))))