
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (fma (- y x) (fma z -6.0 4.0) x))
double code(double x, double y, double z) {
return fma((y - x), fma(z, -6.0, 4.0), x);
}
function code(x, y, z) return fma(Float64(y - x), fma(z, -6.0, 4.0), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(z * -6.0 + 4.0), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, \mathsf{fma}\left(z, -6, 4\right), x\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
distribute-rgt-neg-out99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
(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.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%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* z -6.0))) (t_1 (* x (* z 6.0))))
(if (<= z -2.45e+262)
t_0
(if (<= z -3.5e+200)
t_1
(if (<= z -2.3e+168)
t_0
(if (<= z -2.2e+116)
t_1
(if (<= z -1.15e+53)
t_0
(if (<= z -9.5e+18)
t_1
(if (<= z -0.67)
t_0
(if (<= z -1.3e-194)
(* y 4.0)
(if (<= z -4.6e-288)
(* x -3.0)
(if (<= z 0.68) (* y 4.0) t_0))))))))))))
double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double t_1 = x * (z * 6.0);
double tmp;
if (z <= -2.45e+262) {
tmp = t_0;
} else if (z <= -3.5e+200) {
tmp = t_1;
} else if (z <= -2.3e+168) {
tmp = t_0;
} else if (z <= -2.2e+116) {
tmp = t_1;
} else if (z <= -1.15e+53) {
tmp = t_0;
} else if (z <= -9.5e+18) {
tmp = t_1;
} else if (z <= -0.67) {
tmp = t_0;
} else if (z <= -1.3e-194) {
tmp = y * 4.0;
} else if (z <= -4.6e-288) {
tmp = x * -3.0;
} else if (z <= 0.68) {
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) :: t_1
real(8) :: tmp
t_0 = y * (z * (-6.0d0))
t_1 = x * (z * 6.0d0)
if (z <= (-2.45d+262)) then
tmp = t_0
else if (z <= (-3.5d+200)) then
tmp = t_1
else if (z <= (-2.3d+168)) then
tmp = t_0
else if (z <= (-2.2d+116)) then
tmp = t_1
else if (z <= (-1.15d+53)) then
tmp = t_0
else if (z <= (-9.5d+18)) then
tmp = t_1
else if (z <= (-0.67d0)) then
tmp = t_0
else if (z <= (-1.3d-194)) then
tmp = y * 4.0d0
else if (z <= (-4.6d-288)) then
tmp = x * (-3.0d0)
else if (z <= 0.68d0) 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 = y * (z * -6.0);
double t_1 = x * (z * 6.0);
double tmp;
if (z <= -2.45e+262) {
tmp = t_0;
} else if (z <= -3.5e+200) {
tmp = t_1;
} else if (z <= -2.3e+168) {
tmp = t_0;
} else if (z <= -2.2e+116) {
tmp = t_1;
} else if (z <= -1.15e+53) {
tmp = t_0;
} else if (z <= -9.5e+18) {
tmp = t_1;
} else if (z <= -0.67) {
tmp = t_0;
} else if (z <= -1.3e-194) {
tmp = y * 4.0;
} else if (z <= -4.6e-288) {
tmp = x * -3.0;
} else if (z <= 0.68) {
tmp = y * 4.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (z * -6.0) t_1 = x * (z * 6.0) tmp = 0 if z <= -2.45e+262: tmp = t_0 elif z <= -3.5e+200: tmp = t_1 elif z <= -2.3e+168: tmp = t_0 elif z <= -2.2e+116: tmp = t_1 elif z <= -1.15e+53: tmp = t_0 elif z <= -9.5e+18: tmp = t_1 elif z <= -0.67: tmp = t_0 elif z <= -1.3e-194: tmp = y * 4.0 elif z <= -4.6e-288: tmp = x * -3.0 elif z <= 0.68: tmp = y * 4.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(z * -6.0)) t_1 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -2.45e+262) tmp = t_0; elseif (z <= -3.5e+200) tmp = t_1; elseif (z <= -2.3e+168) tmp = t_0; elseif (z <= -2.2e+116) tmp = t_1; elseif (z <= -1.15e+53) tmp = t_0; elseif (z <= -9.5e+18) tmp = t_1; elseif (z <= -0.67) tmp = t_0; elseif (z <= -1.3e-194) tmp = Float64(y * 4.0); elseif (z <= -4.6e-288) tmp = Float64(x * -3.0); elseif (z <= 0.68) tmp = Float64(y * 4.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (z * -6.0); t_1 = x * (z * 6.0); tmp = 0.0; if (z <= -2.45e+262) tmp = t_0; elseif (z <= -3.5e+200) tmp = t_1; elseif (z <= -2.3e+168) tmp = t_0; elseif (z <= -2.2e+116) tmp = t_1; elseif (z <= -1.15e+53) tmp = t_0; elseif (z <= -9.5e+18) tmp = t_1; elseif (z <= -0.67) tmp = t_0; elseif (z <= -1.3e-194) tmp = y * 4.0; elseif (z <= -4.6e-288) tmp = x * -3.0; elseif (z <= 0.68) tmp = y * 4.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.45e+262], t$95$0, If[LessEqual[z, -3.5e+200], t$95$1, If[LessEqual[z, -2.3e+168], t$95$0, If[LessEqual[z, -2.2e+116], t$95$1, If[LessEqual[z, -1.15e+53], t$95$0, If[LessEqual[z, -9.5e+18], t$95$1, If[LessEqual[z, -0.67], t$95$0, If[LessEqual[z, -1.3e-194], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -4.6e-288], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.68], N[(y * 4.0), $MachinePrecision], t$95$0]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(z \cdot -6\right)\\
t_1 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -2.45 \cdot 10^{+262}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{+200}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{+168}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{+53}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -0.67:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-194}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{-288}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.4499999999999999e262 or -3.50000000000000006e200 < z < -2.2999999999999999e168 or -2.2e116 < z < -1.1500000000000001e53 or -9.5e18 < z < -0.67000000000000004 or 0.680000000000000049 < z Initial program 99.8%
+-commutative99.8%
associate-*l*99.7%
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%
Taylor expanded in y around inf 68.2%
Taylor expanded in z around inf 64.4%
*-commutative64.4%
Simplified64.4%
if -2.4499999999999999e262 < z < -3.50000000000000006e200 or -2.2999999999999999e168 < z < -2.2e116 or -1.1500000000000001e53 < z < -9.5e18Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 77.9%
sub-neg77.9%
distribute-rgt-in77.9%
metadata-eval77.9%
distribute-lft-neg-in77.9%
associate-+r+77.9%
metadata-eval77.9%
distribute-rgt-neg-in77.9%
metadata-eval77.9%
Simplified77.9%
Taylor expanded in z around inf 77.8%
associate-*r*77.9%
*-commutative77.9%
associate-*r*77.9%
*-commutative77.9%
Simplified77.9%
if -0.67000000000000004 < z < -1.30000000000000001e-194 or -4.6e-288 < z < 0.680000000000000049Initial program 99.4%
+-commutative99.4%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 59.9%
Taylor expanded in z around 0 58.7%
if -1.30000000000000001e-194 < z < -4.6e-288Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
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%
Taylor expanded in z around 0 67.0%
*-commutative67.0%
Simplified67.0%
(FPCore (x y z)
:precision binary64
(if (<= z -1.4e+15)
(* x (* z 6.0))
(if (<= z -6e-153)
(* y 4.0)
(if (<= z -1.15e-180)
(* x -3.0)
(if (<= z -3.1e-195)
(* y 4.0)
(if (<= z -1.62e-286)
(* x -3.0)
(if (<= z 0.68) (* y 4.0) (* 6.0 (* x z)))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.4e+15) {
tmp = x * (z * 6.0);
} else if (z <= -6e-153) {
tmp = y * 4.0;
} else if (z <= -1.15e-180) {
tmp = x * -3.0;
} else if (z <= -3.1e-195) {
tmp = y * 4.0;
} else if (z <= -1.62e-286) {
tmp = x * -3.0;
} else if (z <= 0.68) {
tmp = y * 4.0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-1.4d+15)) then
tmp = x * (z * 6.0d0)
else if (z <= (-6d-153)) then
tmp = y * 4.0d0
else if (z <= (-1.15d-180)) then
tmp = x * (-3.0d0)
else if (z <= (-3.1d-195)) then
tmp = y * 4.0d0
else if (z <= (-1.62d-286)) then
tmp = x * (-3.0d0)
else if (z <= 0.68d0) then
tmp = y * 4.0d0
else
tmp = 6.0d0 * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.4e+15) {
tmp = x * (z * 6.0);
} else if (z <= -6e-153) {
tmp = y * 4.0;
} else if (z <= -1.15e-180) {
tmp = x * -3.0;
} else if (z <= -3.1e-195) {
tmp = y * 4.0;
} else if (z <= -1.62e-286) {
tmp = x * -3.0;
} else if (z <= 0.68) {
tmp = y * 4.0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.4e+15: tmp = x * (z * 6.0) elif z <= -6e-153: tmp = y * 4.0 elif z <= -1.15e-180: tmp = x * -3.0 elif z <= -3.1e-195: tmp = y * 4.0 elif z <= -1.62e-286: tmp = x * -3.0 elif z <= 0.68: tmp = y * 4.0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.4e+15) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= -6e-153) tmp = Float64(y * 4.0); elseif (z <= -1.15e-180) tmp = Float64(x * -3.0); elseif (z <= -3.1e-195) tmp = Float64(y * 4.0); elseif (z <= -1.62e-286) tmp = Float64(x * -3.0); elseif (z <= 0.68) tmp = Float64(y * 4.0); else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.4e+15) tmp = x * (z * 6.0); elseif (z <= -6e-153) tmp = y * 4.0; elseif (z <= -1.15e-180) tmp = x * -3.0; elseif (z <= -3.1e-195) tmp = y * 4.0; elseif (z <= -1.62e-286) tmp = x * -3.0; elseif (z <= 0.68) tmp = y * 4.0; else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.4e+15], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6e-153], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.15e-180], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -3.1e-195], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.62e-286], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.68], N[(y * 4.0), $MachinePrecision], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+15}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-153}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-180}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-195}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.62 \cdot 10^{-286}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -1.4e15Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 50.1%
sub-neg50.1%
distribute-rgt-in50.1%
metadata-eval50.1%
distribute-lft-neg-in50.1%
associate-+r+50.1%
metadata-eval50.1%
distribute-rgt-neg-in50.1%
metadata-eval50.1%
Simplified50.1%
Taylor expanded in z around inf 50.0%
associate-*r*50.1%
*-commutative50.1%
associate-*r*50.1%
*-commutative50.1%
Simplified50.1%
if -1.4e15 < z < -6e-153 or -1.14999999999999998e-180 < z < -3.10000000000000002e-195 or -1.6199999999999999e-286 < z < 0.680000000000000049Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 65.0%
Taylor expanded in z around 0 58.8%
if -6e-153 < z < -1.14999999999999998e-180 or -3.10000000000000002e-195 < z < -1.6199999999999999e-286Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 71.7%
sub-neg71.7%
distribute-rgt-in71.7%
metadata-eval71.7%
distribute-lft-neg-in71.7%
associate-+r+71.7%
metadata-eval71.7%
distribute-rgt-neg-in71.7%
metadata-eval71.7%
Simplified71.7%
Taylor expanded in z around 0 71.7%
*-commutative71.7%
Simplified71.7%
if 0.680000000000000049 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 51.3%
sub-neg51.3%
distribute-rgt-in51.3%
metadata-eval51.3%
distribute-lft-neg-in51.3%
associate-+r+51.3%
metadata-eval51.3%
distribute-rgt-neg-in51.3%
metadata-eval51.3%
Simplified51.3%
Taylor expanded in z around inf 51.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -1.4e+15)
t_0
(if (<= z -2e-152)
(* y 4.0)
(if (<= z -1.15e-180)
(* x -3.0)
(if (<= z -8e-195)
(* y 4.0)
(if (<= z -1.6e-288)
(* 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 * (x * z);
double tmp;
if (z <= -1.4e+15) {
tmp = t_0;
} else if (z <= -2e-152) {
tmp = y * 4.0;
} else if (z <= -1.15e-180) {
tmp = x * -3.0;
} else if (z <= -8e-195) {
tmp = y * 4.0;
} else if (z <= -1.6e-288) {
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 * (x * z)
if (z <= (-1.4d+15)) then
tmp = t_0
else if (z <= (-2d-152)) then
tmp = y * 4.0d0
else if (z <= (-1.15d-180)) then
tmp = x * (-3.0d0)
else if (z <= (-8d-195)) then
tmp = y * 4.0d0
else if (z <= (-1.6d-288)) 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 * (x * z);
double tmp;
if (z <= -1.4e+15) {
tmp = t_0;
} else if (z <= -2e-152) {
tmp = y * 4.0;
} else if (z <= -1.15e-180) {
tmp = x * -3.0;
} else if (z <= -8e-195) {
tmp = y * 4.0;
} else if (z <= -1.6e-288) {
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 * (x * z) tmp = 0 if z <= -1.4e+15: tmp = t_0 elif z <= -2e-152: tmp = y * 4.0 elif z <= -1.15e-180: tmp = x * -3.0 elif z <= -8e-195: tmp = y * 4.0 elif z <= -1.6e-288: 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(x * z)) tmp = 0.0 if (z <= -1.4e+15) tmp = t_0; elseif (z <= -2e-152) tmp = Float64(y * 4.0); elseif (z <= -1.15e-180) tmp = Float64(x * -3.0); elseif (z <= -8e-195) tmp = Float64(y * 4.0); elseif (z <= -1.6e-288) 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 * (x * z); tmp = 0.0; if (z <= -1.4e+15) tmp = t_0; elseif (z <= -2e-152) tmp = y * 4.0; elseif (z <= -1.15e-180) tmp = x * -3.0; elseif (z <= -8e-195) tmp = y * 4.0; elseif (z <= -1.6e-288) 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[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.4e+15], t$95$0, If[LessEqual[z, -2e-152], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.15e-180], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -8e-195], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -1.6e-288], 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(x \cdot z\right)\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-152}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-180}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-195}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-288}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.65:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.4e15 or 0.650000000000000022 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 50.7%
sub-neg50.7%
distribute-rgt-in50.7%
metadata-eval50.7%
distribute-lft-neg-in50.7%
associate-+r+50.7%
metadata-eval50.7%
distribute-rgt-neg-in50.7%
metadata-eval50.7%
Simplified50.7%
Taylor expanded in z around inf 50.7%
if -1.4e15 < z < -2.00000000000000013e-152 or -1.14999999999999998e-180 < z < -8.0000000000000007e-195 or -1.6e-288 < z < 0.650000000000000022Initial program 99.4%
+-commutative99.4%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 65.0%
Taylor expanded in z around 0 58.8%
if -2.00000000000000013e-152 < z < -1.14999999999999998e-180 or -8.0000000000000007e-195 < z < -1.6e-288Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 71.7%
sub-neg71.7%
distribute-rgt-in71.7%
metadata-eval71.7%
distribute-lft-neg-in71.7%
associate-+r+71.7%
metadata-eval71.7%
distribute-rgt-neg-in71.7%
metadata-eval71.7%
Simplified71.7%
Taylor expanded in z around 0 71.7%
*-commutative71.7%
Simplified71.7%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* z -6.0))))
(if (<= y -5.1e+227)
(* y 4.0)
(if (<= y -8.5e+213)
t_0
(if (<= y -5.9e-49)
(* y 4.0)
(if (<= y 2.3e+80) (* x (+ -3.0 (* z 6.0))) t_0))))))
double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double tmp;
if (y <= -5.1e+227) {
tmp = y * 4.0;
} else if (y <= -8.5e+213) {
tmp = t_0;
} else if (y <= -5.9e-49) {
tmp = y * 4.0;
} else if (y <= 2.3e+80) {
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 = y * (z * (-6.0d0))
if (y <= (-5.1d+227)) then
tmp = y * 4.0d0
else if (y <= (-8.5d+213)) then
tmp = t_0
else if (y <= (-5.9d-49)) then
tmp = y * 4.0d0
else if (y <= 2.3d+80) 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 = y * (z * -6.0);
double tmp;
if (y <= -5.1e+227) {
tmp = y * 4.0;
} else if (y <= -8.5e+213) {
tmp = t_0;
} else if (y <= -5.9e-49) {
tmp = y * 4.0;
} else if (y <= 2.3e+80) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = y * (z * -6.0) tmp = 0 if y <= -5.1e+227: tmp = y * 4.0 elif y <= -8.5e+213: tmp = t_0 elif y <= -5.9e-49: tmp = y * 4.0 elif y <= 2.3e+80: tmp = x * (-3.0 + (z * 6.0)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(z * -6.0)) tmp = 0.0 if (y <= -5.1e+227) tmp = Float64(y * 4.0); elseif (y <= -8.5e+213) tmp = t_0; elseif (y <= -5.9e-49) tmp = Float64(y * 4.0); elseif (y <= 2.3e+80) 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 = y * (z * -6.0); tmp = 0.0; if (y <= -5.1e+227) tmp = y * 4.0; elseif (y <= -8.5e+213) tmp = t_0; elseif (y <= -5.9e-49) tmp = y * 4.0; elseif (y <= 2.3e+80) 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[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.1e+227], N[(y * 4.0), $MachinePrecision], If[LessEqual[y, -8.5e+213], t$95$0, If[LessEqual[y, -5.9e-49], N[(y * 4.0), $MachinePrecision], If[LessEqual[y, 2.3e+80], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;y \leq -5.1 \cdot 10^{+227}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;y \leq -8.5 \cdot 10^{+213}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq -5.9 \cdot 10^{-49}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+80}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -5.1000000000000001e227 or -8.4999999999999995e213 < y < -5.90000000000000037e-49Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 82.5%
Taylor expanded in z around 0 57.6%
if -5.1000000000000001e227 < y < -8.4999999999999995e213 or 2.30000000000000004e80 < 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 94.4%
Taylor expanded in z around inf 56.4%
*-commutative56.4%
Simplified56.4%
if -5.90000000000000037e-49 < y < 2.30000000000000004e80Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 73.9%
sub-neg73.9%
distribute-rgt-in73.9%
metadata-eval73.9%
distribute-lft-neg-in73.9%
associate-+r+73.9%
metadata-eval73.9%
distribute-rgt-neg-in73.9%
metadata-eval73.9%
Simplified73.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.67) (not (<= z 0.68))) (+ x (* -6.0 (* (- y x) z))) (+ (* x -3.0) (* y 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.67) || !(z <= 0.68)) {
tmp = x + (-6.0 * ((y - x) * z));
} else {
tmp = (x * -3.0) + (y * 4.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-0.67d0)) .or. (.not. (z <= 0.68d0))) then
tmp = x + ((-6.0d0) * ((y - x) * z))
else
tmp = (x * (-3.0d0)) + (y * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.67) || !(z <= 0.68)) {
tmp = x + (-6.0 * ((y - x) * z));
} else {
tmp = (x * -3.0) + (y * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.67) or not (z <= 0.68): tmp = x + (-6.0 * ((y - x) * z)) else: tmp = (x * -3.0) + (y * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.67) || !(z <= 0.68)) tmp = Float64(x + Float64(-6.0 * Float64(Float64(y - x) * z))); else tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.67) || ~((z <= 0.68))) tmp = x + (-6.0 * ((y - x) * z)); else tmp = (x * -3.0) + (y * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.67], N[Not[LessEqual[z, 0.68]], $MachinePrecision]], N[(x + N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.67 \lor \neg \left(z \leq 0.68\right):\\
\;\;\;\;x + -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\end{array}
\end{array}
if z < -0.67000000000000004 or 0.680000000000000049 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 96.9%
if -0.67000000000000004 < z < 0.680000000000000049Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 99.4%
Taylor expanded in z around 0 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in z around 0 98.5%
associate-+r+98.5%
distribute-rgt1-in98.5%
metadata-eval98.5%
*-commutative98.5%
*-commutative98.5%
Simplified98.5%
Final simplification97.7%
(FPCore (x y z) :precision binary64 (if (<= z -0.67) (+ x (* (- y x) (* z -6.0))) (if (<= z 0.64) (+ (* x -3.0) (* y 4.0)) (+ x (* -6.0 (* (- y x) z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.67) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.64) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = x + (-6.0 * ((y - x) * z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.67d0)) then
tmp = x + ((y - x) * (z * (-6.0d0)))
else if (z <= 0.64d0) then
tmp = (x * (-3.0d0)) + (y * 4.0d0)
else
tmp = x + ((-6.0d0) * ((y - x) * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.67) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.64) {
tmp = (x * -3.0) + (y * 4.0);
} else {
tmp = x + (-6.0 * ((y - x) * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.67: tmp = x + ((y - x) * (z * -6.0)) elif z <= 0.64: tmp = (x * -3.0) + (y * 4.0) else: tmp = x + (-6.0 * ((y - x) * z)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.67) tmp = Float64(x + Float64(Float64(y - x) * Float64(z * -6.0))); elseif (z <= 0.64) tmp = Float64(Float64(x * -3.0) + Float64(y * 4.0)); else tmp = Float64(x + Float64(-6.0 * Float64(Float64(y - x) * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.67) tmp = x + ((y - x) * (z * -6.0)); elseif (z <= 0.64) tmp = (x * -3.0) + (y * 4.0); else tmp = x + (-6.0 * ((y - x) * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.67], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.64], N[(N[(x * -3.0), $MachinePrecision] + N[(y * 4.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.67:\\
\;\;\;\;x + \left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.64:\\
\;\;\;\;x \cdot -3 + y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x + -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\end{array}
\end{array}
if z < -0.67000000000000004Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 95.8%
associate-*r*95.8%
*-commutative95.8%
Simplified95.8%
if -0.67000000000000004 < z < 0.640000000000000013Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around 0 99.4%
Taylor expanded in z around 0 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in z around 0 98.5%
associate-+r+98.5%
distribute-rgt1-in98.5%
metadata-eval98.5%
*-commutative98.5%
*-commutative98.5%
Simplified98.5%
if 0.640000000000000013 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 98.2%
Final simplification97.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -8.5e-52) (not (<= y 1.02e+80))) (* y (+ 4.0 (* z -6.0))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -8.5e-52) || !(y <= 1.02e+80)) {
tmp = y * (4.0 + (z * -6.0));
} 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 <= (-8.5d-52)) .or. (.not. (y <= 1.02d+80))) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
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 <= -8.5e-52) || !(y <= 1.02e+80)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -8.5e-52) or not (y <= 1.02e+80): tmp = y * (4.0 + (z * -6.0)) else: tmp = x * (-3.0 + (z * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -8.5e-52) || !(y <= 1.02e+80)) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); 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 <= -8.5e-52) || ~((y <= 1.02e+80))) tmp = y * (4.0 + (z * -6.0)); else tmp = x * (-3.0 + (z * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -8.5e-52], N[Not[LessEqual[y, 1.02e+80]], $MachinePrecision]], N[(y * N[(4.0 + N[(z * -6.0), $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 -8.5 \cdot 10^{-52} \lor \neg \left(y \leq 1.02 \cdot 10^{+80}\right):\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\end{array}
\end{array}
if y < -8.50000000000000006e-52 or 1.02e80 < 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 87.9%
if -8.50000000000000006e-52 < y < 1.02e80Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 73.9%
sub-neg73.9%
distribute-rgt-in73.9%
metadata-eval73.9%
distribute-lft-neg-in73.9%
associate-+r+73.9%
metadata-eval73.9%
distribute-rgt-neg-in73.9%
metadata-eval73.9%
Simplified73.9%
Final simplification80.5%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.6e-55) (not (<= y 5.3e+82))) (* y 4.0) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.6e-55) || !(y <= 5.3e+82)) {
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 <= (-1.6d-55)) .or. (.not. (y <= 5.3d+82))) 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 <= -1.6e-55) || !(y <= 5.3e+82)) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.6e-55) or not (y <= 5.3e+82): tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.6e-55) || !(y <= 5.3e+82)) 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 <= -1.6e-55) || ~((y <= 5.3e+82))) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.6e-55], N[Not[LessEqual[y, 5.3e+82]], $MachinePrecision]], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{-55} \lor \neg \left(y \leq 5.3 \cdot 10^{+82}\right):\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if y < -1.6000000000000001e-55 or 5.29999999999999977e82 < 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 87.8%
Taylor expanded in z around 0 49.4%
if -1.6000000000000001e-55 < y < 5.29999999999999977e82Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 73.3%
sub-neg73.3%
distribute-rgt-in73.3%
metadata-eval73.3%
distribute-lft-neg-in73.3%
associate-+r+73.3%
metadata-eval73.3%
distribute-rgt-neg-in73.3%
metadata-eval73.3%
Simplified73.3%
Taylor expanded in z around 0 38.4%
*-commutative38.4%
Simplified38.4%
Final simplification43.6%
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- 0.6666666666666666 z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * (0.6666666666666666 - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * (0.6666666666666666d0 - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * (0.6666666666666666 - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * (0.6666666666666666 - z))
function code(x, y, z) return Float64(x + Float64(Float64(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%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 47.0%
sub-neg47.0%
distribute-rgt-in47.0%
metadata-eval47.0%
distribute-lft-neg-in47.0%
associate-+r+47.0%
metadata-eval47.0%
distribute-rgt-neg-in47.0%
metadata-eval47.0%
Simplified47.0%
Taylor expanded in z around 0 24.1%
*-commutative24.1%
Simplified24.1%
herbie shell --seed 2024108
(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))))