
(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 (+ x (- (* (- y x) 4.0) (* -6.0 (* z (- x y))))))
double code(double x, double y, double z) {
return x + (((y - x) * 4.0) - (-6.0 * (z * (x - y))));
}
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) * 4.0d0) - ((-6.0d0) * (z * (x - y))))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 4.0) - (-6.0 * (z * (x - y))));
}
def code(x, y, z): return x + (((y - x) * 4.0) - (-6.0 * (z * (x - y))))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 4.0) - Float64(-6.0 * Float64(z * Float64(x - y))))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 4.0) - (-6.0 * (z * (x - y)))); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision] - N[(-6.0 * N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 4 - -6 \cdot \left(z \cdot \left(x - y\right)\right)\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(if (<= z -5.2e+212)
(* -6.0 (* z y))
(if (<= z -35.0)
(* 6.0 (* x z))
(if (<= z 1.45e-180)
(* y 4.0)
(if (<= z 0.5) (* x -3.0) (* y (* -6.0 z)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5.2e+212) {
tmp = -6.0 * (z * y);
} else if (z <= -35.0) {
tmp = 6.0 * (x * z);
} else if (z <= 1.45e-180) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = y * (-6.0 * 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.2d+212)) then
tmp = (-6.0d0) * (z * y)
else if (z <= (-35.0d0)) then
tmp = 6.0d0 * (x * z)
else if (z <= 1.45d-180) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else
tmp = y * ((-6.0d0) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5.2e+212) {
tmp = -6.0 * (z * y);
} else if (z <= -35.0) {
tmp = 6.0 * (x * z);
} else if (z <= 1.45e-180) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = y * (-6.0 * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5.2e+212: tmp = -6.0 * (z * y) elif z <= -35.0: tmp = 6.0 * (x * z) elif z <= 1.45e-180: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 else: tmp = y * (-6.0 * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5.2e+212) tmp = Float64(-6.0 * Float64(z * y)); elseif (z <= -35.0) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= 1.45e-180) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); else tmp = Float64(y * Float64(-6.0 * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5.2e+212) tmp = -6.0 * (z * y); elseif (z <= -35.0) tmp = 6.0 * (x * z); elseif (z <= 1.45e-180) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; else tmp = y * (-6.0 * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5.2e+212], N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -35.0], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e-180], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], N[(y * N[(-6.0 * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+212}:\\
\;\;\;\;-6 \cdot \left(z \cdot y\right)\\
\mathbf{elif}\;z \leq -35:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-180}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-6 \cdot z\right)\\
\end{array}
\end{array}
if z < -5.1999999999999997e212Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around inf 65.7%
+-commutative65.7%
*-commutative65.7%
Simplified65.7%
Taylor expanded in z around inf 65.8%
*-commutative65.8%
Simplified65.8%
if -5.1999999999999997e212 < z < -35Initial program 99.8%
+-commutative99.8%
associate-*l*99.6%
fma-define99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 64.0%
Taylor expanded in z around inf 62.5%
if -35 < z < 1.4499999999999999e-180Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in y around inf 62.5%
+-commutative62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in z around 0 60.4%
*-commutative60.4%
Simplified60.4%
if 1.4499999999999999e-180 < z < 0.5Initial program 99.4%
+-commutative99.4%
associate-*l*99.6%
fma-define99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 53.9%
*-lft-identity53.9%
*-commutative53.9%
associate-*r*54.0%
sub-neg54.0%
distribute-rgt-in54.0%
metadata-eval54.0%
neg-mul-154.0%
associate-*r*54.0%
*-commutative54.0%
metadata-eval54.0%
distribute-lft-in54.0%
distribute-rgt-in54.0%
distribute-lft-in54.0%
metadata-eval54.0%
associate-+r+54.0%
metadata-eval54.0%
associate-*r*54.0%
metadata-eval54.0%
Simplified54.0%
Taylor expanded in z around 0 52.6%
*-commutative52.6%
Simplified52.6%
if 0.5 < z Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-define99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 87.5%
Taylor expanded in z around inf 90.1%
Taylor expanded in x around 0 57.4%
Final simplification59.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z y))))
(if (<= z -1.15e+212)
t_0
(if (<= z -1.15)
(* 6.0 (* x z))
(if (<= z 5.5e-178) (* y 4.0) (if (<= z 0.62) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * y);
double tmp;
if (z <= -1.15e+212) {
tmp = t_0;
} else if (z <= -1.15) {
tmp = 6.0 * (x * z);
} else if (z <= 5.5e-178) {
tmp = y * 4.0;
} else if (z <= 0.62) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (z * y)
if (z <= (-1.15d+212)) then
tmp = t_0
else if (z <= (-1.15d0)) then
tmp = 6.0d0 * (x * z)
else if (z <= 5.5d-178) then
tmp = y * 4.0d0
else if (z <= 0.62d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (z * y);
double tmp;
if (z <= -1.15e+212) {
tmp = t_0;
} else if (z <= -1.15) {
tmp = 6.0 * (x * z);
} else if (z <= 5.5e-178) {
tmp = y * 4.0;
} else if (z <= 0.62) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * y) tmp = 0 if z <= -1.15e+212: tmp = t_0 elif z <= -1.15: tmp = 6.0 * (x * z) elif z <= 5.5e-178: tmp = y * 4.0 elif z <= 0.62: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * y)) tmp = 0.0 if (z <= -1.15e+212) tmp = t_0; elseif (z <= -1.15) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= 5.5e-178) tmp = Float64(y * 4.0); elseif (z <= 0.62) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * y); tmp = 0.0; if (z <= -1.15e+212) tmp = t_0; elseif (z <= -1.15) tmp = 6.0 * (x * z); elseif (z <= 5.5e-178) tmp = y * 4.0; elseif (z <= 0.62) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.15e+212], t$95$0, If[LessEqual[z, -1.15], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e-178], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.62], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+212}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.15:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-178}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.62:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.1499999999999999e212 or 0.619999999999999996 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
Taylor expanded in y around inf 61.2%
+-commutative61.2%
*-commutative61.2%
Simplified61.2%
Taylor expanded in z around inf 59.6%
*-commutative59.6%
Simplified59.6%
if -1.1499999999999999e212 < z < -1.1499999999999999Initial program 99.8%
+-commutative99.8%
associate-*l*99.6%
fma-define99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 64.0%
Taylor expanded in z around inf 62.5%
if -1.1499999999999999 < z < 5.50000000000000028e-178Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in y around inf 62.5%
+-commutative62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in z around 0 60.4%
*-commutative60.4%
Simplified60.4%
if 5.50000000000000028e-178 < z < 0.619999999999999996Initial program 99.4%
+-commutative99.4%
associate-*l*99.6%
fma-define99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 53.9%
*-lft-identity53.9%
*-commutative53.9%
associate-*r*54.0%
sub-neg54.0%
distribute-rgt-in54.0%
metadata-eval54.0%
neg-mul-154.0%
associate-*r*54.0%
*-commutative54.0%
metadata-eval54.0%
distribute-lft-in54.0%
distribute-rgt-in54.0%
distribute-lft-in54.0%
metadata-eval54.0%
associate-+r+54.0%
metadata-eval54.0%
associate-*r*54.0%
metadata-eval54.0%
Simplified54.0%
Taylor expanded in z around 0 52.6%
*-commutative52.6%
Simplified52.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z (- y x)))))
(if (<= z -0.43)
t_0
(if (<= z 1.18e-182)
(* y 4.0)
(if (<= z 11.0) (* x (+ -3.0 (* z 6.0))) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * (y - x));
double tmp;
if (z <= -0.43) {
tmp = t_0;
} else if (z <= 1.18e-182) {
tmp = y * 4.0;
} else if (z <= 11.0) {
tmp = x * (-3.0 + (z * 6.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) * (z * (y - x))
if (z <= (-0.43d0)) then
tmp = t_0
else if (z <= 1.18d-182) then
tmp = y * 4.0d0
else if (z <= 11.0d0) then
tmp = x * ((-3.0d0) + (z * 6.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 * (z * (y - x));
double tmp;
if (z <= -0.43) {
tmp = t_0;
} else if (z <= 1.18e-182) {
tmp = y * 4.0;
} else if (z <= 11.0) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * (y - x)) tmp = 0 if z <= -0.43: tmp = t_0 elif z <= 1.18e-182: tmp = y * 4.0 elif z <= 11.0: tmp = x * (-3.0 + (z * 6.0)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -0.43) tmp = t_0; elseif (z <= 1.18e-182) tmp = Float64(y * 4.0); elseif (z <= 11.0) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * (y - x)); tmp = 0.0; if (z <= -0.43) tmp = t_0; elseif (z <= 1.18e-182) tmp = y * 4.0; elseif (z <= 11.0) tmp = x * (-3.0 + (z * 6.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.43], t$95$0, If[LessEqual[z, 1.18e-182], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 11.0], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -0.43:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.18 \cdot 10^{-182}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 11:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.429999999999999993 or 11 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 98.0%
Taylor expanded in z around inf 98.0%
if -0.429999999999999993 < z < 1.17999999999999997e-182Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in y around inf 62.5%
+-commutative62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in z around 0 60.4%
*-commutative60.4%
Simplified60.4%
if 1.17999999999999997e-182 < z < 11Initial program 99.4%
+-commutative99.4%
associate-*l*99.6%
fma-define99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 53.9%
*-lft-identity53.9%
*-commutative53.9%
associate-*r*54.0%
sub-neg54.0%
distribute-rgt-in54.0%
metadata-eval54.0%
neg-mul-154.0%
associate-*r*54.0%
*-commutative54.0%
metadata-eval54.0%
distribute-lft-in54.0%
distribute-rgt-in54.0%
distribute-lft-in54.0%
metadata-eval54.0%
associate-+r+54.0%
metadata-eval54.0%
associate-*r*54.0%
metadata-eval54.0%
Simplified54.0%
Final simplification78.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z (- y x)))))
(if (<= z -0.43)
t_0
(if (<= z 3.05e-179) (* y 4.0) (if (<= z 0.5) (* x -3.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * (y - x));
double tmp;
if (z <= -0.43) {
tmp = t_0;
} else if (z <= 3.05e-179) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (z * (y - x))
if (z <= (-0.43d0)) then
tmp = t_0
else if (z <= 3.05d-179) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (z * (y - x));
double tmp;
if (z <= -0.43) {
tmp = t_0;
} else if (z <= 3.05e-179) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * (y - x)) tmp = 0 if z <= -0.43: tmp = t_0 elif z <= 3.05e-179: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -0.43) tmp = t_0; elseif (z <= 3.05e-179) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * (y - x)); tmp = 0.0; if (z <= -0.43) tmp = t_0; elseif (z <= 3.05e-179) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.43], t$95$0, If[LessEqual[z, 3.05e-179], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -0.43:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.05 \cdot 10^{-179}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.429999999999999993 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 98.0%
Taylor expanded in z around inf 98.0%
if -0.429999999999999993 < z < 3.04999999999999998e-179Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in y around inf 62.5%
+-commutative62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in z around 0 60.4%
*-commutative60.4%
Simplified60.4%
if 3.04999999999999998e-179 < z < 0.5Initial program 99.4%
+-commutative99.4%
associate-*l*99.6%
fma-define99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 53.9%
*-lft-identity53.9%
*-commutative53.9%
associate-*r*54.0%
sub-neg54.0%
distribute-rgt-in54.0%
metadata-eval54.0%
neg-mul-154.0%
associate-*r*54.0%
*-commutative54.0%
metadata-eval54.0%
distribute-lft-in54.0%
distribute-rgt-in54.0%
distribute-lft-in54.0%
metadata-eval54.0%
associate-+r+54.0%
metadata-eval54.0%
associate-*r*54.0%
metadata-eval54.0%
Simplified54.0%
Taylor expanded in z around 0 52.6%
*-commutative52.6%
Simplified52.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z y))))
(if (<= z -0.66)
t_0
(if (<= z 1.8e-179) (* y 4.0) (if (<= z 0.5) (* x -3.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * y);
double tmp;
if (z <= -0.66) {
tmp = t_0;
} else if (z <= 1.8e-179) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (z * y)
if (z <= (-0.66d0)) then
tmp = t_0
else if (z <= 1.8d-179) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (z * y);
double tmp;
if (z <= -0.66) {
tmp = t_0;
} else if (z <= 1.8e-179) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * y) tmp = 0 if z <= -0.66: tmp = t_0 elif z <= 1.8e-179: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * y)) tmp = 0.0 if (z <= -0.66) tmp = t_0; elseif (z <= 1.8e-179) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * y); tmp = 0.0; if (z <= -0.66) tmp = t_0; elseif (z <= 1.8e-179) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.66], t$95$0, If[LessEqual[z, 1.8e-179], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot y\right)\\
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-179}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.660000000000000031 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in y around inf 52.7%
+-commutative52.7%
*-commutative52.7%
Simplified52.7%
Taylor expanded in z around inf 51.7%
*-commutative51.7%
Simplified51.7%
if -0.660000000000000031 < z < 1.80000000000000004e-179Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in y around inf 62.5%
+-commutative62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in z around 0 60.4%
*-commutative60.4%
Simplified60.4%
if 1.80000000000000004e-179 < z < 0.5Initial program 99.4%
+-commutative99.4%
associate-*l*99.6%
fma-define99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in y around 0 53.9%
*-lft-identity53.9%
*-commutative53.9%
associate-*r*54.0%
sub-neg54.0%
distribute-rgt-in54.0%
metadata-eval54.0%
neg-mul-154.0%
associate-*r*54.0%
*-commutative54.0%
metadata-eval54.0%
distribute-lft-in54.0%
distribute-rgt-in54.0%
distribute-lft-in54.0%
metadata-eval54.0%
associate-+r+54.0%
metadata-eval54.0%
associate-*r*54.0%
metadata-eval54.0%
Simplified54.0%
Taylor expanded in z around 0 52.6%
*-commutative52.6%
Simplified52.6%
(FPCore (x y z) :precision binary64 (if (<= z -0.66) (+ x (* z (* 6.0 (- x y)))) (if (<= z 0.5) (+ x (* (- y x) 4.0)) (+ x (* (* z 6.0) (- x y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + (z * (6.0 * (x - y)));
} else if (z <= 0.5) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x + ((z * 6.0) * (x - y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.66d0)) then
tmp = x + (z * (6.0d0 * (x - y)))
else if (z <= 0.5d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = x + ((z * 6.0d0) * (x - y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + (z * (6.0 * (x - y)));
} else if (z <= 0.5) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x + ((z * 6.0) * (x - y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = x + (z * (6.0 * (x - y))) elif z <= 0.5: tmp = x + ((y - x) * 4.0) else: tmp = x + ((z * 6.0) * (x - y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(x + Float64(z * Float64(6.0 * Float64(x - y)))); elseif (z <= 0.5) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(x + Float64(Float64(z * 6.0) * Float64(x - y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = x + (z * (6.0 * (x - y))); elseif (z <= 0.5) tmp = x + ((y - x) * 4.0); else tmp = x + ((z * 6.0) * (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(x + N[(z * N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.5], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * 6.0), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;x + z \cdot \left(6 \cdot \left(x - y\right)\right)\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot 6\right) \cdot \left(x - y\right)\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 98.5%
neg-mul-198.5%
Simplified98.5%
if -0.660000000000000031 < z < 0.5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 96.3%
if 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.6%
neg-mul-197.6%
Simplified97.6%
add-sqr-sqrt54.4%
fma-define54.4%
distribute-rgt-neg-out54.4%
add-sqr-sqrt54.3%
sqrt-unprod43.8%
sqr-neg43.8%
sqrt-unprod0.0%
add-sqr-sqrt0.3%
*-commutative0.3%
*-commutative0.3%
fmm-def0.3%
add-sqr-sqrt0.5%
associate-*l*0.5%
add-sqr-sqrt0.0%
sqrt-unprod77.9%
sqr-neg77.9%
sqrt-unprod97.4%
add-sqr-sqrt97.6%
*-commutative97.6%
Applied egg-rr97.6%
Final simplification97.2%
(FPCore (x y z) :precision binary64 (if (<= z -0.6) (* -6.0 (* z (- y x))) (if (<= z 0.66) (+ x (* (- y x) 4.0)) (+ x (* (* z 6.0) (- x y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.6) {
tmp = -6.0 * (z * (y - x));
} else if (z <= 0.66) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x + ((z * 6.0) * (x - y));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.6d0)) then
tmp = (-6.0d0) * (z * (y - x))
else if (z <= 0.66d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = x + ((z * 6.0d0) * (x - y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.6) {
tmp = -6.0 * (z * (y - x));
} else if (z <= 0.66) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x + ((z * 6.0) * (x - y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.6: tmp = -6.0 * (z * (y - x)) elif z <= 0.66: tmp = x + ((y - x) * 4.0) else: tmp = x + ((z * 6.0) * (x - y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.6) tmp = Float64(-6.0 * Float64(z * Float64(y - x))); elseif (z <= 0.66) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(x + Float64(Float64(z * 6.0) * Float64(x - y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.6) tmp = -6.0 * (z * (y - x)); elseif (z <= 0.66) tmp = x + ((y - x) * 4.0); else tmp = x + ((z * 6.0) * (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.6], N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.66], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * 6.0), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6:\\
\;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot 6\right) \cdot \left(x - y\right)\\
\end{array}
\end{array}
if z < -0.599999999999999978Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 98.4%
Taylor expanded in z around inf 98.5%
if -0.599999999999999978 < z < 0.660000000000000031Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 96.3%
if 0.660000000000000031 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.6%
neg-mul-197.6%
Simplified97.6%
add-sqr-sqrt54.4%
fma-define54.4%
distribute-rgt-neg-out54.4%
add-sqr-sqrt54.3%
sqrt-unprod43.8%
sqr-neg43.8%
sqrt-unprod0.0%
add-sqr-sqrt0.3%
*-commutative0.3%
*-commutative0.3%
fmm-def0.3%
add-sqr-sqrt0.5%
associate-*l*0.5%
add-sqr-sqrt0.0%
sqrt-unprod77.9%
sqr-neg77.9%
sqrt-unprod97.4%
add-sqr-sqrt97.6%
*-commutative97.6%
Applied egg-rr97.6%
Final simplification97.2%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* -6.0 (* z (- y x))))) (if (<= z -0.58) t_0 (if (<= z 0.66) (+ x (* (- y x) 4.0)) (+ x t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * (y - x));
double tmp;
if (z <= -0.58) {
tmp = t_0;
} else if (z <= 0.66) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x + 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) * (z * (y - x))
if (z <= (-0.58d0)) then
tmp = t_0
else if (z <= 0.66d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = x + t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (z * (y - x));
double tmp;
if (z <= -0.58) {
tmp = t_0;
} else if (z <= 0.66) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x + t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * (y - x)) tmp = 0 if z <= -0.58: tmp = t_0 elif z <= 0.66: tmp = x + ((y - x) * 4.0) else: tmp = x + t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -0.58) tmp = t_0; elseif (z <= 0.66) tmp = Float64(x + Float64(Float64(y - x) * 4.0)); else tmp = Float64(x + t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * (y - x)); tmp = 0.0; if (z <= -0.58) tmp = t_0; elseif (z <= 0.66) tmp = x + ((y - x) * 4.0); else tmp = x + t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.58], t$95$0, If[LessEqual[z, 0.66], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision], N[(x + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -0.58:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 0.66:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x + t\_0\\
\end{array}
\end{array}
if z < -0.57999999999999996Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 98.4%
Taylor expanded in z around inf 98.5%
if -0.57999999999999996 < z < 0.660000000000000031Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 96.3%
if 0.660000000000000031 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.6%
Final simplification97.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.6) (not (<= z 0.65))) (* -6.0 (* z (- y x))) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.65)) {
tmp = -6.0 * (z * (y - x));
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-0.6d0)) .or. (.not. (z <= 0.65d0))) then
tmp = (-6.0d0) * (z * (y - x))
else
tmp = x + ((y - x) * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.65)) {
tmp = -6.0 * (z * (y - x));
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.6) or not (z <= 0.65): tmp = -6.0 * (z * (y - x)) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.6) || !(z <= 0.65)) tmp = Float64(-6.0 * Float64(z * Float64(y - x))); else tmp = Float64(x + Float64(Float64(y - x) * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.6) || ~((z <= 0.65))) tmp = -6.0 * (z * (y - x)); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.6], N[Not[LessEqual[z, 0.65]], $MachinePrecision]], N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.6 \lor \neg \left(z \leq 0.65\right):\\
\;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.599999999999999978 or 0.650000000000000022 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 98.0%
Taylor expanded in z around inf 98.0%
if -0.599999999999999978 < z < 0.650000000000000022Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 96.3%
Final simplification97.2%
(FPCore (x y z) :precision binary64 (if (or (<= y -5.5e-52) (not (<= y 1.82e-34))) (* y (+ 4.0 (* -6.0 z))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -5.5e-52) || !(y <= 1.82e-34)) {
tmp = y * (4.0 + (-6.0 * z));
} else {
tmp = x * (-3.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 ((y <= (-5.5d-52)) .or. (.not. (y <= 1.82d-34))) then
tmp = y * (4.0d0 + ((-6.0d0) * z))
else
tmp = x * ((-3.0d0) + (z * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -5.5e-52) || !(y <= 1.82e-34)) {
tmp = y * (4.0 + (-6.0 * z));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -5.5e-52) or not (y <= 1.82e-34): tmp = y * (4.0 + (-6.0 * z)) else: tmp = x * (-3.0 + (z * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -5.5e-52) || !(y <= 1.82e-34)) tmp = Float64(y * Float64(4.0 + Float64(-6.0 * z))); else tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -5.5e-52) || ~((y <= 1.82e-34))) tmp = y * (4.0 + (-6.0 * z)); else tmp = x * (-3.0 + (z * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -5.5e-52], N[Not[LessEqual[y, 1.82e-34]], $MachinePrecision]], N[(y * N[(4.0 + N[(-6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{-52} \lor \neg \left(y \leq 1.82 \cdot 10^{-34}\right):\\
\;\;\;\;y \cdot \left(4 + -6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\end{array}
\end{array}
if y < -5.5e-52 or 1.82000000000000009e-34 < y Initial program 99.7%
+-commutative99.7%
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 83.1%
if -5.5e-52 < y < 1.82000000000000009e-34Initial program 99.4%
+-commutative99.4%
associate-*l*98.9%
fma-define98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in y around 0 78.8%
*-lft-identity78.8%
*-commutative78.8%
associate-*r*78.1%
sub-neg78.1%
distribute-rgt-in78.1%
metadata-eval78.1%
neg-mul-178.1%
associate-*r*78.1%
*-commutative78.1%
metadata-eval78.1%
distribute-lft-in78.1%
distribute-rgt-in78.1%
distribute-lft-in78.1%
metadata-eval78.1%
associate-+r+78.1%
metadata-eval78.1%
associate-*r*78.1%
metadata-eval78.1%
Simplified78.1%
Final simplification80.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.1e-16) (not (<= y 2.55e-35))) (* y 4.0) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.1e-16) || !(y <= 2.55e-35)) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-2.1d-16)) .or. (.not. (y <= 2.55d-35))) then
tmp = y * 4.0d0
else
tmp = x * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2.1e-16) || !(y <= 2.55e-35)) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.1e-16) or not (y <= 2.55e-35): tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.1e-16) || !(y <= 2.55e-35)) tmp = Float64(y * 4.0); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.1e-16) || ~((y <= 2.55e-35))) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.1e-16], N[Not[LessEqual[y, 2.55e-35]], $MachinePrecision]], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-16} \lor \neg \left(y \leq 2.55 \cdot 10^{-35}\right):\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if y < -2.1000000000000001e-16 or 2.54999999999999993e-35 < y Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around inf 84.0%
+-commutative84.0%
*-commutative84.0%
Simplified84.0%
Taylor expanded in z around 0 42.1%
*-commutative42.1%
Simplified42.1%
if -2.1000000000000001e-16 < y < 2.54999999999999993e-35Initial program 99.5%
+-commutative99.5%
associate-*l*98.9%
fma-define98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in y around 0 77.4%
*-lft-identity77.4%
*-commutative77.4%
associate-*r*76.7%
sub-neg76.7%
distribute-rgt-in76.7%
metadata-eval76.7%
neg-mul-176.7%
associate-*r*76.7%
*-commutative76.7%
metadata-eval76.7%
distribute-lft-in76.7%
distribute-rgt-in76.7%
distribute-lft-in76.7%
metadata-eval76.7%
associate-+r+76.7%
metadata-eval76.7%
associate-*r*76.7%
metadata-eval76.7%
Simplified76.7%
Taylor expanded in z around 0 39.4%
*-commutative39.4%
Simplified39.4%
Final simplification40.8%
(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.6%
metadata-eval99.6%
Simplified99.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%
+-commutative99.6%
associate-*l*99.4%
fma-define99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 48.1%
*-lft-identity48.1%
*-commutative48.1%
associate-*r*48.2%
sub-neg48.2%
distribute-rgt-in48.2%
metadata-eval48.2%
neg-mul-148.2%
associate-*r*48.2%
*-commutative48.2%
metadata-eval48.2%
distribute-lft-in48.2%
distribute-rgt-in48.2%
distribute-lft-in48.2%
metadata-eval48.2%
associate-+r+48.2%
metadata-eval48.2%
associate-*r*48.2%
metadata-eval48.2%
Simplified48.2%
Taylor expanded in z around 0 23.1%
*-commutative23.1%
Simplified23.1%
(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 z around inf 51.2%
Taylor expanded in z around 0 2.4%
herbie shell --seed 2024170
(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))))