
(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 16 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.7%
+-commutative99.7%
associate-*l*99.8%
fma-def99.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 (* 6.0 (* x z))))
(if (<= z -7e+241)
t_0
(if (<= z -1.5e+130)
t_1
(if (<= z -1.06e+71)
t_0
(if (<= z -3700.0)
t_1
(if (<= z -6e-160)
(* x -3.0)
(if (<= z -7e-191)
(* y 4.0)
(if (<= z 2.25e-297)
(* x -3.0)
(if (<= z 2.7e-182)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (<= z 1.8e+217) t_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 <= -7e+241) {
tmp = t_0;
} else if (z <= -1.5e+130) {
tmp = t_1;
} else if (z <= -1.06e+71) {
tmp = t_0;
} else if (z <= -3700.0) {
tmp = t_1;
} else if (z <= -6e-160) {
tmp = x * -3.0;
} else if (z <= -7e-191) {
tmp = y * 4.0;
} else if (z <= 2.25e-297) {
tmp = x * -3.0;
} else if (z <= 2.7e-182) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 1.8e+217) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
t_1 = 6.0d0 * (x * z)
if (z <= (-7d+241)) then
tmp = t_0
else if (z <= (-1.5d+130)) then
tmp = t_1
else if (z <= (-1.06d+71)) then
tmp = t_0
else if (z <= (-3700.0d0)) then
tmp = t_1
else if (z <= (-6d-160)) then
tmp = x * (-3.0d0)
else if (z <= (-7d-191)) then
tmp = y * 4.0d0
else if (z <= 2.25d-297) then
tmp = x * (-3.0d0)
else if (z <= 2.7d-182) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if (z <= 1.8d+217) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double t_1 = 6.0 * (x * z);
double tmp;
if (z <= -7e+241) {
tmp = t_0;
} else if (z <= -1.5e+130) {
tmp = t_1;
} else if (z <= -1.06e+71) {
tmp = t_0;
} else if (z <= -3700.0) {
tmp = t_1;
} else if (z <= -6e-160) {
tmp = x * -3.0;
} else if (z <= -7e-191) {
tmp = y * 4.0;
} else if (z <= 2.25e-297) {
tmp = x * -3.0;
} else if (z <= 2.7e-182) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 1.8e+217) {
tmp = t_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 <= -7e+241: tmp = t_0 elif z <= -1.5e+130: tmp = t_1 elif z <= -1.06e+71: tmp = t_0 elif z <= -3700.0: tmp = t_1 elif z <= -6e-160: tmp = x * -3.0 elif z <= -7e-191: tmp = y * 4.0 elif z <= 2.25e-297: tmp = x * -3.0 elif z <= 2.7e-182: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif z <= 1.8e+217: tmp = t_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 <= -7e+241) tmp = t_0; elseif (z <= -1.5e+130) tmp = t_1; elseif (z <= -1.06e+71) tmp = t_0; elseif (z <= -3700.0) tmp = t_1; elseif (z <= -6e-160) tmp = Float64(x * -3.0); elseif (z <= -7e-191) tmp = Float64(y * 4.0); elseif (z <= 2.25e-297) tmp = Float64(x * -3.0); elseif (z <= 2.7e-182) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif (z <= 1.8e+217) tmp = t_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 <= -7e+241) tmp = t_0; elseif (z <= -1.5e+130) tmp = t_1; elseif (z <= -1.06e+71) tmp = t_0; elseif (z <= -3700.0) tmp = t_1; elseif (z <= -6e-160) tmp = x * -3.0; elseif (z <= -7e-191) tmp = y * 4.0; elseif (z <= 2.25e-297) tmp = x * -3.0; elseif (z <= 2.7e-182) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif (z <= 1.8e+217) tmp = t_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, -7e+241], t$95$0, If[LessEqual[z, -1.5e+130], t$95$1, If[LessEqual[z, -1.06e+71], t$95$0, If[LessEqual[z, -3700.0], t$95$1, If[LessEqual[z, -6e-160], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -7e-191], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.25e-297], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.7e-182], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.8e+217], t$95$0, 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 \cdot 10^{+241}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.06 \cdot 10^{+71}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3700:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6 \cdot 10^{-160}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-191}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-297}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-182}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+217}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7e241 or -1.5e130 < z < -1.06e71 or 0.5 < z < 1.8000000000000001e217Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-def99.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 64.5%
Taylor expanded in z around inf 64.5%
Taylor expanded in y around 0 64.4%
if -7e241 < z < -1.5e130 or -1.06e71 < z < -3700 or 1.8000000000000001e217 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 68.5%
sub-neg68.5%
distribute-rgt-in68.5%
metadata-eval68.5%
metadata-eval68.5%
neg-mul-168.5%
associate-*r*68.5%
*-commutative68.5%
distribute-lft-in68.5%
distribute-rgt-in68.5%
metadata-eval68.5%
metadata-eval68.5%
associate-+r+68.5%
metadata-eval68.5%
metadata-eval68.5%
*-commutative68.5%
associate-*l*68.5%
metadata-eval68.5%
Simplified68.5%
Taylor expanded in z around inf 65.6%
if -3700 < z < -5.99999999999999993e-160 or -7.00000000000000013e-191 < z < 2.24999999999999988e-297 or 2.69999999999999999e-182 < z < 0.5Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 65.9%
sub-neg65.9%
distribute-rgt-in65.9%
metadata-eval65.9%
metadata-eval65.9%
neg-mul-165.9%
associate-*r*65.9%
*-commutative65.9%
distribute-lft-in65.9%
distribute-rgt-in65.9%
metadata-eval65.9%
metadata-eval65.9%
associate-+r+65.9%
metadata-eval65.9%
metadata-eval65.9%
*-commutative65.9%
associate-*l*65.9%
metadata-eval65.9%
Simplified65.9%
Taylor expanded in z around 0 64.0%
*-commutative64.0%
Simplified64.0%
if -5.99999999999999993e-160 < z < -7.00000000000000013e-191 or 2.24999999999999988e-297 < z < 2.69999999999999999e-182Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.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 72.3%
Taylor expanded in z around 0 72.3%
Final simplification65.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))) (t_1 (* x (* z 6.0))))
(if (<= z -1.85e+242)
t_0
(if (<= z -6.2e+130)
(* 6.0 (* x z))
(if (<= z -8e+70)
t_0
(if (<= z -3700.0)
t_1
(if (<= z -2e-158)
(* x -3.0)
(if (<= z -1.6e-191)
(* y 4.0)
(if (<= z 4.8e-297)
(* x -3.0)
(if (<= z 6.2e-182)
(* y 4.0)
(if (<= z 0.6)
(* x -3.0)
(if (<= z 9e+222) t_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 <= -1.85e+242) {
tmp = t_0;
} else if (z <= -6.2e+130) {
tmp = 6.0 * (x * z);
} else if (z <= -8e+70) {
tmp = t_0;
} else if (z <= -3700.0) {
tmp = t_1;
} else if (z <= -2e-158) {
tmp = x * -3.0;
} else if (z <= -1.6e-191) {
tmp = y * 4.0;
} else if (z <= 4.8e-297) {
tmp = x * -3.0;
} else if (z <= 6.2e-182) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else if (z <= 9e+222) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
t_1 = x * (z * 6.0d0)
if (z <= (-1.85d+242)) then
tmp = t_0
else if (z <= (-6.2d+130)) then
tmp = 6.0d0 * (x * z)
else if (z <= (-8d+70)) then
tmp = t_0
else if (z <= (-3700.0d0)) then
tmp = t_1
else if (z <= (-2d-158)) then
tmp = x * (-3.0d0)
else if (z <= (-1.6d-191)) then
tmp = y * 4.0d0
else if (z <= 4.8d-297) then
tmp = x * (-3.0d0)
else if (z <= 6.2d-182) then
tmp = y * 4.0d0
else if (z <= 0.6d0) then
tmp = x * (-3.0d0)
else if (z <= 9d+222) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double t_1 = x * (z * 6.0);
double tmp;
if (z <= -1.85e+242) {
tmp = t_0;
} else if (z <= -6.2e+130) {
tmp = 6.0 * (x * z);
} else if (z <= -8e+70) {
tmp = t_0;
} else if (z <= -3700.0) {
tmp = t_1;
} else if (z <= -2e-158) {
tmp = x * -3.0;
} else if (z <= -1.6e-191) {
tmp = y * 4.0;
} else if (z <= 4.8e-297) {
tmp = x * -3.0;
} else if (z <= 6.2e-182) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else if (z <= 9e+222) {
tmp = t_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 <= -1.85e+242: tmp = t_0 elif z <= -6.2e+130: tmp = 6.0 * (x * z) elif z <= -8e+70: tmp = t_0 elif z <= -3700.0: tmp = t_1 elif z <= -2e-158: tmp = x * -3.0 elif z <= -1.6e-191: tmp = y * 4.0 elif z <= 4.8e-297: tmp = x * -3.0 elif z <= 6.2e-182: tmp = y * 4.0 elif z <= 0.6: tmp = x * -3.0 elif z <= 9e+222: tmp = t_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 <= -1.85e+242) tmp = t_0; elseif (z <= -6.2e+130) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= -8e+70) tmp = t_0; elseif (z <= -3700.0) tmp = t_1; elseif (z <= -2e-158) tmp = Float64(x * -3.0); elseif (z <= -1.6e-191) tmp = Float64(y * 4.0); elseif (z <= 4.8e-297) tmp = Float64(x * -3.0); elseif (z <= 6.2e-182) tmp = Float64(y * 4.0); elseif (z <= 0.6) tmp = Float64(x * -3.0); elseif (z <= 9e+222) tmp = t_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 <= -1.85e+242) tmp = t_0; elseif (z <= -6.2e+130) tmp = 6.0 * (x * z); elseif (z <= -8e+70) tmp = t_0; elseif (z <= -3700.0) tmp = t_1; elseif (z <= -2e-158) tmp = x * -3.0; elseif (z <= -1.6e-191) tmp = y * 4.0; elseif (z <= 4.8e-297) tmp = x * -3.0; elseif (z <= 6.2e-182) tmp = y * 4.0; elseif (z <= 0.6) tmp = x * -3.0; elseif (z <= 9e+222) tmp = t_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, -1.85e+242], t$95$0, If[LessEqual[z, -6.2e+130], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8e+70], t$95$0, If[LessEqual[z, -3700.0], t$95$1, If[LessEqual[z, -2e-158], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.6e-191], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 4.8e-297], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.2e-182], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 9e+222], t$95$0, 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 -1.85 \cdot 10^{+242}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{+130}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -8 \cdot 10^{+70}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3700:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-158}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-191}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-297}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-182}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+222}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.85e242 or -6.1999999999999999e130 < z < -8.00000000000000058e70 or 0.599999999999999978 < z < 8.99999999999999978e222Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-def99.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 64.5%
Taylor expanded in z around inf 64.5%
Taylor expanded in y around 0 64.4%
if -1.85e242 < z < -6.1999999999999999e130Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 70.6%
sub-neg70.6%
distribute-rgt-in70.6%
metadata-eval70.6%
metadata-eval70.6%
neg-mul-170.6%
associate-*r*70.6%
*-commutative70.6%
distribute-lft-in70.6%
distribute-rgt-in70.6%
metadata-eval70.6%
metadata-eval70.6%
associate-+r+70.6%
metadata-eval70.6%
metadata-eval70.6%
*-commutative70.6%
associate-*l*70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in z around inf 70.7%
if -8.00000000000000058e70 < z < -3700 or 8.99999999999999978e222 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 67.3%
sub-neg67.3%
distribute-rgt-in67.3%
metadata-eval67.3%
metadata-eval67.3%
neg-mul-167.3%
associate-*r*67.3%
*-commutative67.3%
distribute-lft-in67.3%
distribute-rgt-in67.3%
metadata-eval67.3%
metadata-eval67.3%
associate-+r+67.3%
metadata-eval67.3%
metadata-eval67.3%
*-commutative67.3%
associate-*l*67.3%
metadata-eval67.3%
Simplified67.3%
Taylor expanded in z around inf 62.7%
*-commutative62.7%
associate-*l*62.8%
*-commutative62.8%
*-commutative62.8%
Simplified62.8%
if -3700 < z < -2.00000000000000013e-158 or -1.6000000000000002e-191 < z < 4.7999999999999999e-297 or 6.20000000000000016e-182 < z < 0.599999999999999978Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 65.9%
sub-neg65.9%
distribute-rgt-in65.9%
metadata-eval65.9%
metadata-eval65.9%
neg-mul-165.9%
associate-*r*65.9%
*-commutative65.9%
distribute-lft-in65.9%
distribute-rgt-in65.9%
metadata-eval65.9%
metadata-eval65.9%
associate-+r+65.9%
metadata-eval65.9%
metadata-eval65.9%
*-commutative65.9%
associate-*l*65.9%
metadata-eval65.9%
Simplified65.9%
Taylor expanded in z around 0 64.0%
*-commutative64.0%
Simplified64.0%
if -2.00000000000000013e-158 < z < -1.6000000000000002e-191 or 4.7999999999999999e-297 < z < 6.20000000000000016e-182Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.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 72.3%
Taylor expanded in z around 0 72.3%
Final simplification65.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* z -6.0))) (t_1 (* x (* z 6.0))))
(if (<= z -1.8e+242)
(* -6.0 (* y z))
(if (<= z -1.06e+130)
(* 6.0 (* x z))
(if (<= z -1.3e+78)
t_0
(if (<= z -3700.0)
t_1
(if (<= z -2.2e-160)
(* x -3.0)
(if (<= z -5.2e-190)
(* y 4.0)
(if (<= z 3.5e-300)
(* x -3.0)
(if (<= z 1.4e-182)
(* y 4.0)
(if (<= z 0.5)
(* x -3.0)
(if (<= z 6.8e+215) t_0 t_1))))))))))))
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 <= -1.8e+242) {
tmp = -6.0 * (y * z);
} else if (z <= -1.06e+130) {
tmp = 6.0 * (x * z);
} else if (z <= -1.3e+78) {
tmp = t_0;
} else if (z <= -3700.0) {
tmp = t_1;
} else if (z <= -2.2e-160) {
tmp = x * -3.0;
} else if (z <= -5.2e-190) {
tmp = y * 4.0;
} else if (z <= 3.5e-300) {
tmp = x * -3.0;
} else if (z <= 1.4e-182) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 6.8e+215) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y * (z * (-6.0d0))
t_1 = x * (z * 6.0d0)
if (z <= (-1.8d+242)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-1.06d+130)) then
tmp = 6.0d0 * (x * z)
else if (z <= (-1.3d+78)) then
tmp = t_0
else if (z <= (-3700.0d0)) then
tmp = t_1
else if (z <= (-2.2d-160)) then
tmp = x * (-3.0d0)
else if (z <= (-5.2d-190)) then
tmp = y * 4.0d0
else if (z <= 3.5d-300) then
tmp = x * (-3.0d0)
else if (z <= 1.4d-182) then
tmp = y * 4.0d0
else if (z <= 0.5d0) then
tmp = x * (-3.0d0)
else if (z <= 6.8d+215) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double t_1 = x * (z * 6.0);
double tmp;
if (z <= -1.8e+242) {
tmp = -6.0 * (y * z);
} else if (z <= -1.06e+130) {
tmp = 6.0 * (x * z);
} else if (z <= -1.3e+78) {
tmp = t_0;
} else if (z <= -3700.0) {
tmp = t_1;
} else if (z <= -2.2e-160) {
tmp = x * -3.0;
} else if (z <= -5.2e-190) {
tmp = y * 4.0;
} else if (z <= 3.5e-300) {
tmp = x * -3.0;
} else if (z <= 1.4e-182) {
tmp = y * 4.0;
} else if (z <= 0.5) {
tmp = x * -3.0;
} else if (z <= 6.8e+215) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = y * (z * -6.0) t_1 = x * (z * 6.0) tmp = 0 if z <= -1.8e+242: tmp = -6.0 * (y * z) elif z <= -1.06e+130: tmp = 6.0 * (x * z) elif z <= -1.3e+78: tmp = t_0 elif z <= -3700.0: tmp = t_1 elif z <= -2.2e-160: tmp = x * -3.0 elif z <= -5.2e-190: tmp = y * 4.0 elif z <= 3.5e-300: tmp = x * -3.0 elif z <= 1.4e-182: tmp = y * 4.0 elif z <= 0.5: tmp = x * -3.0 elif z <= 6.8e+215: tmp = t_0 else: tmp = t_1 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 <= -1.8e+242) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -1.06e+130) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= -1.3e+78) tmp = t_0; elseif (z <= -3700.0) tmp = t_1; elseif (z <= -2.2e-160) tmp = Float64(x * -3.0); elseif (z <= -5.2e-190) tmp = Float64(y * 4.0); elseif (z <= 3.5e-300) tmp = Float64(x * -3.0); elseif (z <= 1.4e-182) tmp = Float64(y * 4.0); elseif (z <= 0.5) tmp = Float64(x * -3.0); elseif (z <= 6.8e+215) tmp = t_0; else tmp = t_1; 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 <= -1.8e+242) tmp = -6.0 * (y * z); elseif (z <= -1.06e+130) tmp = 6.0 * (x * z); elseif (z <= -1.3e+78) tmp = t_0; elseif (z <= -3700.0) tmp = t_1; elseif (z <= -2.2e-160) tmp = x * -3.0; elseif (z <= -5.2e-190) tmp = y * 4.0; elseif (z <= 3.5e-300) tmp = x * -3.0; elseif (z <= 1.4e-182) tmp = y * 4.0; elseif (z <= 0.5) tmp = x * -3.0; elseif (z <= 6.8e+215) tmp = t_0; else tmp = t_1; 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, -1.8e+242], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.06e+130], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.3e+78], t$95$0, If[LessEqual[z, -3700.0], t$95$1, If[LessEqual[z, -2.2e-160], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -5.2e-190], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 3.5e-300], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.4e-182], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.5], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 6.8e+215], t$95$0, t$95$1]]]]]]]]]]]]
\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 -1.8 \cdot 10^{+242}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -1.06 \cdot 10^{+130}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{+78}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3700:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-160}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -5.2 \cdot 10^{-190}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-300}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-182}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+215}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.79999999999999997e242Initial program 99.8%
+-commutative99.8%
associate-*l*99.9%
fma-def99.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 74.2%
Taylor expanded in z around inf 74.2%
Taylor expanded in y around 0 74.2%
if -1.79999999999999997e242 < z < -1.06e130Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 70.6%
sub-neg70.6%
distribute-rgt-in70.6%
metadata-eval70.6%
metadata-eval70.6%
neg-mul-170.6%
associate-*r*70.6%
*-commutative70.6%
distribute-lft-in70.6%
distribute-rgt-in70.6%
metadata-eval70.6%
metadata-eval70.6%
associate-+r+70.6%
metadata-eval70.6%
metadata-eval70.6%
*-commutative70.6%
associate-*l*70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in z around inf 70.7%
if -1.06e130 < z < -1.3e78 or 0.5 < z < 6.80000000000000036e215Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-def99.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 61.8%
Taylor expanded in z around inf 61.8%
if -1.3e78 < z < -3700 or 6.80000000000000036e215 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 66.4%
sub-neg66.4%
distribute-rgt-in66.4%
metadata-eval66.4%
metadata-eval66.4%
neg-mul-166.4%
associate-*r*66.4%
*-commutative66.4%
distribute-lft-in66.4%
distribute-rgt-in66.4%
metadata-eval66.4%
metadata-eval66.4%
associate-+r+66.4%
metadata-eval66.4%
metadata-eval66.4%
*-commutative66.4%
associate-*l*66.4%
metadata-eval66.4%
Simplified66.4%
Taylor expanded in z around inf 62.0%
*-commutative62.0%
associate-*l*62.1%
*-commutative62.1%
*-commutative62.1%
Simplified62.1%
if -3700 < z < -2.2e-160 or -5.1999999999999996e-190 < z < 3.5000000000000002e-300 or 1.39999999999999997e-182 < z < 0.5Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 65.9%
sub-neg65.9%
distribute-rgt-in65.9%
metadata-eval65.9%
metadata-eval65.9%
neg-mul-165.9%
associate-*r*65.9%
*-commutative65.9%
distribute-lft-in65.9%
distribute-rgt-in65.9%
metadata-eval65.9%
metadata-eval65.9%
associate-+r+65.9%
metadata-eval65.9%
metadata-eval65.9%
*-commutative65.9%
associate-*l*65.9%
metadata-eval65.9%
Simplified65.9%
Taylor expanded in z around 0 64.0%
*-commutative64.0%
Simplified64.0%
if -2.2e-160 < z < -5.1999999999999996e-190 or 3.5000000000000002e-300 < z < 1.39999999999999997e-182Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.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 72.3%
Taylor expanded in z around 0 72.3%
Final simplification65.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))))
(if (<= z -7e+241)
(* -6.0 (* y z))
(if (<= z -2.8e+130)
(* 6.0 (* x z))
(if (<= z -1.75e+75)
(* y (* z -6.0))
(if (<= z -3700.0)
t_0
(if (<= z -3.4e-159)
(* x -3.0)
(if (<= z -7.8e-192)
(* y 4.0)
(if (<= z 5.1e-300)
(* x -3.0)
(if (<= z 8.5e-182)
(* y 4.0)
(if (<= z 0.6)
(* x -3.0)
(if (<= z 4.7e+219) (* z (* y -6.0)) t_0))))))))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -7e+241) {
tmp = -6.0 * (y * z);
} else if (z <= -2.8e+130) {
tmp = 6.0 * (x * z);
} else if (z <= -1.75e+75) {
tmp = y * (z * -6.0);
} else if (z <= -3700.0) {
tmp = t_0;
} else if (z <= -3.4e-159) {
tmp = x * -3.0;
} else if (z <= -7.8e-192) {
tmp = y * 4.0;
} else if (z <= 5.1e-300) {
tmp = x * -3.0;
} else if (z <= 8.5e-182) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else if (z <= 4.7e+219) {
tmp = z * (y * -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 = x * (z * 6.0d0)
if (z <= (-7d+241)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-2.8d+130)) then
tmp = 6.0d0 * (x * z)
else if (z <= (-1.75d+75)) then
tmp = y * (z * (-6.0d0))
else if (z <= (-3700.0d0)) then
tmp = t_0
else if (z <= (-3.4d-159)) then
tmp = x * (-3.0d0)
else if (z <= (-7.8d-192)) then
tmp = y * 4.0d0
else if (z <= 5.1d-300) then
tmp = x * (-3.0d0)
else if (z <= 8.5d-182) then
tmp = y * 4.0d0
else if (z <= 0.6d0) then
tmp = x * (-3.0d0)
else if (z <= 4.7d+219) then
tmp = z * (y * (-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 = x * (z * 6.0);
double tmp;
if (z <= -7e+241) {
tmp = -6.0 * (y * z);
} else if (z <= -2.8e+130) {
tmp = 6.0 * (x * z);
} else if (z <= -1.75e+75) {
tmp = y * (z * -6.0);
} else if (z <= -3700.0) {
tmp = t_0;
} else if (z <= -3.4e-159) {
tmp = x * -3.0;
} else if (z <= -7.8e-192) {
tmp = y * 4.0;
} else if (z <= 5.1e-300) {
tmp = x * -3.0;
} else if (z <= 8.5e-182) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else if (z <= 4.7e+219) {
tmp = z * (y * -6.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -7e+241: tmp = -6.0 * (y * z) elif z <= -2.8e+130: tmp = 6.0 * (x * z) elif z <= -1.75e+75: tmp = y * (z * -6.0) elif z <= -3700.0: tmp = t_0 elif z <= -3.4e-159: tmp = x * -3.0 elif z <= -7.8e-192: tmp = y * 4.0 elif z <= 5.1e-300: tmp = x * -3.0 elif z <= 8.5e-182: tmp = y * 4.0 elif z <= 0.6: tmp = x * -3.0 elif z <= 4.7e+219: tmp = z * (y * -6.0) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(z * 6.0)) tmp = 0.0 if (z <= -7e+241) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -2.8e+130) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= -1.75e+75) tmp = Float64(y * Float64(z * -6.0)); elseif (z <= -3700.0) tmp = t_0; elseif (z <= -3.4e-159) tmp = Float64(x * -3.0); elseif (z <= -7.8e-192) tmp = Float64(y * 4.0); elseif (z <= 5.1e-300) tmp = Float64(x * -3.0); elseif (z <= 8.5e-182) tmp = Float64(y * 4.0); elseif (z <= 0.6) tmp = Float64(x * -3.0); elseif (z <= 4.7e+219) tmp = Float64(z * Float64(y * -6.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (z * 6.0); tmp = 0.0; if (z <= -7e+241) tmp = -6.0 * (y * z); elseif (z <= -2.8e+130) tmp = 6.0 * (x * z); elseif (z <= -1.75e+75) tmp = y * (z * -6.0); elseif (z <= -3700.0) tmp = t_0; elseif (z <= -3.4e-159) tmp = x * -3.0; elseif (z <= -7.8e-192) tmp = y * 4.0; elseif (z <= 5.1e-300) tmp = x * -3.0; elseif (z <= 8.5e-182) tmp = y * 4.0; elseif (z <= 0.6) tmp = x * -3.0; elseif (z <= 4.7e+219) tmp = z * (y * -6.0); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+241], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.8e+130], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.75e+75], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3700.0], t$95$0, If[LessEqual[z, -3.4e-159], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -7.8e-192], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.1e-300], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8.5e-182], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 4.7e+219], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -7 \cdot 10^{+241}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -2.8 \cdot 10^{+130}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{+75}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq -3700:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-159}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -7.8 \cdot 10^{-192}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-300}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-182}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 4.7 \cdot 10^{+219}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -7e241Initial program 99.8%
+-commutative99.8%
associate-*l*99.9%
fma-def99.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 74.2%
Taylor expanded in z around inf 74.2%
Taylor expanded in y around 0 74.2%
if -7e241 < z < -2.7999999999999999e130Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 70.6%
sub-neg70.6%
distribute-rgt-in70.6%
metadata-eval70.6%
metadata-eval70.6%
neg-mul-170.6%
associate-*r*70.6%
*-commutative70.6%
distribute-lft-in70.6%
distribute-rgt-in70.6%
metadata-eval70.6%
metadata-eval70.6%
associate-+r+70.6%
metadata-eval70.6%
metadata-eval70.6%
*-commutative70.6%
associate-*l*70.6%
metadata-eval70.6%
Simplified70.6%
Taylor expanded in z around inf 70.7%
if -2.7999999999999999e130 < z < -1.7499999999999999e75Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-def99.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 68.0%
Taylor expanded in z around inf 68.0%
if -1.7499999999999999e75 < z < -3700 or 4.70000000000000013e219 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 66.4%
sub-neg66.4%
distribute-rgt-in66.4%
metadata-eval66.4%
metadata-eval66.4%
neg-mul-166.4%
associate-*r*66.4%
*-commutative66.4%
distribute-lft-in66.4%
distribute-rgt-in66.4%
metadata-eval66.4%
metadata-eval66.4%
associate-+r+66.4%
metadata-eval66.4%
metadata-eval66.4%
*-commutative66.4%
associate-*l*66.4%
metadata-eval66.4%
Simplified66.4%
Taylor expanded in z around inf 62.0%
*-commutative62.0%
associate-*l*62.1%
*-commutative62.1%
*-commutative62.1%
Simplified62.1%
if -3700 < z < -3.39999999999999984e-159 or -7.8000000000000005e-192 < z < 5.0999999999999999e-300 or 8.5000000000000001e-182 < z < 0.599999999999999978Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 65.9%
sub-neg65.9%
distribute-rgt-in65.9%
metadata-eval65.9%
metadata-eval65.9%
neg-mul-165.9%
associate-*r*65.9%
*-commutative65.9%
distribute-lft-in65.9%
distribute-rgt-in65.9%
metadata-eval65.9%
metadata-eval65.9%
associate-+r+65.9%
metadata-eval65.9%
metadata-eval65.9%
*-commutative65.9%
associate-*l*65.9%
metadata-eval65.9%
Simplified65.9%
Taylor expanded in z around 0 64.0%
*-commutative64.0%
Simplified64.0%
if -3.39999999999999984e-159 < z < -7.8000000000000005e-192 or 5.0999999999999999e-300 < z < 8.5000000000000001e-182Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.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 72.3%
Taylor expanded in z around 0 72.3%
if 0.599999999999999978 < z < 4.70000000000000013e219Initial program 99.8%
+-commutative99.8%
associate-*l*99.9%
fma-def99.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 60.0%
Taylor expanded in z around inf 60.0%
Taylor expanded in y around 0 59.9%
associate-*r*60.1%
*-commutative60.1%
*-commutative60.1%
Simplified60.1%
Final simplification65.3%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (+ -3.0 (* z 6.0)))) (t_1 (* z (* (- y x) -6.0))))
(if (<= z -1150000000000.0)
t_1
(if (<= z -2.3e-159)
t_0
(if (<= z -3.2e-190)
(* y 4.0)
(if (<= z 7.5e-297)
(* x -3.0)
(if (<= z 1.42e-182)
(* y 4.0)
(if (<= z 150000000.0) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double t_1 = z * ((y - x) * -6.0);
double tmp;
if (z <= -1150000000000.0) {
tmp = t_1;
} else if (z <= -2.3e-159) {
tmp = t_0;
} else if (z <= -3.2e-190) {
tmp = y * 4.0;
} else if (z <= 7.5e-297) {
tmp = x * -3.0;
} else if (z <= 1.42e-182) {
tmp = y * 4.0;
} else if (z <= 150000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * ((-3.0d0) + (z * 6.0d0))
t_1 = z * ((y - x) * (-6.0d0))
if (z <= (-1150000000000.0d0)) then
tmp = t_1
else if (z <= (-2.3d-159)) then
tmp = t_0
else if (z <= (-3.2d-190)) then
tmp = y * 4.0d0
else if (z <= 7.5d-297) then
tmp = x * (-3.0d0)
else if (z <= 1.42d-182) then
tmp = y * 4.0d0
else if (z <= 150000000.0d0) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (-3.0 + (z * 6.0));
double t_1 = z * ((y - x) * -6.0);
double tmp;
if (z <= -1150000000000.0) {
tmp = t_1;
} else if (z <= -2.3e-159) {
tmp = t_0;
} else if (z <= -3.2e-190) {
tmp = y * 4.0;
} else if (z <= 7.5e-297) {
tmp = x * -3.0;
} else if (z <= 1.42e-182) {
tmp = y * 4.0;
} else if (z <= 150000000.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * (-3.0 + (z * 6.0)) t_1 = z * ((y - x) * -6.0) tmp = 0 if z <= -1150000000000.0: tmp = t_1 elif z <= -2.3e-159: tmp = t_0 elif z <= -3.2e-190: tmp = y * 4.0 elif z <= 7.5e-297: tmp = x * -3.0 elif z <= 1.42e-182: tmp = y * 4.0 elif z <= 150000000.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(-3.0 + Float64(z * 6.0))) t_1 = Float64(z * Float64(Float64(y - x) * -6.0)) tmp = 0.0 if (z <= -1150000000000.0) tmp = t_1; elseif (z <= -2.3e-159) tmp = t_0; elseif (z <= -3.2e-190) tmp = Float64(y * 4.0); elseif (z <= 7.5e-297) tmp = Float64(x * -3.0); elseif (z <= 1.42e-182) tmp = Float64(y * 4.0); elseif (z <= 150000000.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (-3.0 + (z * 6.0)); t_1 = z * ((y - x) * -6.0); tmp = 0.0; if (z <= -1150000000000.0) tmp = t_1; elseif (z <= -2.3e-159) tmp = t_0; elseif (z <= -3.2e-190) tmp = y * 4.0; elseif (z <= 7.5e-297) tmp = x * -3.0; elseif (z <= 1.42e-182) tmp = y * 4.0; elseif (z <= 150000000.0) tmp = t_0; else tmp = t_1; 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]}, Block[{t$95$1 = N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1150000000000.0], t$95$1, If[LessEqual[z, -2.3e-159], t$95$0, If[LessEqual[z, -3.2e-190], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7.5e-297], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.42e-182], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 150000000.0], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(-3 + z \cdot 6\right)\\
t_1 := z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{if}\;z \leq -1150000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-159}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-190}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-297}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.42 \cdot 10^{-182}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 150000000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.15e12 or 1.5e8 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
flip-+28.9%
pow228.9%
associate-*l*28.8%
pow228.8%
associate-*l*28.9%
Applied egg-rr28.9%
Taylor expanded in y around inf 73.0%
Taylor expanded in z around inf 99.7%
associate--l+99.7%
distribute-lft-in95.2%
distribute-rgt-out--95.2%
metadata-eval95.2%
associate-*l*95.2%
*-commutative95.2%
metadata-eval95.2%
cancel-sign-sub-inv95.2%
associate-*r*95.3%
associate-*r*94.5%
*-commutative94.5%
distribute-lft-out--99.8%
associate-*r*99.6%
*-commutative99.6%
associate-*l*99.7%
Simplified99.7%
if -1.15e12 < z < -2.29999999999999978e-159 or 1.4199999999999999e-182 < z < 1.5e8Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 67.6%
sub-neg67.6%
distribute-rgt-in67.6%
metadata-eval67.6%
metadata-eval67.6%
neg-mul-167.6%
associate-*r*67.6%
*-commutative67.6%
distribute-lft-in67.6%
distribute-rgt-in67.6%
metadata-eval67.6%
metadata-eval67.6%
associate-+r+67.6%
metadata-eval67.6%
metadata-eval67.6%
*-commutative67.6%
associate-*l*67.6%
metadata-eval67.6%
Simplified67.6%
if -2.29999999999999978e-159 < z < -3.2000000000000001e-190 or 7.4999999999999994e-297 < z < 1.4199999999999999e-182Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.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 72.3%
Taylor expanded in z around 0 72.3%
if -3.2000000000000001e-190 < z < 7.4999999999999994e-297Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 64.3%
sub-neg64.3%
distribute-rgt-in64.3%
metadata-eval64.3%
metadata-eval64.3%
neg-mul-164.3%
associate-*r*64.3%
*-commutative64.3%
distribute-lft-in64.3%
distribute-rgt-in64.3%
metadata-eval64.3%
metadata-eval64.3%
associate-+r+64.3%
metadata-eval64.3%
metadata-eval64.3%
*-commutative64.3%
associate-*l*64.3%
metadata-eval64.3%
Simplified64.3%
Taylor expanded in z around 0 64.3%
*-commutative64.3%
Simplified64.3%
Final simplification84.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -10.5)
t_0
(if (<= z -3.3e-160)
(* x -3.0)
(if (<= z -1.65e-190)
(* y 4.0)
(if (<= z 8e-298)
(* x -3.0)
(if (<= z 2.25e-182) (* 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 * (y * z);
double tmp;
if (z <= -10.5) {
tmp = t_0;
} else if (z <= -3.3e-160) {
tmp = x * -3.0;
} else if (z <= -1.65e-190) {
tmp = y * 4.0;
} else if (z <= 8e-298) {
tmp = x * -3.0;
} else if (z <= 2.25e-182) {
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) * (y * z)
if (z <= (-10.5d0)) then
tmp = t_0
else if (z <= (-3.3d-160)) then
tmp = x * (-3.0d0)
else if (z <= (-1.65d-190)) then
tmp = y * 4.0d0
else if (z <= 8d-298) then
tmp = x * (-3.0d0)
else if (z <= 2.25d-182) 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 * (y * z);
double tmp;
if (z <= -10.5) {
tmp = t_0;
} else if (z <= -3.3e-160) {
tmp = x * -3.0;
} else if (z <= -1.65e-190) {
tmp = y * 4.0;
} else if (z <= 8e-298) {
tmp = x * -3.0;
} else if (z <= 2.25e-182) {
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 * (y * z) tmp = 0 if z <= -10.5: tmp = t_0 elif z <= -3.3e-160: tmp = x * -3.0 elif z <= -1.65e-190: tmp = y * 4.0 elif z <= 8e-298: tmp = x * -3.0 elif z <= 2.25e-182: 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(y * z)) tmp = 0.0 if (z <= -10.5) tmp = t_0; elseif (z <= -3.3e-160) tmp = Float64(x * -3.0); elseif (z <= -1.65e-190) tmp = Float64(y * 4.0); elseif (z <= 8e-298) tmp = Float64(x * -3.0); elseif (z <= 2.25e-182) 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 * (y * z); tmp = 0.0; if (z <= -10.5) tmp = t_0; elseif (z <= -3.3e-160) tmp = x * -3.0; elseif (z <= -1.65e-190) tmp = y * 4.0; elseif (z <= 8e-298) tmp = x * -3.0; elseif (z <= 2.25e-182) 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[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -10.5], t$95$0, If[LessEqual[z, -3.3e-160], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.65e-190], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 8e-298], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.25e-182], 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(y \cdot z\right)\\
\mathbf{if}\;z \leq -10.5:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-160}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{-190}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-298}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-182}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -10.5 or 0.5 < z Initial program 99.8%
+-commutative99.8%
associate-*l*99.8%
fma-def99.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 52.3%
Taylor expanded in z around inf 51.4%
Taylor expanded in y around 0 51.3%
if -10.5 < z < -3.3e-160 or -1.65000000000000009e-190 < z < 7.9999999999999993e-298 or 2.2499999999999999e-182 < z < 0.5Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 67.3%
sub-neg67.3%
distribute-rgt-in67.3%
metadata-eval67.3%
metadata-eval67.3%
neg-mul-167.3%
associate-*r*67.3%
*-commutative67.3%
distribute-lft-in67.3%
distribute-rgt-in67.3%
metadata-eval67.3%
metadata-eval67.3%
associate-+r+67.3%
metadata-eval67.3%
metadata-eval67.3%
*-commutative67.3%
associate-*l*67.3%
metadata-eval67.3%
Simplified67.3%
Taylor expanded in z around 0 65.4%
*-commutative65.4%
Simplified65.4%
if -3.3e-160 < z < -1.65000000000000009e-190 or 7.9999999999999993e-298 < z < 2.2499999999999999e-182Initial program 99.5%
+-commutative99.5%
associate-*l*99.9%
fma-def99.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 72.3%
Taylor expanded in z around 0 72.3%
Final simplification58.2%
(FPCore (x y z) :precision binary64 (if (<= z -0.58) (* z (* (- y x) -6.0)) (if (<= z 0.58) (+ (* y 4.0) (* x -3.0)) (+ x (* (* z 6.0) (- x y))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = z * ((y - x) * -6.0);
} else if (z <= 0.58) {
tmp = (y * 4.0) + (x * -3.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.58d0)) then
tmp = z * ((y - x) * (-6.0d0))
else if (z <= 0.58d0) then
tmp = (y * 4.0d0) + (x * (-3.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.58) {
tmp = z * ((y - x) * -6.0);
} else if (z <= 0.58) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = x + ((z * 6.0) * (x - y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.58: tmp = z * ((y - x) * -6.0) elif z <= 0.58: tmp = (y * 4.0) + (x * -3.0) else: tmp = x + ((z * 6.0) * (x - y)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.58) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); elseif (z <= 0.58) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.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.58) tmp = z * ((y - x) * -6.0); elseif (z <= 0.58) tmp = (y * 4.0) + (x * -3.0); else tmp = x + ((z * 6.0) * (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.58], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.58], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.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.58:\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.58:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot 6\right) \cdot \left(x - y\right)\\
\end{array}
\end{array}
if z < -0.57999999999999996Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
flip-+39.9%
pow239.9%
associate-*l*39.8%
pow239.8%
associate-*l*39.9%
Applied egg-rr39.9%
Taylor expanded in y around inf 79.9%
Taylor expanded in z around inf 94.8%
associate--l+94.8%
distribute-lft-in92.2%
distribute-rgt-out--92.2%
metadata-eval92.2%
associate-*l*92.2%
*-commutative92.2%
metadata-eval92.2%
cancel-sign-sub-inv92.2%
associate-*r*92.1%
associate-*r*92.2%
*-commutative92.2%
distribute-lft-out--94.9%
associate-*r*94.8%
*-commutative94.8%
associate-*l*94.9%
Simplified94.9%
if -0.57999999999999996 < z < 0.57999999999999996Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 98.3%
if 0.57999999999999996 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
neg-mul-199.8%
Simplified99.8%
distribute-rgt-neg-out99.8%
distribute-lft-neg-in99.8%
add-sqr-sqrt99.4%
sqrt-unprod80.1%
sqr-neg80.1%
sqrt-unprod0.0%
add-sqr-sqrt0.4%
cancel-sign-sub-inv0.4%
*-commutative0.4%
*-commutative0.4%
associate-*r*0.4%
*-commutative0.4%
add-sqr-sqrt0.0%
sqrt-unprod80.1%
sqr-neg80.1%
sqrt-unprod99.5%
add-sqr-sqrt99.9%
Applied egg-rr99.9%
Final simplification97.7%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.25e-39) (not (<= x 1.2e+100))) (* x (+ -3.0 (* z 6.0))) (* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.25e-39) || !(x <= 1.2e+100)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.25d-39)) .or. (.not. (x <= 1.2d+100))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.25e-39) || !(x <= 1.2e+100)) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.25e-39) or not (x <= 1.2e+100): tmp = x * (-3.0 + (z * 6.0)) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.25e-39) || !(x <= 1.2e+100)) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.25e-39) || ~((x <= 1.2e+100))) tmp = x * (-3.0 + (z * 6.0)); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.25e-39], N[Not[LessEqual[x, 1.2e+100]], $MachinePrecision]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-39} \lor \neg \left(x \leq 1.2 \cdot 10^{+100}\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -1.25e-39 or 1.20000000000000006e100 < x Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 85.8%
sub-neg85.8%
distribute-rgt-in85.8%
metadata-eval85.8%
metadata-eval85.8%
neg-mul-185.8%
associate-*r*85.8%
*-commutative85.8%
distribute-lft-in85.8%
distribute-rgt-in85.8%
metadata-eval85.8%
metadata-eval85.8%
associate-+r+85.8%
metadata-eval85.8%
metadata-eval85.8%
*-commutative85.8%
associate-*l*85.8%
metadata-eval85.8%
Simplified85.8%
if -1.25e-39 < x < 1.20000000000000006e100Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.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 72.1%
Final simplification78.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.58) (not (<= z 0.58))) (* z (* (- y x) -6.0)) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.58)) {
tmp = z * ((y - x) * -6.0);
} 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.58d0)) .or. (.not. (z <= 0.58d0))) then
tmp = z * ((y - x) * (-6.0d0))
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.58) || !(z <= 0.58)) {
tmp = z * ((y - x) * -6.0);
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.58) or not (z <= 0.58): tmp = z * ((y - x) * -6.0) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.58) || !(z <= 0.58)) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); 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.58) || ~((z <= 0.58))) tmp = z * ((y - x) * -6.0); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.58], N[Not[LessEqual[z, 0.58]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58 \lor \neg \left(z \leq 0.58\right):\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.57999999999999996 or 0.57999999999999996 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
flip-+32.3%
pow232.3%
associate-*l*32.2%
pow232.2%
associate-*l*32.4%
Applied egg-rr32.4%
Taylor expanded in y around inf 74.3%
Taylor expanded in z around inf 97.1%
associate--l+97.1%
distribute-lft-in92.9%
distribute-rgt-out--92.9%
metadata-eval92.9%
associate-*l*92.9%
*-commutative92.9%
metadata-eval92.9%
cancel-sign-sub-inv92.9%
associate-*r*92.9%
associate-*r*92.2%
*-commutative92.2%
distribute-lft-out--97.2%
associate-*r*97.1%
*-commutative97.1%
associate-*l*97.2%
Simplified97.2%
if -0.57999999999999996 < z < 0.57999999999999996Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 98.2%
Final simplification97.6%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.55) (not (<= z 0.5))) (* z (* (- y x) -6.0)) (+ (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.55) || !(z <= 0.5)) {
tmp = z * ((y - x) * -6.0);
} else {
tmp = (y * 4.0) + (x * -3.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-0.55d0)) .or. (.not. (z <= 0.5d0))) then
tmp = z * ((y - x) * (-6.0d0))
else
tmp = (y * 4.0d0) + (x * (-3.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.55) || !(z <= 0.5)) {
tmp = z * ((y - x) * -6.0);
} else {
tmp = (y * 4.0) + (x * -3.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.55) or not (z <= 0.5): tmp = z * ((y - x) * -6.0) else: tmp = (y * 4.0) + (x * -3.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.55) || !(z <= 0.5)) tmp = Float64(z * Float64(Float64(y - x) * -6.0)); else tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.55) || ~((z <= 0.5))) tmp = z * ((y - x) * -6.0); else tmp = (y * 4.0) + (x * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.55], N[Not[LessEqual[z, 0.5]], $MachinePrecision]], N[(z * N[(N[(y - x), $MachinePrecision] * -6.0), $MachinePrecision]), $MachinePrecision], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.55 \lor \neg \left(z \leq 0.5\right):\\
\;\;\;\;z \cdot \left(\left(y - x\right) \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\end{array}
\end{array}
if z < -0.55000000000000004 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
+-commutative99.8%
flip-+32.3%
pow232.3%
associate-*l*32.2%
pow232.2%
associate-*l*32.4%
Applied egg-rr32.4%
Taylor expanded in y around inf 74.3%
Taylor expanded in z around inf 97.1%
associate--l+97.1%
distribute-lft-in92.9%
distribute-rgt-out--92.9%
metadata-eval92.9%
associate-*l*92.9%
*-commutative92.9%
metadata-eval92.9%
cancel-sign-sub-inv92.9%
associate-*r*92.9%
associate-*r*92.2%
*-commutative92.2%
distribute-lft-out--97.2%
associate-*r*97.1%
*-commutative97.1%
associate-*l*97.2%
Simplified97.2%
if -0.55000000000000004 < z < 0.5Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 98.3%
Final simplification97.7%
(FPCore (x y z) :precision binary64 (if (<= y -5.2e-14) (* y (* z -6.0)) (if (<= y 7.8e+156) (* x (+ -3.0 (* z 6.0))) (* -6.0 (* y z)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.2e-14) {
tmp = y * (z * -6.0);
} else if (y <= 7.8e+156) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = -6.0 * (y * z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-5.2d-14)) then
tmp = y * (z * (-6.0d0))
else if (y <= 7.8d+156) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = (-6.0d0) * (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -5.2e-14) {
tmp = y * (z * -6.0);
} else if (y <= 7.8e+156) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = -6.0 * (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.2e-14: tmp = y * (z * -6.0) elif y <= 7.8e+156: tmp = x * (-3.0 + (z * 6.0)) else: tmp = -6.0 * (y * z) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.2e-14) tmp = Float64(y * Float64(z * -6.0)); elseif (y <= 7.8e+156) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(-6.0 * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5.2e-14) tmp = y * (z * -6.0); elseif (y <= 7.8e+156) tmp = x * (-3.0 + (z * 6.0)); else tmp = -6.0 * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.2e-14], N[(y * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e+156], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.2 \cdot 10^{-14}:\\
\;\;\;\;y \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+156}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if y < -5.19999999999999993e-14Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.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 77.2%
Taylor expanded in z around inf 49.7%
if -5.19999999999999993e-14 < y < 7.7999999999999994e156Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 73.2%
sub-neg73.2%
distribute-rgt-in73.2%
metadata-eval73.2%
metadata-eval73.2%
neg-mul-173.2%
associate-*r*73.2%
*-commutative73.2%
distribute-lft-in73.2%
distribute-rgt-in73.2%
metadata-eval73.2%
metadata-eval73.2%
associate-+r+73.2%
metadata-eval73.2%
metadata-eval73.2%
*-commutative73.2%
associate-*l*73.2%
metadata-eval73.2%
Simplified73.2%
if 7.7999999999999994e156 < y Initial program 99.9%
+-commutative99.9%
associate-*l*99.9%
fma-def99.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 92.6%
Taylor expanded in z around inf 58.6%
Taylor expanded in y around 0 58.7%
Final simplification65.8%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.18e-39) (not (<= x 3.4e+114))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.18e-39) || !(x <= 3.4e+114)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.18d-39)) .or. (.not. (x <= 3.4d+114))) then
tmp = x * (-3.0d0)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.18e-39) || !(x <= 3.4e+114)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.18e-39) or not (x <= 3.4e+114): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.18e-39) || !(x <= 3.4e+114)) tmp = Float64(x * -3.0); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.18e-39) || ~((x <= 3.4e+114))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.18e-39], N[Not[LessEqual[x, 3.4e+114]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.18 \cdot 10^{-39} \lor \neg \left(x \leq 3.4 \cdot 10^{+114}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -1.17999999999999993e-39 or 3.4000000000000001e114 < x Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 85.5%
sub-neg85.5%
distribute-rgt-in85.5%
metadata-eval85.5%
metadata-eval85.5%
neg-mul-185.5%
associate-*r*85.5%
*-commutative85.5%
distribute-lft-in85.5%
distribute-rgt-in85.5%
metadata-eval85.5%
metadata-eval85.5%
associate-+r+85.5%
metadata-eval85.5%
metadata-eval85.5%
*-commutative85.5%
associate-*l*85.5%
metadata-eval85.5%
Simplified85.5%
Taylor expanded in z around 0 44.6%
*-commutative44.6%
Simplified44.6%
if -1.17999999999999993e-39 < x < 3.4000000000000001e114Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-def99.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 71.1%
Taylor expanded in z around 0 32.6%
Final simplification38.2%
(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.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(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.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 55.7%
sub-neg55.7%
distribute-rgt-in55.7%
metadata-eval55.7%
metadata-eval55.7%
neg-mul-155.7%
associate-*r*55.7%
*-commutative55.7%
distribute-lft-in55.7%
distribute-rgt-in55.7%
metadata-eval55.7%
metadata-eval55.7%
associate-+r+55.7%
metadata-eval55.7%
metadata-eval55.7%
*-commutative55.7%
associate-*l*55.7%
metadata-eval55.7%
Simplified55.7%
Taylor expanded in z around 0 27.8%
*-commutative27.8%
Simplified27.8%
Final simplification27.8%
(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.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 54.8%
Taylor expanded in z around 0 2.4%
Final simplification2.4%
herbie shell --seed 2024040
(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))))