
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6.0) (- (/ 2.0 3.0) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6.0), $MachinePrecision] * N[(N[(2.0 / 3.0), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
\end{array}
(FPCore (x y z) :precision binary64 (+ x (+ (* -6.0 (* z (- y x))) (* (- y x) 4.0))))
double code(double x, double y, double z) {
return x + ((-6.0 * (z * (y - x))) + ((y - x) * 4.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 + (((-6.0d0) * (z * (y - x))) + ((y - x) * 4.0d0))
end function
public static double code(double x, double y, double z) {
return x + ((-6.0 * (z * (y - x))) + ((y - x) * 4.0));
}
def code(x, y, z): return x + ((-6.0 * (z * (y - x))) + ((y - x) * 4.0))
function code(x, y, z) return Float64(x + Float64(Float64(-6.0 * Float64(z * Float64(y - x))) + Float64(Float64(y - x) * 4.0))) end
function tmp = code(x, y, z) tmp = x + ((-6.0 * (z * (y - x))) + ((y - x) * 4.0)); end
code[x_, y_, z_] := N[(x + N[(N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(-6 \cdot \left(z \cdot \left(y - x\right)\right) + \left(y - x\right) \cdot 4\right)
\end{array}
Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 99.8%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z (- y x)))))
(if (<= z -1650.0)
t_0
(if (<= z -1.2e-209)
(* x (- (* z 6.0) 3.0))
(if (<= z 1.8e-184)
(* y 4.0)
(if (<= z 7e-71)
(* x -3.0)
(if (<= z 5.6e+15) (* y (+ 4.0 (* -6.0 z))) t_0)))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * (y - x));
double tmp;
if (z <= -1650.0) {
tmp = t_0;
} else if (z <= -1.2e-209) {
tmp = x * ((z * 6.0) - 3.0);
} else if (z <= 1.8e-184) {
tmp = y * 4.0;
} else if (z <= 7e-71) {
tmp = x * -3.0;
} else if (z <= 5.6e+15) {
tmp = y * (4.0 + (-6.0 * z));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (z * (y - x))
if (z <= (-1650.0d0)) then
tmp = t_0
else if (z <= (-1.2d-209)) then
tmp = x * ((z * 6.0d0) - 3.0d0)
else if (z <= 1.8d-184) then
tmp = y * 4.0d0
else if (z <= 7d-71) then
tmp = x * (-3.0d0)
else if (z <= 5.6d+15) then
tmp = y * (4.0d0 + ((-6.0d0) * z))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (z * (y - x));
double tmp;
if (z <= -1650.0) {
tmp = t_0;
} else if (z <= -1.2e-209) {
tmp = x * ((z * 6.0) - 3.0);
} else if (z <= 1.8e-184) {
tmp = y * 4.0;
} else if (z <= 7e-71) {
tmp = x * -3.0;
} else if (z <= 5.6e+15) {
tmp = y * (4.0 + (-6.0 * z));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * (y - x)) tmp = 0 if z <= -1650.0: tmp = t_0 elif z <= -1.2e-209: tmp = x * ((z * 6.0) - 3.0) elif z <= 1.8e-184: tmp = y * 4.0 elif z <= 7e-71: tmp = x * -3.0 elif z <= 5.6e+15: tmp = y * (4.0 + (-6.0 * z)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -1650.0) tmp = t_0; elseif (z <= -1.2e-209) tmp = Float64(x * Float64(Float64(z * 6.0) - 3.0)); elseif (z <= 1.8e-184) tmp = Float64(y * 4.0); elseif (z <= 7e-71) tmp = Float64(x * -3.0); elseif (z <= 5.6e+15) tmp = Float64(y * Float64(4.0 + Float64(-6.0 * z))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * (y - x)); tmp = 0.0; if (z <= -1650.0) tmp = t_0; elseif (z <= -1.2e-209) tmp = x * ((z * 6.0) - 3.0); elseif (z <= 1.8e-184) tmp = y * 4.0; elseif (z <= 7e-71) tmp = x * -3.0; elseif (z <= 5.6e+15) tmp = y * (4.0 + (-6.0 * z)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1650.0], t$95$0, If[LessEqual[z, -1.2e-209], N[(x * N[(N[(z * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-184], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 7e-71], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 5.6e+15], N[(y * N[(4.0 + N[(-6.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -1650:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-209}:\\
\;\;\;\;x \cdot \left(z \cdot 6 - 3\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-184}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-71}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+15}:\\
\;\;\;\;y \cdot \left(4 + -6 \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1650 or 5.6e15 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.9%
if -1650 < z < -1.2000000000000001e-209Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 70.8%
if -1.2000000000000001e-209 < z < 1.8000000000000001e-184Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 67.0%
*-commutative67.0%
Simplified67.0%
if 1.8000000000000001e-184 < z < 6.9999999999999998e-71Initial program 99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around inf 72.1%
*-commutative72.1%
Simplified72.1%
if 6.9999999999999998e-71 < z < 5.6e15Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in y around inf 73.1%
Final simplification83.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* z (- y x)))))
(if (<= z -0.055)
t_0
(if (<= z -1.6e-210)
(* x -3.0)
(if (<= z 9.5e-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 * (z * (y - x));
double tmp;
if (z <= -0.055) {
tmp = t_0;
} else if (z <= -1.6e-210) {
tmp = x * -3.0;
} else if (z <= 9.5e-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) * (z * (y - x))
if (z <= (-0.055d0)) then
tmp = t_0
else if (z <= (-1.6d-210)) then
tmp = x * (-3.0d0)
else if (z <= 9.5d-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 * (z * (y - x));
double tmp;
if (z <= -0.055) {
tmp = t_0;
} else if (z <= -1.6e-210) {
tmp = x * -3.0;
} else if (z <= 9.5e-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 * (z * (y - x)) tmp = 0 if z <= -0.055: tmp = t_0 elif z <= -1.6e-210: tmp = x * -3.0 elif z <= 9.5e-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(z * Float64(y - x))) tmp = 0.0 if (z <= -0.055) tmp = t_0; elseif (z <= -1.6e-210) tmp = Float64(x * -3.0); elseif (z <= 9.5e-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 * (z * (y - x)); tmp = 0.0; if (z <= -0.055) tmp = t_0; elseif (z <= -1.6e-210) tmp = x * -3.0; elseif (z <= 9.5e-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[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.055], t$95$0, If[LessEqual[z, -1.6e-210], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 9.5e-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(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -0.055:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-210}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 9.5 \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 < -0.0550000000000000003 or 0.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.9%
if -0.0550000000000000003 < z < -1.60000000000000014e-210 or 9.4999999999999994e-182 < z < 0.5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 98.0%
Taylor expanded in x around inf 65.6%
*-commutative65.6%
Simplified65.6%
if -1.60000000000000014e-210 < z < 9.4999999999999994e-182Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 67.0%
*-commutative67.0%
Simplified67.0%
Final simplification81.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- (* z 6.0) 3.0))) (t_1 (* -6.0 (* z (- y x)))))
(if (<= z -670.0)
t_1
(if (<= z -2.6e-206)
t_0
(if (<= z 1.25e-182) (* y 4.0) (if (<= z 6200.0) t_0 t_1))))))
double code(double x, double y, double z) {
double t_0 = x * ((z * 6.0) - 3.0);
double t_1 = -6.0 * (z * (y - x));
double tmp;
if (z <= -670.0) {
tmp = t_1;
} else if (z <= -2.6e-206) {
tmp = t_0;
} else if (z <= 1.25e-182) {
tmp = y * 4.0;
} else if (z <= 6200.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 * ((z * 6.0d0) - 3.0d0)
t_1 = (-6.0d0) * (z * (y - x))
if (z <= (-670.0d0)) then
tmp = t_1
else if (z <= (-2.6d-206)) then
tmp = t_0
else if (z <= 1.25d-182) then
tmp = y * 4.0d0
else if (z <= 6200.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 * ((z * 6.0) - 3.0);
double t_1 = -6.0 * (z * (y - x));
double tmp;
if (z <= -670.0) {
tmp = t_1;
} else if (z <= -2.6e-206) {
tmp = t_0;
} else if (z <= 1.25e-182) {
tmp = y * 4.0;
} else if (z <= 6200.0) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * ((z * 6.0) - 3.0) t_1 = -6.0 * (z * (y - x)) tmp = 0 if z <= -670.0: tmp = t_1 elif z <= -2.6e-206: tmp = t_0 elif z <= 1.25e-182: tmp = y * 4.0 elif z <= 6200.0: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(Float64(z * 6.0) - 3.0)) t_1 = Float64(-6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -670.0) tmp = t_1; elseif (z <= -2.6e-206) tmp = t_0; elseif (z <= 1.25e-182) tmp = Float64(y * 4.0); elseif (z <= 6200.0) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * ((z * 6.0) - 3.0); t_1 = -6.0 * (z * (y - x)); tmp = 0.0; if (z <= -670.0) tmp = t_1; elseif (z <= -2.6e-206) tmp = t_0; elseif (z <= 1.25e-182) tmp = y * 4.0; elseif (z <= 6200.0) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(N[(z * 6.0), $MachinePrecision] - 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -670.0], t$95$1, If[LessEqual[z, -2.6e-206], t$95$0, If[LessEqual[z, 1.25e-182], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6200.0], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(z \cdot 6 - 3\right)\\
t_1 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -670:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-206}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-182}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 6200:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -670 or 6200 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.9%
if -670 < z < -2.6e-206 or 1.25000000000000006e-182 < z < 6200Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around inf 65.6%
if -2.6e-206 < z < 1.25000000000000006e-182Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 67.0%
*-commutative67.0%
Simplified67.0%
Final simplification81.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6.0 (* x z))))
(if (<= z -1850.0)
t_0
(if (<= z -3.5e-207)
(* x -3.0)
(if (<= z 3.8e-184) (* y 4.0) (if (<= z 6.2e-33) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -1850.0) {
tmp = t_0;
} else if (z <= -3.5e-207) {
tmp = x * -3.0;
} else if (z <= 3.8e-184) {
tmp = y * 4.0;
} else if (z <= 6.2e-33) {
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 <= (-1850.0d0)) then
tmp = t_0
else if (z <= (-3.5d-207)) then
tmp = x * (-3.0d0)
else if (z <= 3.8d-184) then
tmp = y * 4.0d0
else if (z <= 6.2d-33) 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 <= -1850.0) {
tmp = t_0;
} else if (z <= -3.5e-207) {
tmp = x * -3.0;
} else if (z <= 3.8e-184) {
tmp = y * 4.0;
} else if (z <= 6.2e-33) {
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 <= -1850.0: tmp = t_0 elif z <= -3.5e-207: tmp = x * -3.0 elif z <= 3.8e-184: tmp = y * 4.0 elif z <= 6.2e-33: 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 <= -1850.0) tmp = t_0; elseif (z <= -3.5e-207) tmp = Float64(x * -3.0); elseif (z <= 3.8e-184) tmp = Float64(y * 4.0); elseif (z <= 6.2e-33) 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 <= -1850.0) tmp = t_0; elseif (z <= -3.5e-207) tmp = x * -3.0; elseif (z <= 3.8e-184) tmp = y * 4.0; elseif (z <= 6.2e-33) 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, -1850.0], t$95$0, If[LessEqual[z, -3.5e-207], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 3.8e-184], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6.2e-33], 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 -1850:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-207}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-184}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-33}:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1850 or 6.19999999999999994e-33 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around inf 51.6%
Taylor expanded in z around inf 51.8%
if -1850 < z < -3.5000000000000002e-207 or 3.80000000000000017e-184 < z < 6.19999999999999994e-33Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 97.9%
Taylor expanded in x around inf 68.3%
*-commutative68.3%
Simplified68.3%
if -3.5000000000000002e-207 < z < 3.80000000000000017e-184Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 67.0%
*-commutative67.0%
Simplified67.0%
Final simplification60.1%
(FPCore (x y z)
:precision binary64
(if (<= z -1850.0)
(* x (* z 6.0))
(if (<= z -1.6e-208)
(* x -3.0)
(if (<= z 2.6e-185)
(* y 4.0)
(if (<= z 6.2e-33) (* x -3.0) (* 6.0 (* x z)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1850.0) {
tmp = x * (z * 6.0);
} else if (z <= -1.6e-208) {
tmp = x * -3.0;
} else if (z <= 2.6e-185) {
tmp = y * 4.0;
} else if (z <= 6.2e-33) {
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 <= (-1850.0d0)) then
tmp = x * (z * 6.0d0)
else if (z <= (-1.6d-208)) then
tmp = x * (-3.0d0)
else if (z <= 2.6d-185) then
tmp = y * 4.0d0
else if (z <= 6.2d-33) 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 <= -1850.0) {
tmp = x * (z * 6.0);
} else if (z <= -1.6e-208) {
tmp = x * -3.0;
} else if (z <= 2.6e-185) {
tmp = y * 4.0;
} else if (z <= 6.2e-33) {
tmp = x * -3.0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1850.0: tmp = x * (z * 6.0) elif z <= -1.6e-208: tmp = x * -3.0 elif z <= 2.6e-185: tmp = y * 4.0 elif z <= 6.2e-33: tmp = x * -3.0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1850.0) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= -1.6e-208) tmp = Float64(x * -3.0); elseif (z <= 2.6e-185) tmp = Float64(y * 4.0); elseif (z <= 6.2e-33) 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 <= -1850.0) tmp = x * (z * 6.0); elseif (z <= -1.6e-208) tmp = x * -3.0; elseif (z <= 2.6e-185) tmp = y * 4.0; elseif (z <= 6.2e-33) tmp = x * -3.0; else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1850.0], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.6e-208], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 2.6e-185], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6.2e-33], N[(x * -3.0), $MachinePrecision], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1850:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-208}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-185}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-33}:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if z < -1850Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around inf 57.6%
Taylor expanded in z around inf 57.6%
*-commutative57.6%
associate-*r*57.6%
Simplified57.6%
if -1850 < z < -1.6000000000000001e-208 or 2.59999999999999985e-185 < z < 6.19999999999999994e-33Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 97.9%
Taylor expanded in x around inf 68.3%
*-commutative68.3%
Simplified68.3%
if -1.6000000000000001e-208 < z < 2.59999999999999985e-185Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 67.0%
*-commutative67.0%
Simplified67.0%
if 6.19999999999999994e-33 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around inf 44.6%
Taylor expanded in z around inf 44.9%
Final simplification60.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* x 6.0))))
(if (<= z -1850.0)
t_0
(if (<= z -2.2e-209)
(* x -3.0)
(if (<= z 9.2e-181) (* y 4.0) (if (<= z 6.2e-33) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = z * (x * 6.0);
double tmp;
if (z <= -1850.0) {
tmp = t_0;
} else if (z <= -2.2e-209) {
tmp = x * -3.0;
} else if (z <= 9.2e-181) {
tmp = y * 4.0;
} else if (z <= 6.2e-33) {
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 = z * (x * 6.0d0)
if (z <= (-1850.0d0)) then
tmp = t_0
else if (z <= (-2.2d-209)) then
tmp = x * (-3.0d0)
else if (z <= 9.2d-181) then
tmp = y * 4.0d0
else if (z <= 6.2d-33) 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 = z * (x * 6.0);
double tmp;
if (z <= -1850.0) {
tmp = t_0;
} else if (z <= -2.2e-209) {
tmp = x * -3.0;
} else if (z <= 9.2e-181) {
tmp = y * 4.0;
} else if (z <= 6.2e-33) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * (x * 6.0) tmp = 0 if z <= -1850.0: tmp = t_0 elif z <= -2.2e-209: tmp = x * -3.0 elif z <= 9.2e-181: tmp = y * 4.0 elif z <= 6.2e-33: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(x * 6.0)) tmp = 0.0 if (z <= -1850.0) tmp = t_0; elseif (z <= -2.2e-209) tmp = Float64(x * -3.0); elseif (z <= 9.2e-181) tmp = Float64(y * 4.0); elseif (z <= 6.2e-33) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (x * 6.0); tmp = 0.0; if (z <= -1850.0) tmp = t_0; elseif (z <= -2.2e-209) tmp = x * -3.0; elseif (z <= 9.2e-181) tmp = y * 4.0; elseif (z <= 6.2e-33) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1850.0], t$95$0, If[LessEqual[z, -2.2e-209], N[(x * -3.0), $MachinePrecision], If[LessEqual[z, 9.2e-181], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 6.2e-33], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(x \cdot 6\right)\\
\mathbf{if}\;z \leq -1850:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-209}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-181}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{-33}:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if z < -1850 or 6.19999999999999994e-33 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in x around inf 51.6%
Taylor expanded in z around inf 51.8%
*-commutative51.8%
*-commutative51.8%
associate-*r*51.9%
Simplified51.9%
if -1850 < z < -2.2000000000000001e-209 or 9.19999999999999963e-181 < z < 6.19999999999999994e-33Initial program 99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in z around 0 97.9%
Taylor expanded in x around inf 68.3%
*-commutative68.3%
Simplified68.3%
if -2.2000000000000001e-209 < z < 9.19999999999999963e-181Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.8%
Taylor expanded in x around 0 67.0%
*-commutative67.0%
Simplified67.0%
Final simplification60.1%
(FPCore (x y z) :precision binary64 (if (<= z -0.58) (* -6.0 (* z (- y x))) (if (<= z 0.58) (+ (* y 4.0) (* x -3.0)) (+ x (* z (* -6.0 (- y x)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = -6.0 * (z * (y - x));
} else if (z <= 0.58) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = x + (z * (-6.0 * (y - x)));
}
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 = (-6.0d0) * (z * (y - x))
else if (z <= 0.58d0) then
tmp = (y * 4.0d0) + (x * (-3.0d0))
else
tmp = x + (z * ((-6.0d0) * (y - x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = -6.0 * (z * (y - x));
} else if (z <= 0.58) {
tmp = (y * 4.0) + (x * -3.0);
} else {
tmp = x + (z * (-6.0 * (y - x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.58: tmp = -6.0 * (z * (y - x)) elif z <= 0.58: tmp = (y * 4.0) + (x * -3.0) else: tmp = x + (z * (-6.0 * (y - x))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.58) tmp = Float64(-6.0 * Float64(z * Float64(y - x))); elseif (z <= 0.58) tmp = Float64(Float64(y * 4.0) + Float64(x * -3.0)); else tmp = Float64(x + Float64(z * Float64(-6.0 * Float64(y - x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.58) tmp = -6.0 * (z * (y - x)); elseif (z <= 0.58) tmp = (y * 4.0) + (x * -3.0); else tmp = x + (z * (-6.0 * (y - x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.58], N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.58], N[(N[(y * 4.0), $MachinePrecision] + N[(x * -3.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(-6.0 * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58:\\
\;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{elif}\;z \leq 0.58:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(-6 \cdot \left(y - x\right)\right)\\
\end{array}
\end{array}
if z < -0.57999999999999996Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.3%
if -0.57999999999999996 < z < 0.57999999999999996Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 98.8%
Taylor expanded in x around 0 98.8%
if 0.57999999999999996 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 99.7%
*-commutative99.7%
associate-*l*99.8%
Simplified99.8%
Final simplification98.9%
(FPCore (x y z)
:precision binary64
(if (or (<= x -2.4e+107)
(not (or (<= x -1.6e+71) (and (not (<= x -2.2e+17)) (<= x 5.8e-56)))))
(* x -3.0)
(* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.4e+107) || !((x <= -1.6e+71) || (!(x <= -2.2e+17) && (x <= 5.8e-56)))) {
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 <= (-2.4d+107)) .or. (.not. (x <= (-1.6d+71)) .or. (.not. (x <= (-2.2d+17))) .and. (x <= 5.8d-56))) 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 <= -2.4e+107) || !((x <= -1.6e+71) || (!(x <= -2.2e+17) && (x <= 5.8e-56)))) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.4e+107) or not ((x <= -1.6e+71) or (not (x <= -2.2e+17) and (x <= 5.8e-56))): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.4e+107) || !((x <= -1.6e+71) || (!(x <= -2.2e+17) && (x <= 5.8e-56)))) 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 <= -2.4e+107) || ~(((x <= -1.6e+71) || (~((x <= -2.2e+17)) && (x <= 5.8e-56))))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.4e+107], N[Not[Or[LessEqual[x, -1.6e+71], And[N[Not[LessEqual[x, -2.2e+17]], $MachinePrecision], LessEqual[x, 5.8e-56]]]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+107} \lor \neg \left(x \leq -1.6 \cdot 10^{+71} \lor \neg \left(x \leq -2.2 \cdot 10^{+17}\right) \land x \leq 5.8 \cdot 10^{-56}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -2.4000000000000001e107 or -1.60000000000000012e71 < x < -2.2e17 or 5.79999999999999982e-56 < x Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 53.6%
Taylor expanded in x around inf 44.4%
*-commutative44.4%
Simplified44.4%
if -2.4000000000000001e107 < x < -1.60000000000000012e71 or -2.2e17 < x < 5.79999999999999982e-56Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 55.0%
Taylor expanded in x around 0 44.5%
*-commutative44.5%
Simplified44.5%
Final simplification44.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.58) (not (<= z 0.52))) (* -6.0 (* z (- y x))) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.52)) {
tmp = -6.0 * (z * (y - x));
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((z <= (-0.58d0)) .or. (.not. (z <= 0.52d0))) then
tmp = (-6.0d0) * (z * (y - x))
else
tmp = x + ((y - x) * 4.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.52)) {
tmp = -6.0 * (z * (y - x));
} else {
tmp = x + ((y - x) * 4.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.58) or not (z <= 0.52): tmp = -6.0 * (z * (y - x)) else: tmp = x + ((y - x) * 4.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.58) || !(z <= 0.52)) tmp = Float64(-6.0 * Float64(z * Float64(y - x))); else tmp = Float64(x + Float64(Float64(y - x) * 4.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -0.58) || ~((z <= 0.52))) tmp = -6.0 * (z * (y - x)); else tmp = x + ((y - x) * 4.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.58], N[Not[LessEqual[z, 0.52]], $MachinePrecision]], N[(-6.0 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.58 \lor \neg \left(z \leq 0.52\right):\\
\;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\end{array}
\end{array}
if z < -0.57999999999999996 or 0.52000000000000002 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.9%
if -0.57999999999999996 < z < 0.52000000000000002Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 98.8%
Final simplification98.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.6) (not (<= z 0.62))) (* -6.0 (* z (- y x))) (+ (* y 4.0) (* x -3.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.6) || !(z <= 0.62)) {
tmp = -6.0 * (z * (y - x));
} 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.6d0)) .or. (.not. (z <= 0.62d0))) then
tmp = (-6.0d0) * (z * (y - x))
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.6) || !(z <= 0.62)) {
tmp = -6.0 * (z * (y - x));
} else {
tmp = (y * 4.0) + (x * -3.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -0.6) or not (z <= 0.62): tmp = -6.0 * (z * (y - x)) else: tmp = (y * 4.0) + (x * -3.0) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -0.6) || !(z <= 0.62)) tmp = Float64(-6.0 * Float64(z * Float64(y - x))); 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.6) || ~((z <= 0.62))) tmp = -6.0 * (z * (y - x)); else tmp = (y * 4.0) + (x * -3.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -0.6], N[Not[LessEqual[z, 0.62]], $MachinePrecision]], N[(-6.0 * N[(z * N[(y - x), $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.6 \lor \neg \left(z \leq 0.62\right):\\
\;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4 + x \cdot -3\\
\end{array}
\end{array}
if z < -0.599999999999999978 or 0.619999999999999996 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 99.7%
Taylor expanded in z around inf 98.9%
if -0.599999999999999978 < z < 0.619999999999999996Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 98.8%
Taylor expanded in x around 0 98.8%
Final simplification98.9%
(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 (* (- y x) (* 6.0 (- 0.6666666666666666 z)))))
double code(double x, double y, double z) {
return x + ((y - x) * (6.0 * (0.6666666666666666 - z)));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y - x) * (6.0d0 * (0.6666666666666666d0 - z)))
end function
public static double code(double x, double y, double z) {
return x + ((y - x) * (6.0 * (0.6666666666666666 - z)));
}
def code(x, y, z): return x + ((y - x) * (6.0 * (0.6666666666666666 - z)))
function code(x, y, z) return Float64(x + Float64(Float64(y - x) * Float64(6.0 * Float64(0.6666666666666666 - z)))) end
function tmp = code(x, y, z) tmp = x + ((y - x) * (6.0 * (0.6666666666666666 - z))); end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(6.0 * N[(0.6666666666666666 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \left(6 \cdot \left(0.6666666666666666 - z\right)\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
*-commutative99.6%
associate-*l*99.5%
fma-def99.5%
metadata-eval99.5%
Simplified99.5%
fma-udef99.5%
associate-*r*99.6%
*-commutative99.6%
associate-*l*99.8%
Applied egg-rr99.8%
Final simplification99.8%
(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 z around 0 54.3%
Taylor expanded in x around inf 28.9%
*-commutative28.9%
Simplified28.9%
Final simplification28.9%
(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%
+-commutative99.6%
associate-*l*99.8%
fma-def99.8%
metadata-eval99.8%
Simplified99.8%
add-cube-cbrt98.3%
pow398.3%
Applied egg-rr98.3%
Taylor expanded in z around inf 2.5%
Final simplification2.5%
herbie shell --seed 2023318
(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))))