
(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 13 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.5%
+-commutative99.5%
associate-*l*99.7%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
distribute-rgt-neg-out99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z) :precision binary64 (fma (- y x) (* 6.0 (- 0.6666666666666666 z)) x))
double code(double x, double y, double z) {
return fma((y - x), (6.0 * (0.6666666666666666 - z)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(6.0 * Float64(0.6666666666666666 - z)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 6 \cdot \left(0.6666666666666666 - z\right), x\right)
\end{array}
Initial program 99.5%
+-commutative99.5%
associate-*l*99.7%
fma-def99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* z -6.0))) (t_1 (* x (* z 6.0))))
(if (<= z -2.5e+186)
t_0
(if (<= z -3.5e-6)
t_1
(if (<= z -9.5e-90)
(* y 4.0)
(if (<= z -3.8e-239)
(* x -3.0)
(if (<= z -6.6e-267)
(* y 4.0)
(if (<= z 2.7e-303)
(* x -3.0)
(if (<= z 3.8e-113)
(* y 4.0)
(if (<= z 0.019)
(* x -3.0)
(if (<= z 1.2e+100)
t_1
(if (<= z 6.5e+124)
t_0
(if (<= z 6.2e+165)
(* 6.0 (* x z))
(if (<= z 6.5e+225) 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 <= -2.5e+186) {
tmp = t_0;
} else if (z <= -3.5e-6) {
tmp = t_1;
} else if (z <= -9.5e-90) {
tmp = y * 4.0;
} else if (z <= -3.8e-239) {
tmp = x * -3.0;
} else if (z <= -6.6e-267) {
tmp = y * 4.0;
} else if (z <= 2.7e-303) {
tmp = x * -3.0;
} else if (z <= 3.8e-113) {
tmp = y * 4.0;
} else if (z <= 0.019) {
tmp = x * -3.0;
} else if (z <= 1.2e+100) {
tmp = t_1;
} else if (z <= 6.5e+124) {
tmp = t_0;
} else if (z <= 6.2e+165) {
tmp = 6.0 * (x * z);
} else if (z <= 6.5e+225) {
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 <= (-2.5d+186)) then
tmp = t_0
else if (z <= (-3.5d-6)) then
tmp = t_1
else if (z <= (-9.5d-90)) then
tmp = y * 4.0d0
else if (z <= (-3.8d-239)) then
tmp = x * (-3.0d0)
else if (z <= (-6.6d-267)) then
tmp = y * 4.0d0
else if (z <= 2.7d-303) then
tmp = x * (-3.0d0)
else if (z <= 3.8d-113) then
tmp = y * 4.0d0
else if (z <= 0.019d0) then
tmp = x * (-3.0d0)
else if (z <= 1.2d+100) then
tmp = t_1
else if (z <= 6.5d+124) then
tmp = t_0
else if (z <= 6.2d+165) then
tmp = 6.0d0 * (x * z)
else if (z <= 6.5d+225) 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 <= -2.5e+186) {
tmp = t_0;
} else if (z <= -3.5e-6) {
tmp = t_1;
} else if (z <= -9.5e-90) {
tmp = y * 4.0;
} else if (z <= -3.8e-239) {
tmp = x * -3.0;
} else if (z <= -6.6e-267) {
tmp = y * 4.0;
} else if (z <= 2.7e-303) {
tmp = x * -3.0;
} else if (z <= 3.8e-113) {
tmp = y * 4.0;
} else if (z <= 0.019) {
tmp = x * -3.0;
} else if (z <= 1.2e+100) {
tmp = t_1;
} else if (z <= 6.5e+124) {
tmp = t_0;
} else if (z <= 6.2e+165) {
tmp = 6.0 * (x * z);
} else if (z <= 6.5e+225) {
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 <= -2.5e+186: tmp = t_0 elif z <= -3.5e-6: tmp = t_1 elif z <= -9.5e-90: tmp = y * 4.0 elif z <= -3.8e-239: tmp = x * -3.0 elif z <= -6.6e-267: tmp = y * 4.0 elif z <= 2.7e-303: tmp = x * -3.0 elif z <= 3.8e-113: tmp = y * 4.0 elif z <= 0.019: tmp = x * -3.0 elif z <= 1.2e+100: tmp = t_1 elif z <= 6.5e+124: tmp = t_0 elif z <= 6.2e+165: tmp = 6.0 * (x * z) elif z <= 6.5e+225: 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 <= -2.5e+186) tmp = t_0; elseif (z <= -3.5e-6) tmp = t_1; elseif (z <= -9.5e-90) tmp = Float64(y * 4.0); elseif (z <= -3.8e-239) tmp = Float64(x * -3.0); elseif (z <= -6.6e-267) tmp = Float64(y * 4.0); elseif (z <= 2.7e-303) tmp = Float64(x * -3.0); elseif (z <= 3.8e-113) tmp = Float64(y * 4.0); elseif (z <= 0.019) tmp = Float64(x * -3.0); elseif (z <= 1.2e+100) tmp = t_1; elseif (z <= 6.5e+124) tmp = t_0; elseif (z <= 6.2e+165) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= 6.5e+225) 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 <= -2.5e+186) tmp = t_0; elseif (z <= -3.5e-6) tmp = t_1; elseif (z <= -9.5e-90) tmp = y * 4.0; elseif (z <= -3.8e-239) tmp = x * -3.0; elseif (z <= -6.6e-267) tmp = y * 4.0; elseif (z <= 2.7e-303) tmp = x * -3.0; elseif (z <= 3.8e-113) tmp = y * 4.0; elseif (z <= 0.019) tmp = x * -3.0; elseif (z <= 1.2e+100) tmp = t_1; elseif (z <= 6.5e+124) tmp = t_0; elseif (z <= 6.2e+165) tmp = 6.0 * (x * z); elseif (z <= 6.5e+225) 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, -2.5e+186], t$95$0, If[LessEqual[z, -3.5e-6], t$95$1, If[LessEqual[z, -9.5e-90], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -3.8e-239], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -6.6e-267], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 2.7e-303], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.8e-113], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.019], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.2e+100], t$95$1, If[LessEqual[z, 6.5e+124], t$95$0, If[LessEqual[z, 6.2e+165], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e+225], 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 -2.5 \cdot 10^{+186}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-6}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-90}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-239}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-267}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{-303}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-113}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.019:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+100}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+124}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+165}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+225}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.49999999999999977e186 or 1.20000000000000006e100 < z < 6.50000000000000008e124 or 6.2000000000000003e165 < z < 6.5000000000000006e225Initial program 99.7%
+-commutative99.7%
associate-*l*99.8%
fma-def99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-in99.8%
distribute-rgt-neg-out99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 70.1%
Taylor expanded in z around inf 70.1%
if -2.49999999999999977e186 < z < -3.49999999999999995e-6 or 0.0189999999999999995 < z < 1.20000000000000006e100 or 6.5000000000000006e225 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 65.2%
sub-neg65.2%
distribute-rgt-in65.2%
metadata-eval65.2%
metadata-eval65.2%
neg-mul-165.2%
associate-*r*65.2%
*-commutative65.2%
distribute-lft-in65.2%
distribute-lft-in65.2%
associate-+r+65.2%
metadata-eval65.2%
metadata-eval65.2%
associate-*r*65.2%
metadata-eval65.2%
*-commutative65.2%
Simplified65.2%
Taylor expanded in z around inf 61.1%
if -3.49999999999999995e-6 < z < -9.5000000000000003e-90 or -3.8000000000000002e-239 < z < -6.60000000000000007e-267 or 2.69999999999999986e-303 < z < 3.79999999999999983e-113Initial program 99.5%
+-commutative99.5%
*-commutative99.5%
associate-*l*99.4%
fma-def99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 99.1%
Taylor expanded in y around inf 66.1%
*-commutative66.1%
Simplified66.1%
if -9.5000000000000003e-90 < z < -3.8000000000000002e-239 or -6.60000000000000007e-267 < z < 2.69999999999999986e-303 or 3.79999999999999983e-113 < z < 0.0189999999999999995Initial 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%
metadata-eval69.8%
neg-mul-169.8%
associate-*r*69.8%
*-commutative69.8%
distribute-lft-in69.8%
distribute-lft-in69.8%
associate-+r+69.8%
metadata-eval69.8%
metadata-eval69.8%
associate-*r*69.8%
metadata-eval69.8%
*-commutative69.8%
Simplified69.8%
Taylor expanded in z around 0 67.5%
*-commutative67.5%
Simplified67.5%
if 6.50000000000000008e124 < z < 6.2000000000000003e165Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 87.8%
sub-neg87.8%
distribute-rgt-in87.8%
metadata-eval87.8%
metadata-eval87.8%
neg-mul-187.8%
associate-*r*87.8%
*-commutative87.8%
distribute-lft-in87.8%
distribute-lft-in87.8%
associate-+r+87.8%
metadata-eval87.8%
metadata-eval87.8%
associate-*r*87.8%
metadata-eval87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in z around inf 87.8%
*-commutative87.8%
Simplified87.8%
Final simplification66.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -3.5e-6)
t_0
(if (<= z -2.25e-88)
(* y 4.0)
(if (<= z -2.2e-239)
(* x -3.0)
(if (<= z -4.45e-268)
(* y 4.0)
(if (<= z 5.1e-304)
(* x -3.0)
(if (<= z 1.4e-113)
(* y 4.0)
(if (<= z 0.019) (* x -3.0) t_0)))))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -3.5e-6) {
tmp = t_0;
} else if (z <= -2.25e-88) {
tmp = y * 4.0;
} else if (z <= -2.2e-239) {
tmp = x * -3.0;
} else if (z <= -4.45e-268) {
tmp = y * 4.0;
} else if (z <= 5.1e-304) {
tmp = x * -3.0;
} else if (z <= 1.4e-113) {
tmp = y * 4.0;
} else if (z <= 0.019) {
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 * (x * z)
if (z <= (-3.5d-6)) then
tmp = t_0
else if (z <= (-2.25d-88)) then
tmp = y * 4.0d0
else if (z <= (-2.2d-239)) then
tmp = x * (-3.0d0)
else if (z <= (-4.45d-268)) then
tmp = y * 4.0d0
else if (z <= 5.1d-304) then
tmp = x * (-3.0d0)
else if (z <= 1.4d-113) then
tmp = y * 4.0d0
else if (z <= 0.019d0) 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 * (x * z);
double tmp;
if (z <= -3.5e-6) {
tmp = t_0;
} else if (z <= -2.25e-88) {
tmp = y * 4.0;
} else if (z <= -2.2e-239) {
tmp = x * -3.0;
} else if (z <= -4.45e-268) {
tmp = y * 4.0;
} else if (z <= 5.1e-304) {
tmp = x * -3.0;
} else if (z <= 1.4e-113) {
tmp = y * 4.0;
} else if (z <= 0.019) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -3.5e-6: tmp = t_0 elif z <= -2.25e-88: tmp = y * 4.0 elif z <= -2.2e-239: tmp = x * -3.0 elif z <= -4.45e-268: tmp = y * 4.0 elif z <= 5.1e-304: tmp = x * -3.0 elif z <= 1.4e-113: tmp = y * 4.0 elif z <= 0.019: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -3.5e-6) tmp = t_0; elseif (z <= -2.25e-88) tmp = Float64(y * 4.0); elseif (z <= -2.2e-239) tmp = Float64(x * -3.0); elseif (z <= -4.45e-268) tmp = Float64(y * 4.0); elseif (z <= 5.1e-304) tmp = Float64(x * -3.0); elseif (z <= 1.4e-113) tmp = Float64(y * 4.0); elseif (z <= 0.019) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); tmp = 0.0; if (z <= -3.5e-6) tmp = t_0; elseif (z <= -2.25e-88) tmp = y * 4.0; elseif (z <= -2.2e-239) tmp = x * -3.0; elseif (z <= -4.45e-268) tmp = y * 4.0; elseif (z <= 5.1e-304) tmp = x * -3.0; elseif (z <= 1.4e-113) tmp = y * 4.0; elseif (z <= 0.019) 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[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e-6], t$95$0, If[LessEqual[z, -2.25e-88], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -2.2e-239], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -4.45e-268], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 5.1e-304], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 1.4e-113], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.019], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{-6}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{-88}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-239}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -4.45 \cdot 10^{-268}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-304}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-113}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.019:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -3.49999999999999995e-6 or 0.0189999999999999995 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 54.6%
sub-neg54.6%
distribute-rgt-in54.6%
metadata-eval54.6%
metadata-eval54.6%
neg-mul-154.6%
associate-*r*54.6%
*-commutative54.6%
distribute-lft-in54.6%
distribute-lft-in54.6%
associate-+r+54.7%
metadata-eval54.7%
metadata-eval54.7%
associate-*r*54.7%
metadata-eval54.7%
*-commutative54.7%
Simplified54.7%
Taylor expanded in z around inf 52.2%
*-commutative52.2%
Simplified52.2%
if -3.49999999999999995e-6 < z < -2.24999999999999996e-88 or -2.19999999999999983e-239 < z < -4.4499999999999998e-268 or 5.09999999999999979e-304 < z < 1.4e-113Initial program 99.5%
+-commutative99.5%
*-commutative99.5%
associate-*l*99.4%
fma-def99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 99.1%
Taylor expanded in y around inf 66.1%
*-commutative66.1%
Simplified66.1%
if -2.24999999999999996e-88 < z < -2.19999999999999983e-239 or -4.4499999999999998e-268 < z < 5.09999999999999979e-304 or 1.4e-113 < z < 0.0189999999999999995Initial 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%
metadata-eval69.8%
neg-mul-169.8%
associate-*r*69.8%
*-commutative69.8%
distribute-lft-in69.8%
distribute-lft-in69.8%
associate-+r+69.8%
metadata-eval69.8%
metadata-eval69.8%
associate-*r*69.8%
metadata-eval69.8%
*-commutative69.8%
Simplified69.8%
Taylor expanded in z around 0 67.5%
*-commutative67.5%
Simplified67.5%
Final simplification59.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* z 6.0))))
(if (<= z -3.5e-6)
t_0
(if (<= z -2e-91)
(* y 4.0)
(if (<= z -3.1e-243)
(* x -3.0)
(if (<= z -5.6e-268)
(* y 4.0)
(if (<= z 8.4e-302)
(* x -3.0)
(if (<= z 8e-114)
(* y 4.0)
(if (<= z 0.019) (* x -3.0) t_0)))))))))
double code(double x, double y, double z) {
double t_0 = x * (z * 6.0);
double tmp;
if (z <= -3.5e-6) {
tmp = t_0;
} else if (z <= -2e-91) {
tmp = y * 4.0;
} else if (z <= -3.1e-243) {
tmp = x * -3.0;
} else if (z <= -5.6e-268) {
tmp = y * 4.0;
} else if (z <= 8.4e-302) {
tmp = x * -3.0;
} else if (z <= 8e-114) {
tmp = y * 4.0;
} else if (z <= 0.019) {
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 = x * (z * 6.0d0)
if (z <= (-3.5d-6)) then
tmp = t_0
else if (z <= (-2d-91)) then
tmp = y * 4.0d0
else if (z <= (-3.1d-243)) then
tmp = x * (-3.0d0)
else if (z <= (-5.6d-268)) then
tmp = y * 4.0d0
else if (z <= 8.4d-302) then
tmp = x * (-3.0d0)
else if (z <= 8d-114) then
tmp = y * 4.0d0
else if (z <= 0.019d0) 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 = x * (z * 6.0);
double tmp;
if (z <= -3.5e-6) {
tmp = t_0;
} else if (z <= -2e-91) {
tmp = y * 4.0;
} else if (z <= -3.1e-243) {
tmp = x * -3.0;
} else if (z <= -5.6e-268) {
tmp = y * 4.0;
} else if (z <= 8.4e-302) {
tmp = x * -3.0;
} else if (z <= 8e-114) {
tmp = y * 4.0;
} else if (z <= 0.019) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * (z * 6.0) tmp = 0 if z <= -3.5e-6: tmp = t_0 elif z <= -2e-91: tmp = y * 4.0 elif z <= -3.1e-243: tmp = x * -3.0 elif z <= -5.6e-268: tmp = y * 4.0 elif z <= 8.4e-302: tmp = x * -3.0 elif z <= 8e-114: tmp = y * 4.0 elif z <= 0.019: tmp = x * -3.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 <= -3.5e-6) tmp = t_0; elseif (z <= -2e-91) tmp = Float64(y * 4.0); elseif (z <= -3.1e-243) tmp = Float64(x * -3.0); elseif (z <= -5.6e-268) tmp = Float64(y * 4.0); elseif (z <= 8.4e-302) tmp = Float64(x * -3.0); elseif (z <= 8e-114) tmp = Float64(y * 4.0); elseif (z <= 0.019) tmp = Float64(x * -3.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 <= -3.5e-6) tmp = t_0; elseif (z <= -2e-91) tmp = y * 4.0; elseif (z <= -3.1e-243) tmp = x * -3.0; elseif (z <= -5.6e-268) tmp = y * 4.0; elseif (z <= 8.4e-302) tmp = x * -3.0; elseif (z <= 8e-114) tmp = y * 4.0; elseif (z <= 0.019) tmp = x * -3.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, -3.5e-6], t$95$0, If[LessEqual[z, -2e-91], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, -3.1e-243], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, -5.6e-268], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 8.4e-302], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 8e-114], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.019], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6\right)\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{-6}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-91}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-243}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq -5.6 \cdot 10^{-268}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 8.4 \cdot 10^{-302}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-114}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.019:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -3.49999999999999995e-6 or 0.0189999999999999995 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 54.6%
sub-neg54.6%
distribute-rgt-in54.6%
metadata-eval54.6%
metadata-eval54.6%
neg-mul-154.6%
associate-*r*54.6%
*-commutative54.6%
distribute-lft-in54.6%
distribute-lft-in54.6%
associate-+r+54.7%
metadata-eval54.7%
metadata-eval54.7%
associate-*r*54.7%
metadata-eval54.7%
*-commutative54.7%
Simplified54.7%
Taylor expanded in z around inf 52.3%
if -3.49999999999999995e-6 < z < -2.00000000000000004e-91 or -3.0999999999999999e-243 < z < -5.6000000000000003e-268 or 8.40000000000000052e-302 < z < 8.0000000000000004e-114Initial program 99.5%
+-commutative99.5%
*-commutative99.5%
associate-*l*99.4%
fma-def99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 99.1%
Taylor expanded in y around inf 66.1%
*-commutative66.1%
Simplified66.1%
if -2.00000000000000004e-91 < z < -3.0999999999999999e-243 or -5.6000000000000003e-268 < z < 8.40000000000000052e-302 or 8.0000000000000004e-114 < z < 0.0189999999999999995Initial 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%
metadata-eval69.8%
neg-mul-169.8%
associate-*r*69.8%
*-commutative69.8%
distribute-lft-in69.8%
distribute-lft-in69.8%
associate-+r+69.8%
metadata-eval69.8%
metadata-eval69.8%
associate-*r*69.8%
metadata-eval69.8%
*-commutative69.8%
Simplified69.8%
Taylor expanded in z around 0 67.5%
*-commutative67.5%
Simplified67.5%
Final simplification59.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* z -6.0))) (t_1 (* x (+ -3.0 (* z 6.0)))))
(if (<= x -2.5e-141)
t_1
(if (<= x -1.06e-198)
t_0
(if (<= x -3.4e-220) (* y 4.0) (if (<= x 1.7e-130) t_0 t_1))))))
double code(double x, double y, double z) {
double t_0 = y * (z * -6.0);
double t_1 = x * (-3.0 + (z * 6.0));
double tmp;
if (x <= -2.5e-141) {
tmp = t_1;
} else if (x <= -1.06e-198) {
tmp = t_0;
} else if (x <= -3.4e-220) {
tmp = y * 4.0;
} else if (x <= 1.7e-130) {
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 * ((-3.0d0) + (z * 6.0d0))
if (x <= (-2.5d-141)) then
tmp = t_1
else if (x <= (-1.06d-198)) then
tmp = t_0
else if (x <= (-3.4d-220)) then
tmp = y * 4.0d0
else if (x <= 1.7d-130) 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 * (-3.0 + (z * 6.0));
double tmp;
if (x <= -2.5e-141) {
tmp = t_1;
} else if (x <= -1.06e-198) {
tmp = t_0;
} else if (x <= -3.4e-220) {
tmp = y * 4.0;
} else if (x <= 1.7e-130) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = y * (z * -6.0) t_1 = x * (-3.0 + (z * 6.0)) tmp = 0 if x <= -2.5e-141: tmp = t_1 elif x <= -1.06e-198: tmp = t_0 elif x <= -3.4e-220: tmp = y * 4.0 elif x <= 1.7e-130: 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(-3.0 + Float64(z * 6.0))) tmp = 0.0 if (x <= -2.5e-141) tmp = t_1; elseif (x <= -1.06e-198) tmp = t_0; elseif (x <= -3.4e-220) tmp = Float64(y * 4.0); elseif (x <= 1.7e-130) 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 * (-3.0 + (z * 6.0)); tmp = 0.0; if (x <= -2.5e-141) tmp = t_1; elseif (x <= -1.06e-198) tmp = t_0; elseif (x <= -3.4e-220) tmp = y * 4.0; elseif (x <= 1.7e-130) 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[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5e-141], t$95$1, If[LessEqual[x, -1.06e-198], t$95$0, If[LessEqual[x, -3.4e-220], N[(y * 4.0), $MachinePrecision], If[LessEqual[x, 1.7e-130], 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(-3 + z \cdot 6\right)\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{-141}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{-198}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -3.4 \cdot 10^{-220}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-130}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.5e-141 or 1.70000000000000003e-130 < x Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 70.8%
sub-neg70.8%
distribute-rgt-in70.8%
metadata-eval70.8%
metadata-eval70.8%
neg-mul-170.8%
associate-*r*70.8%
*-commutative70.8%
distribute-lft-in70.8%
distribute-lft-in70.8%
associate-+r+70.8%
metadata-eval70.8%
metadata-eval70.8%
associate-*r*70.8%
metadata-eval70.8%
*-commutative70.8%
Simplified70.8%
if -2.5e-141 < x < -1.06000000000000009e-198 or -3.39999999999999993e-220 < x < 1.70000000000000003e-130Initial program 99.6%
+-commutative99.6%
associate-*l*99.7%
fma-def99.7%
sub-neg99.7%
+-commutative99.7%
distribute-lft-in99.8%
distribute-rgt-neg-out99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 90.2%
Taylor expanded in z around inf 58.0%
if -1.06000000000000009e-198 < x < -3.39999999999999993e-220Initial program 99.6%
+-commutative99.6%
*-commutative99.6%
associate-*l*99.3%
fma-def99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 86.1%
Taylor expanded in y around inf 72.8%
*-commutative72.8%
Simplified72.8%
Final simplification67.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.68) (not (<= z 0.5))) (- x (* -6.0 (* z (- x y)))) (+ (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.68) || !(z <= 0.5)) {
tmp = x - (-6.0 * (z * (x - y)));
} 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.68d0)) .or. (.not. (z <= 0.5d0))) then
tmp = x - ((-6.0d0) * (z * (x - y)))
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.68) || !(z <= 0.5)) {
tmp = x - (-6.0 * (z * (x - y)));
} else {
tmp = (y * 4.0) + (x * -3.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.68) or not (z <= 0.5): tmp = x - (-6.0 * (z * (x - y))) else: tmp = (y * 4.0) + (x * -3.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.68) || !(z <= 0.5)) tmp = Float64(x - Float64(-6.0 * Float64(z * Float64(x - y)))); 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.68) || ~((z <= 0.5))) tmp = x - (-6.0 * (z * (x - y))); else tmp = (y * 4.0) + (x * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.68], N[Not[LessEqual[z, 0.5]], $MachinePrecision]], N[(x - N[(-6.0 * N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision]), $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.68 \lor \neg \left(z \leq 0.5\right):\\
\;\;\;\;x - -6 \cdot \left(z \cdot \left(x - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\end{array}
\end{array}
if z < -0.680000000000000049 or 0.5 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 98.2%
if -0.680000000000000049 < z < 0.5Initial program 99.3%
+-commutative99.3%
*-commutative99.3%
associate-*l*99.3%
fma-def99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 95.7%
Taylor expanded in x around 0 96.1%
Final simplification97.1%
(FPCore (x y z) :precision binary64 (if (<= z -0.68) (+ x (* (- y x) (* z -6.0))) (if (<= z 0.55) (+ (* y 4.0) (* x -3.0)) (- x (* -6.0 (* z (- x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.68) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.55) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = x - (-6.0 * (z * (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.68d0)) then
tmp = x + ((y - x) * (z * (-6.0d0)))
else if (z <= 0.55d0) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = x - ((-6.0d0) * (z * (x - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.68) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.55) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = x - (-6.0 * (z * (x - y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.68: tmp = x + ((y - x) * (z * -6.0)) elif z <= 0.55: tmp = (y * 4.0) + (x * -3.0) else: tmp = x - (-6.0 * (z * (x - y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.68) tmp = Float64(x + Float64(Float64(y - x) * Float64(z * -6.0))); elseif (z <= 0.55) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(x - Float64(-6.0 * Float64(z * Float64(x - y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.68) tmp = x + ((y - x) * (z * -6.0)); elseif (z <= 0.55) tmp = (y * 4.0) + (x * -3.0); else tmp = x - (-6.0 * (z * (x - y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.68], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.55], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(x - N[(-6.0 * N[(z * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.68:\\
\;\;\;\;x + \left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.55:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;x - -6 \cdot \left(z \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if z < -0.680000000000000049Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 98.8%
associate-*r*98.9%
*-commutative98.9%
Simplified98.9%
if -0.680000000000000049 < z < 0.55000000000000004Initial program 99.3%
+-commutative99.3%
*-commutative99.3%
associate-*l*99.3%
fma-def99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 95.7%
Taylor expanded in x around 0 96.1%
if 0.55000000000000004 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 97.6%
Final simplification97.1%
(FPCore (x y z) :precision binary64 (if (<= z -0.68) (+ x (* (- y x) (* z -6.0))) (if (<= z 0.64) (+ (* 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.68) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.64) {
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.68d0)) then
tmp = x + ((y - x) * (z * (-6.0d0)))
else if (z <= 0.64d0) 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.68) {
tmp = x + ((y - x) * (z * -6.0));
} else if (z <= 0.64) {
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.68: tmp = x + ((y - x) * (z * -6.0)) elif z <= 0.64: 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.68) tmp = Float64(x + Float64(Float64(y - x) * Float64(z * -6.0))); elseif (z <= 0.64) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(x + Float64(z * Float64(6.0 * Float64(x - y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.68) tmp = x + ((y - x) * (z * -6.0)); elseif (z <= 0.64) 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.68], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.64], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.68:\\
\;\;\;\;x + \left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.64:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(6 \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if z < -0.680000000000000049Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.8%
Taylor expanded in z around inf 98.8%
associate-*r*98.9%
*-commutative98.9%
Simplified98.9%
if -0.680000000000000049 < z < 0.640000000000000013Initial program 99.3%
+-commutative99.3%
*-commutative99.3%
associate-*l*99.3%
fma-def99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 95.7%
Taylor expanded in x around 0 96.1%
if 0.640000000000000013 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 97.7%
neg-mul-197.7%
Simplified97.7%
Final simplification97.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.15e+42) (not (<= y 1.16e+24))) (* y (+ 4.0 (* z -6.0))) (* x (+ -3.0 (* z 6.0)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -2.15e+42) || !(y <= 1.16e+24)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-2.15d+42)) .or. (.not. (y <= 1.16d+24))) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else
tmp = x * ((-3.0d0) + (z * 6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -2.15e+42) || !(y <= 1.16e+24)) {
tmp = y * (4.0 + (z * -6.0));
} else {
tmp = x * (-3.0 + (z * 6.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -2.15e+42) or not (y <= 1.16e+24): tmp = y * (4.0 + (z * -6.0)) else: tmp = x * (-3.0 + (z * 6.0)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -2.15e+42) || !(y <= 1.16e+24)) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); else tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -2.15e+42) || ~((y <= 1.16e+24))) tmp = y * (4.0 + (z * -6.0)); else tmp = x * (-3.0 + (z * 6.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -2.15e+42], N[Not[LessEqual[y, 1.16e+24]], $MachinePrecision]], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{+42} \lor \neg \left(y \leq 1.16 \cdot 10^{+24}\right):\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\end{array}
\end{array}
if y < -2.1499999999999999e42 or 1.16000000000000005e24 < y Initial program 99.7%
+-commutative99.7%
associate-*l*99.9%
fma-def99.9%
sub-neg99.9%
+-commutative99.9%
distribute-lft-in99.9%
distribute-rgt-neg-out99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 82.1%
if -2.1499999999999999e42 < y < 1.16000000000000005e24Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 79.8%
sub-neg79.8%
distribute-rgt-in79.8%
metadata-eval79.8%
metadata-eval79.8%
neg-mul-179.8%
associate-*r*79.8%
*-commutative79.8%
distribute-lft-in79.8%
distribute-lft-in79.8%
associate-+r+79.8%
metadata-eval79.8%
metadata-eval79.8%
associate-*r*79.8%
metadata-eval79.8%
*-commutative79.8%
Simplified79.8%
Final simplification80.8%
(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.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z) :precision binary64 (if (or (<= y -3.05e+41) (not (<= y 3.7e-73))) (* y 4.0) (* x -3.0)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3.05e+41) || !(y <= 3.7e-73)) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-3.05d+41)) .or. (.not. (y <= 3.7d-73))) then
tmp = y * 4.0d0
else
tmp = x * (-3.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -3.05e+41) || !(y <= 3.7e-73)) {
tmp = y * 4.0;
} else {
tmp = x * -3.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -3.05e+41) or not (y <= 3.7e-73): tmp = y * 4.0 else: tmp = x * -3.0 return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -3.05e+41) || !(y <= 3.7e-73)) tmp = Float64(y * 4.0); else tmp = Float64(x * -3.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -3.05e+41) || ~((y <= 3.7e-73))) tmp = y * 4.0; else tmp = x * -3.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -3.05e+41], N[Not[LessEqual[y, 3.7e-73]], $MachinePrecision]], N[(y * 4.0), $MachinePrecision], N[(x * -3.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.05 \cdot 10^{+41} \lor \neg \left(y \leq 3.7 \cdot 10^{-73}\right):\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x \cdot -3\\
\end{array}
\end{array}
if y < -3.04999999999999999e41 or 3.7000000000000001e-73 < y Initial program 99.6%
+-commutative99.6%
*-commutative99.6%
associate-*l*99.7%
fma-def99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 51.8%
Taylor expanded in y around inf 39.8%
*-commutative39.8%
Simplified39.8%
if -3.04999999999999999e41 < y < 3.7000000000000001e-73Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 82.4%
sub-neg82.4%
distribute-rgt-in82.4%
metadata-eval82.4%
metadata-eval82.4%
neg-mul-182.4%
associate-*r*82.4%
*-commutative82.4%
distribute-lft-in82.4%
distribute-lft-in82.4%
associate-+r+82.5%
metadata-eval82.5%
metadata-eval82.5%
associate-*r*82.5%
metadata-eval82.5%
*-commutative82.5%
Simplified82.5%
Taylor expanded in z around 0 42.2%
*-commutative42.2%
Simplified42.2%
Final simplification41.0%
(FPCore (x y z) :precision binary64 (* x -3.0))
double code(double x, double y, double z) {
return x * -3.0;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot -3
\end{array}
Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 53.7%
sub-neg53.7%
distribute-rgt-in53.7%
metadata-eval53.7%
metadata-eval53.7%
neg-mul-153.7%
associate-*r*53.7%
*-commutative53.7%
distribute-lft-in53.7%
distribute-lft-in53.7%
associate-+r+53.7%
metadata-eval53.7%
metadata-eval53.7%
associate-*r*53.7%
metadata-eval53.7%
*-commutative53.7%
Simplified53.7%
Taylor expanded in z around 0 27.2%
*-commutative27.2%
Simplified27.2%
Final simplification27.2%
herbie shell --seed 2023336
(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))))