
(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 17 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%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (fma (* (- y x) (- 0.6666666666666666 z)) 6.0 x))
double code(double x, double y, double z) {
return fma(((y - x) * (0.6666666666666666 - z)), 6.0, x);
}
function code(x, y, z) return fma(Float64(Float64(y - x) * Float64(0.6666666666666666 - z)), 6.0, x) end
code[x_, y_, z_] := N[(N[(N[(y - x), $MachinePrecision] * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision] * 6.0 + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\left(y - x\right) \cdot \left(0.6666666666666666 - z\right), 6, x\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
+-commutative99.6%
*-commutative99.6%
associate-*r*99.5%
fma-define99.6%
Applied egg-rr99.6%
Final simplification99.6%
(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%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* y 4.0))))
(if (<= z -2.9e-26)
(* z (* x 6.0))
(if (<= z -3.3e-60)
t_0
(if (<= z -8.2e-134)
(* x -3.0)
(if (<= z -2e-157)
t_0
(if (<= z -2.2e-192)
(* x -3.0)
(if (<= z -1.75e-230)
t_0
(if (<= z 2.9e-266)
(* x -3.0)
(if (<= z 2.05e-184)
t_0
(if (<= z 3.1e-168)
(* x -3.0)
(if (<= z 0.76) t_0 (* 6.0 (* x z))))))))))))))
double code(double x, double y, double z) {
double t_0 = x + (y * 4.0);
double tmp;
if (z <= -2.9e-26) {
tmp = z * (x * 6.0);
} else if (z <= -3.3e-60) {
tmp = t_0;
} else if (z <= -8.2e-134) {
tmp = x * -3.0;
} else if (z <= -2e-157) {
tmp = t_0;
} else if (z <= -2.2e-192) {
tmp = x * -3.0;
} else if (z <= -1.75e-230) {
tmp = t_0;
} else if (z <= 2.9e-266) {
tmp = x * -3.0;
} else if (z <= 2.05e-184) {
tmp = t_0;
} else if (z <= 3.1e-168) {
tmp = x * -3.0;
} else if (z <= 0.76) {
tmp = t_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) :: t_0
real(8) :: tmp
t_0 = x + (y * 4.0d0)
if (z <= (-2.9d-26)) then
tmp = z * (x * 6.0d0)
else if (z <= (-3.3d-60)) then
tmp = t_0
else if (z <= (-8.2d-134)) then
tmp = x * (-3.0d0)
else if (z <= (-2d-157)) then
tmp = t_0
else if (z <= (-2.2d-192)) then
tmp = x * (-3.0d0)
else if (z <= (-1.75d-230)) then
tmp = t_0
else if (z <= 2.9d-266) then
tmp = x * (-3.0d0)
else if (z <= 2.05d-184) then
tmp = t_0
else if (z <= 3.1d-168) then
tmp = x * (-3.0d0)
else if (z <= 0.76d0) then
tmp = t_0
else
tmp = 6.0d0 * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (y * 4.0);
double tmp;
if (z <= -2.9e-26) {
tmp = z * (x * 6.0);
} else if (z <= -3.3e-60) {
tmp = t_0;
} else if (z <= -8.2e-134) {
tmp = x * -3.0;
} else if (z <= -2e-157) {
tmp = t_0;
} else if (z <= -2.2e-192) {
tmp = x * -3.0;
} else if (z <= -1.75e-230) {
tmp = t_0;
} else if (z <= 2.9e-266) {
tmp = x * -3.0;
} else if (z <= 2.05e-184) {
tmp = t_0;
} else if (z <= 3.1e-168) {
tmp = x * -3.0;
} else if (z <= 0.76) {
tmp = t_0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = x + (y * 4.0) tmp = 0 if z <= -2.9e-26: tmp = z * (x * 6.0) elif z <= -3.3e-60: tmp = t_0 elif z <= -8.2e-134: tmp = x * -3.0 elif z <= -2e-157: tmp = t_0 elif z <= -2.2e-192: tmp = x * -3.0 elif z <= -1.75e-230: tmp = t_0 elif z <= 2.9e-266: tmp = x * -3.0 elif z <= 2.05e-184: tmp = t_0 elif z <= 3.1e-168: tmp = x * -3.0 elif z <= 0.76: tmp = t_0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(x + Float64(y * 4.0)) tmp = 0.0 if (z <= -2.9e-26) tmp = Float64(z * Float64(x * 6.0)); elseif (z <= -3.3e-60) tmp = t_0; elseif (z <= -8.2e-134) tmp = Float64(x * -3.0); elseif (z <= -2e-157) tmp = t_0; elseif (z <= -2.2e-192) tmp = Float64(x * -3.0); elseif (z <= -1.75e-230) tmp = t_0; elseif (z <= 2.9e-266) tmp = Float64(x * -3.0); elseif (z <= 2.05e-184) tmp = t_0; elseif (z <= 3.1e-168) tmp = Float64(x * -3.0); elseif (z <= 0.76) tmp = t_0; else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (y * 4.0); tmp = 0.0; if (z <= -2.9e-26) tmp = z * (x * 6.0); elseif (z <= -3.3e-60) tmp = t_0; elseif (z <= -8.2e-134) tmp = x * -3.0; elseif (z <= -2e-157) tmp = t_0; elseif (z <= -2.2e-192) tmp = x * -3.0; elseif (z <= -1.75e-230) tmp = t_0; elseif (z <= 2.9e-266) tmp = x * -3.0; elseif (z <= 2.05e-184) tmp = t_0; elseif (z <= 3.1e-168) tmp = x * -3.0; elseif (z <= 0.76) tmp = t_0; else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(y * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.9e-26], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.3e-60], t$95$0, If[LessEqual[z, -8.2e-134], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -2e-157], t$95$0, If[LessEqual[z, -2.2e-192], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -1.75e-230], t$95$0, If[LessEqual[z, 2.9e-266], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.05e-184], t$95$0, If[LessEqual[z, 3.1e-168], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 0.76], t$95$0, N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + y \cdot 4\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{-26}:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-60}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-134}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-157}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-192}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-230}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-266}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-184}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-168}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 0.76:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -2.8999999999999998e-26Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 59.2%
sub-neg59.2%
distribute-rgt-in59.2%
metadata-eval59.2%
distribute-lft-neg-in59.2%
associate-+r+59.2%
metadata-eval59.2%
distribute-rgt-neg-in59.2%
metadata-eval59.2%
Simplified59.2%
Taylor expanded in z around inf 59.2%
Taylor expanded in z around inf 54.0%
*-commutative54.0%
Simplified54.0%
if -2.8999999999999998e-26 < z < -3.2999999999999998e-60 or -8.2000000000000004e-134 < z < -1.99999999999999989e-157 or -2.20000000000000006e-192 < z < -1.74999999999999994e-230 or 2.89999999999999996e-266 < z < 2.05e-184 or 3.1e-168 < z < 0.76000000000000001Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in y around inf 73.3%
Taylor expanded in z around 0 71.6%
*-commutative71.6%
Simplified71.6%
if -3.2999999999999998e-60 < z < -8.2000000000000004e-134 or -1.99999999999999989e-157 < z < -2.20000000000000006e-192 or -1.74999999999999994e-230 < z < 2.89999999999999996e-266 or 2.05e-184 < z < 3.1e-168Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 76.5%
sub-neg76.5%
distribute-rgt-in76.5%
metadata-eval76.5%
distribute-lft-neg-in76.5%
associate-+r+76.5%
metadata-eval76.5%
distribute-rgt-neg-in76.5%
metadata-eval76.5%
Simplified76.5%
Taylor expanded in z around 0 76.5%
*-commutative76.5%
Simplified76.5%
if 0.76000000000000001 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 59.7%
sub-neg59.7%
distribute-rgt-in59.7%
metadata-eval59.7%
distribute-lft-neg-in59.7%
associate-+r+59.7%
metadata-eval59.7%
distribute-rgt-neg-in59.7%
metadata-eval59.7%
Simplified59.7%
Taylor expanded in z around inf 58.5%
*-commutative58.5%
Simplified58.5%
Final simplification64.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))) (t_1 (* 6.0 (* y (- 0.6666666666666666 z)))))
(if (<= x -5.2e+146)
t_0
(if (<= x -1.2e+99)
t_1
(if (<= x -9.6e-10)
t_0
(if (<= x 1.75e+24)
t_1
(if (<= x 3.855e+161) (* x -3.0) (* x (* z 6.0)))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double t_1 = 6.0 * (y * (0.6666666666666666 - z));
double tmp;
if (x <= -5.2e+146) {
tmp = t_0;
} else if (x <= -1.2e+99) {
tmp = t_1;
} else if (x <= -9.6e-10) {
tmp = t_0;
} else if (x <= 1.75e+24) {
tmp = t_1;
} else if (x <= 3.855e+161) {
tmp = x * -3.0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 6.0d0 * (x * z)
t_1 = 6.0d0 * (y * (0.6666666666666666d0 - z))
if (x <= (-5.2d+146)) then
tmp = t_0
else if (x <= (-1.2d+99)) then
tmp = t_1
else if (x <= (-9.6d-10)) then
tmp = t_0
else if (x <= 1.75d+24) then
tmp = t_1
else if (x <= 3.855d+161) then
tmp = x * (-3.0d0)
else
tmp = x * (z * 6.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double t_1 = 6.0 * (y * (0.6666666666666666 - z));
double tmp;
if (x <= -5.2e+146) {
tmp = t_0;
} else if (x <= -1.2e+99) {
tmp = t_1;
} else if (x <= -9.6e-10) {
tmp = t_0;
} else if (x <= 1.75e+24) {
tmp = t_1;
} else if (x <= 3.855e+161) {
tmp = x * -3.0;
} else {
tmp = x * (z * 6.0);
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) t_1 = 6.0 * (y * (0.6666666666666666 - z)) tmp = 0 if x <= -5.2e+146: tmp = t_0 elif x <= -1.2e+99: tmp = t_1 elif x <= -9.6e-10: tmp = t_0 elif x <= 1.75e+24: tmp = t_1 elif x <= 3.855e+161: tmp = x * -3.0 else: tmp = x * (z * 6.0) return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) t_1 = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))) tmp = 0.0 if (x <= -5.2e+146) tmp = t_0; elseif (x <= -1.2e+99) tmp = t_1; elseif (x <= -9.6e-10) tmp = t_0; elseif (x <= 1.75e+24) tmp = t_1; elseif (x <= 3.855e+161) tmp = Float64(x * -3.0); else tmp = Float64(x * Float64(z * 6.0)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); t_1 = 6.0 * (y * (0.6666666666666666 - z)); tmp = 0.0; if (x <= -5.2e+146) tmp = t_0; elseif (x <= -1.2e+99) tmp = t_1; elseif (x <= -9.6e-10) tmp = t_0; elseif (x <= 1.75e+24) tmp = t_1; elseif (x <= 3.855e+161) tmp = x * -3.0; else tmp = x * (z * 6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.2e+146], t$95$0, If[LessEqual[x, -1.2e+99], t$95$1, If[LessEqual[x, -9.6e-10], t$95$0, If[LessEqual[x, 1.75e+24], t$95$1, If[LessEqual[x, 3.855e+161], N[(x * -3.0), $MachinePrecision], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
t_1 := 6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{+146}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -9.6 \cdot 10^{-10}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.855 \cdot 10^{+161}:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\end{array}
\end{array}
if x < -5.20000000000000028e146 or -1.2000000000000001e99 < x < -9.5999999999999999e-10Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 82.3%
sub-neg82.3%
distribute-rgt-in82.4%
metadata-eval82.4%
distribute-lft-neg-in82.4%
associate-+r+82.4%
metadata-eval82.4%
distribute-rgt-neg-in82.4%
metadata-eval82.4%
Simplified82.4%
Taylor expanded in z around inf 49.0%
*-commutative49.0%
Simplified49.0%
if -5.20000000000000028e146 < x < -1.2000000000000001e99 or -9.5999999999999999e-10 < x < 1.7500000000000001e24Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
+-commutative99.6%
*-commutative99.6%
associate-*r*99.5%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 74.7%
if 1.7500000000000001e24 < x < 3.855e161Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around inf 69.8%
sub-neg69.8%
distribute-rgt-in69.8%
metadata-eval69.8%
distribute-lft-neg-in69.8%
associate-+r+69.8%
metadata-eval69.8%
distribute-rgt-neg-in69.8%
metadata-eval69.8%
Simplified69.8%
Taylor expanded in z around 0 47.2%
*-commutative47.2%
Simplified47.2%
if 3.855e161 < x Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 96.4%
sub-neg96.4%
distribute-rgt-in96.4%
metadata-eval96.4%
distribute-lft-neg-in96.4%
associate-+r+96.4%
metadata-eval96.4%
distribute-rgt-neg-in96.4%
metadata-eval96.4%
Simplified96.4%
Taylor expanded in z around inf 65.2%
Final simplification64.2%
(FPCore (x y z)
:precision binary64
(if (or (<= x -5.2e+146)
(and (not (<= x -1.9e+99))
(or (<= x -1.22e-67) (not (<= x 1.95e-58)))))
(* x (+ -3.0 (* z 6.0)))
(* 6.0 (* y (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -5.2e+146) || (!(x <= -1.9e+99) && ((x <= -1.22e-67) || !(x <= 1.95e-58)))) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-5.2d+146)) .or. (.not. (x <= (-1.9d+99))) .and. (x <= (-1.22d-67)) .or. (.not. (x <= 1.95d-58))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = 6.0d0 * (y * (0.6666666666666666d0 - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -5.2e+146) || (!(x <= -1.9e+99) && ((x <= -1.22e-67) || !(x <= 1.95e-58)))) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = 6.0 * (y * (0.6666666666666666 - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -5.2e+146) or (not (x <= -1.9e+99) and ((x <= -1.22e-67) or not (x <= 1.95e-58))): tmp = x * (-3.0 + (z * 6.0)) else: tmp = 6.0 * (y * (0.6666666666666666 - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -5.2e+146) || (!(x <= -1.9e+99) && ((x <= -1.22e-67) || !(x <= 1.95e-58)))) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(6.0 * Float64(y * Float64(0.6666666666666666 - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -5.2e+146) || (~((x <= -1.9e+99)) && ((x <= -1.22e-67) || ~((x <= 1.95e-58))))) tmp = x * (-3.0 + (z * 6.0)); else tmp = 6.0 * (y * (0.6666666666666666 - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.2e+146], And[N[Not[LessEqual[x, -1.9e+99]], $MachinePrecision], Or[LessEqual[x, -1.22e-67], N[Not[LessEqual[x, 1.95e-58]], $MachinePrecision]]]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 * N[(y * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+146} \lor \neg \left(x \leq -1.9 \cdot 10^{+99}\right) \land \left(x \leq -1.22 \cdot 10^{-67} \lor \neg \left(x \leq 1.95 \cdot 10^{-58}\right)\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(y \cdot \left(0.6666666666666666 - z\right)\right)\\
\end{array}
\end{array}
if x < -5.20000000000000028e146 or -1.9e99 < x < -1.22e-67 or 1.94999999999999996e-58 < x Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 80.3%
sub-neg80.3%
distribute-rgt-in80.3%
metadata-eval80.3%
distribute-lft-neg-in80.3%
associate-+r+80.3%
metadata-eval80.3%
distribute-rgt-neg-in80.3%
metadata-eval80.3%
Simplified80.3%
if -5.20000000000000028e146 < x < -1.9e99 or -1.22e-67 < x < 1.94999999999999996e-58Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
+-commutative99.5%
*-commutative99.5%
associate-*r*99.5%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in y around inf 82.4%
Final simplification81.2%
(FPCore (x y z)
:precision binary64
(if (or (<= x -5.2e+146)
(and (not (<= x -1.9e+99)) (or (<= x -3.5e-68) (not (<= x 1.5e-58)))))
(* x (+ -3.0 (* z 6.0)))
(* y (+ 4.0 (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -5.2e+146) || (!(x <= -1.9e+99) && ((x <= -3.5e-68) || !(x <= 1.5e-58)))) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-5.2d+146)) .or. (.not. (x <= (-1.9d+99))) .and. (x <= (-3.5d-68)) .or. (.not. (x <= 1.5d-58))) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = y * (4.0d0 + (z * (-6.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -5.2e+146) || (!(x <= -1.9e+99) && ((x <= -3.5e-68) || !(x <= 1.5e-58)))) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = y * (4.0 + (z * -6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -5.2e+146) or (not (x <= -1.9e+99) and ((x <= -3.5e-68) or not (x <= 1.5e-58))): tmp = x * (-3.0 + (z * 6.0)) else: tmp = y * (4.0 + (z * -6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -5.2e+146) || (!(x <= -1.9e+99) && ((x <= -3.5e-68) || !(x <= 1.5e-58)))) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -5.2e+146) || (~((x <= -1.9e+99)) && ((x <= -3.5e-68) || ~((x <= 1.5e-58))))) tmp = x * (-3.0 + (z * 6.0)); else tmp = y * (4.0 + (z * -6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.2e+146], And[N[Not[LessEqual[x, -1.9e+99]], $MachinePrecision], Or[LessEqual[x, -3.5e-68], N[Not[LessEqual[x, 1.5e-58]], $MachinePrecision]]]], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+146} \lor \neg \left(x \leq -1.9 \cdot 10^{+99}\right) \land \left(x \leq -3.5 \cdot 10^{-68} \lor \neg \left(x \leq 1.5 \cdot 10^{-58}\right)\right):\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\end{array}
\end{array}
if x < -5.20000000000000028e146 or -1.9e99 < x < -3.50000000000000013e-68 or 1.50000000000000004e-58 < x Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 80.3%
sub-neg80.3%
distribute-rgt-in80.3%
metadata-eval80.3%
distribute-lft-neg-in80.3%
associate-+r+80.3%
metadata-eval80.3%
distribute-rgt-neg-in80.3%
metadata-eval80.3%
Simplified80.3%
if -5.20000000000000028e146 < x < -1.9e99 or -3.50000000000000013e-68 < x < 1.50000000000000004e-58Initial program 99.5%
+-commutative99.5%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 82.6%
Final simplification81.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.55) (not (<= z 0.5))) (* (- y x) (* z -6.0)) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.55) || !(z <= 0.5)) {
tmp = (y - x) * (z * -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.55d0)) .or. (.not. (z <= 0.5d0))) then
tmp = (y - x) * (z * (-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.55) || !(z <= 0.5)) {
tmp = (y - x) * (z * -6.0);
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.55) or not (z <= 0.5): tmp = (y - x) * (z * -6.0) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.55) || !(z <= 0.5)) tmp = Float64(Float64(y - x) * Float64(z * -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.55) || ~((z <= 0.5))) tmp = (y - x) * (z * -6.0); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.55], N[Not[LessEqual[z, 0.5]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(z * -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.55 \lor \neg \left(z \leq 0.5\right):\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.55000000000000004 or 0.5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*97.1%
Simplified97.1%
if -0.55000000000000004 < z < 0.5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 97.6%
Final simplification97.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.54) (not (<= z 0.54))) (* (- y x) (* z -6.0)) (+ (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.54) || !(z <= 0.54)) {
tmp = (y - x) * (z * -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.54d0)) .or. (.not. (z <= 0.54d0))) then
tmp = (y - x) * (z * (-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.54) || !(z <= 0.54)) {
tmp = (y - x) * (z * -6.0);
} else {
tmp = (y * 4.0) + (x * -3.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.54) or not (z <= 0.54): tmp = (y - x) * (z * -6.0) else: tmp = (y * 4.0) + (x * -3.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.54) || !(z <= 0.54)) tmp = Float64(Float64(y - x) * Float64(z * -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.54) || ~((z <= 0.54))) tmp = (y - x) * (z * -6.0); else tmp = (y * 4.0) + (x * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.54], N[Not[LessEqual[z, 0.54]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] * N[(z * -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.54 \lor \neg \left(z \leq 0.54\right):\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\end{array}
\end{array}
if z < -0.54000000000000004 or 0.54000000000000004 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.7%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 97.1%
*-commutative97.1%
*-commutative97.1%
associate-*l*97.1%
Simplified97.1%
if -0.54000000000000004 < z < 0.54000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 97.1%
Taylor expanded in x around 0 97.6%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (if (<= z -0.66) (+ x (* -6.0 (* (- y x) z))) (if (<= z 0.55) (+ (* y 4.0) (* x -3.0)) (* (- y x) (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + (-6.0 * ((y - x) * z));
} else if (z <= 0.55) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = (y - x) * (z * -6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.66d0)) then
tmp = x + ((-6.0d0) * ((y - x) * z))
else if (z <= 0.55d0) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = (y - x) * (z * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + (-6.0 * ((y - x) * z));
} else if (z <= 0.55) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = (y - x) * (z * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = x + (-6.0 * ((y - x) * z)) elif z <= 0.55: tmp = (y * 4.0) + (x * -3.0) else: tmp = (y - x) * (z * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(x + Float64(-6.0 * Float64(Float64(y - x) * z))); elseif (z <= 0.55) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(Float64(y - x) * Float64(z * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = x + (-6.0 * ((y - x) * z)); elseif (z <= 0.55) tmp = (y * 4.0) + (x * -3.0); else tmp = (y - x) * (z * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(x + N[(-6.0 * N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.55], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;x + -6 \cdot \left(\left(y - x\right) \cdot z\right)\\
\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.4%
if -0.660000000000000031 < z < 0.55000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 97.1%
Taylor expanded in x around 0 97.6%
if 0.55000000000000004 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.6%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 96.8%
*-commutative96.8%
*-commutative96.8%
associate-*l*96.8%
Simplified96.8%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (if (<= z -0.66) (+ x (* z (* 6.0 (- x y)))) (if (<= z 0.6) (+ (* y 4.0) (* x -3.0)) (* (- y x) (* z -6.0)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + (z * (6.0 * (x - y)));
} else if (z <= 0.6) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = (y - x) * (z * -6.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.66d0)) then
tmp = x + (z * (6.0d0 * (x - y)))
else if (z <= 0.6d0) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = (y - x) * (z * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.66) {
tmp = x + (z * (6.0 * (x - y)));
} else if (z <= 0.6) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = (y - x) * (z * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.66: tmp = x + (z * (6.0 * (x - y))) elif z <= 0.6: tmp = (y * 4.0) + (x * -3.0) else: tmp = (y - x) * (z * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.66) tmp = Float64(x + Float64(z * Float64(6.0 * Float64(x - y)))); elseif (z <= 0.6) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(Float64(y - x) * Float64(z * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.66) tmp = x + (z * (6.0 * (x - y))); elseif (z <= 0.6) tmp = (y * 4.0) + (x * -3.0); else tmp = (y - x) * (z * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.66], N[(x + N[(z * N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.6], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;x + z \cdot \left(6 \cdot \left(x - y\right)\right)\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\end{array}
\end{array}
if z < -0.660000000000000031Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.5%
neg-mul-197.5%
Simplified97.5%
if -0.660000000000000031 < z < 0.599999999999999978Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 97.1%
Taylor expanded in x around 0 97.6%
if 0.599999999999999978 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
+-commutative99.7%
*-commutative99.7%
associate-*r*99.6%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 96.8%
*-commutative96.8%
*-commutative96.8%
associate-*l*96.8%
Simplified96.8%
Final simplification97.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.226) (not (<= z 0.54))) (* -6.0 (* y z)) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.226) || !(z <= 0.54)) {
tmp = -6.0 * (y * z);
} else {
tmp = x * -3.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-0.226d0)) .or. (.not. (z <= 0.54d0))) then
tmp = (-6.0d0) * (y * z)
else
tmp = x * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.226) || !(z <= 0.54)) {
tmp = -6.0 * (y * z);
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.226) or not (z <= 0.54): tmp = -6.0 * (y * z) else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.226) || !(z <= 0.54)) tmp = Float64(-6.0 * Float64(y * z)); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.226) || ~((z <= 0.54))) tmp = -6.0 * (y * z); else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.226], N[Not[LessEqual[z, 0.54]], $MachinePrecision]], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.226 \lor \neg \left(z \leq 0.54\right):\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if z < -0.226000000000000006 or 0.54000000000000004 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around inf 48.0%
Taylor expanded in z around inf 46.6%
Taylor expanded in x around 0 46.1%
if -0.226000000000000006 < z < 0.54000000000000004Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 48.9%
sub-neg48.9%
distribute-rgt-in48.9%
metadata-eval48.9%
distribute-lft-neg-in48.9%
associate-+r+48.9%
metadata-eval48.9%
distribute-rgt-neg-in48.9%
metadata-eval48.9%
Simplified48.9%
Taylor expanded in z around 0 47.8%
*-commutative47.8%
Simplified47.8%
Final simplification47.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.5) (not (<= z 1600000.0))) (* 6.0 (* x z)) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.5) || !(z <= 1600000.0)) {
tmp = 6.0 * (x * z);
} else {
tmp = x * -3.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-0.5d0)) .or. (.not. (z <= 1600000.0d0))) then
tmp = 6.0d0 * (x * z)
else
tmp = x * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.5) || !(z <= 1600000.0)) {
tmp = 6.0 * (x * z);
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.5) or not (z <= 1600000.0): tmp = 6.0 * (x * z) else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.5) || !(z <= 1600000.0)) tmp = Float64(6.0 * Float64(x * z)); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.5) || ~((z <= 1600000.0))) tmp = 6.0 * (x * z); else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.5], N[Not[LessEqual[z, 1600000.0]], $MachinePrecision]], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.5 \lor \neg \left(z \leq 1600000\right):\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if z < -0.5 or 1.6e6 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 58.6%
sub-neg58.6%
distribute-rgt-in58.6%
metadata-eval58.6%
distribute-lft-neg-in58.6%
associate-+r+58.6%
metadata-eval58.6%
distribute-rgt-neg-in58.6%
metadata-eval58.6%
Simplified58.6%
Taylor expanded in z around inf 57.9%
*-commutative57.9%
Simplified57.9%
if -0.5 < z < 1.6e6Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 48.5%
sub-neg48.5%
distribute-rgt-in48.5%
metadata-eval48.5%
distribute-lft-neg-in48.5%
associate-+r+48.5%
metadata-eval48.5%
distribute-rgt-neg-in48.5%
metadata-eval48.5%
Simplified48.5%
Taylor expanded in z around 0 47.5%
*-commutative47.5%
Simplified47.5%
Final simplification52.6%
(FPCore (x y z) :precision binary64 (if (<= z -0.5) (* z (* x 6.0)) (if (<= z 1600000.0) (* x -3.0) (* 6.0 (* x z)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.5) {
tmp = z * (x * 6.0);
} else if (z <= 1600000.0) {
tmp = x * -3.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 <= (-0.5d0)) then
tmp = z * (x * 6.0d0)
else if (z <= 1600000.0d0) then
tmp = x * (-3.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 <= -0.5) {
tmp = z * (x * 6.0);
} else if (z <= 1600000.0) {
tmp = x * -3.0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.5: tmp = z * (x * 6.0) elif z <= 1600000.0: tmp = x * -3.0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.5) tmp = Float64(z * Float64(x * 6.0)); elseif (z <= 1600000.0) tmp = Float64(x * -3.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 <= -0.5) tmp = z * (x * 6.0); elseif (z <= 1600000.0) tmp = x * -3.0; else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.5], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1600000.0], N[(x * -3.0), $MachinePrecision], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.5:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq 1600000:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -0.5Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 56.8%
sub-neg56.8%
distribute-rgt-in56.9%
metadata-eval56.9%
distribute-lft-neg-in56.9%
associate-+r+56.9%
metadata-eval56.9%
distribute-rgt-neg-in56.9%
metadata-eval56.9%
Simplified56.9%
Taylor expanded in z around inf 56.9%
Taylor expanded in z around inf 56.5%
*-commutative56.5%
Simplified56.5%
if -0.5 < z < 1.6e6Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 48.5%
sub-neg48.5%
distribute-rgt-in48.5%
metadata-eval48.5%
distribute-lft-neg-in48.5%
associate-+r+48.5%
metadata-eval48.5%
distribute-rgt-neg-in48.5%
metadata-eval48.5%
Simplified48.5%
Taylor expanded in z around 0 47.5%
*-commutative47.5%
Simplified47.5%
if 1.6e6 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 60.8%
sub-neg60.8%
distribute-rgt-in60.7%
metadata-eval60.7%
distribute-lft-neg-in60.7%
associate-+r+60.7%
metadata-eval60.7%
distribute-rgt-neg-in60.7%
metadata-eval60.7%
Simplified60.7%
Taylor expanded in z around inf 59.5%
*-commutative59.5%
Simplified59.5%
Final simplification52.6%
(FPCore (x y z) :precision binary64 (+ x (* (- 0.6666666666666666 z) (* (- y x) 6.0))))
double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.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 + ((0.6666666666666666d0 - z) * ((y - x) * 6.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((0.6666666666666666 - z) * ((y - x) * 6.0));
}
def code(x, y, z): return x + ((0.6666666666666666 - z) * ((y - x) * 6.0))
function code(x, y, z) return Float64(x + Float64(Float64(0.6666666666666666 - z) * Float64(Float64(y - x) * 6.0))) end
function tmp = code(x, y, z) tmp = x + ((0.6666666666666666 - z) * ((y - x) * 6.0)); end
code[x_, y_, z_] := N[(x + N[(N[(0.6666666666666666 - z), $MachinePrecision] * N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(0.6666666666666666 - z\right) \cdot \left(\left(y - x\right) \cdot 6\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.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 53.5%
sub-neg53.5%
distribute-rgt-in53.5%
metadata-eval53.5%
distribute-lft-neg-in53.5%
associate-+r+53.5%
metadata-eval53.5%
distribute-rgt-neg-in53.5%
metadata-eval53.5%
Simplified53.5%
Taylor expanded in z around 0 25.6%
*-commutative25.6%
Simplified25.6%
Final simplification25.6%
(FPCore (x y z) :precision binary64 x)
double code(double x, double y, double z) {
return x;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x
end function
public static double code(double x, double y, double z) {
return x;
}
def code(x, y, z): return x
function code(x, y, z) return x end
function tmp = code(x, y, z) tmp = x; end
code[x_, y_, z_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 49.6%
neg-mul-149.6%
Simplified49.6%
Taylor expanded in z around 0 2.9%
Final simplification2.9%
herbie shell --seed 2024055
(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))))