
(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 (fma (- y x) (+ 4.0 (* z -6.0)) x))
double code(double x, double y, double z) {
return fma((y - x), (4.0 + (z * -6.0)), x);
}
function code(x, y, z) return fma(Float64(y - x), Float64(4.0 + Float64(z * -6.0)), x) end
code[x_, y_, z_] := N[(N[(y - x), $MachinePrecision] * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - x, 4 + z \cdot -6, x\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate-*l*99.8%
fma-define99.8%
sub-neg99.8%
distribute-rgt-in99.8%
metadata-eval99.8%
metadata-eval99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
metadata-eval99.8%
Simplified99.8%
(FPCore (x y z)
:precision binary64
(if (<= z -6.8e+271)
(* -6.0 (* y z))
(if (<= z -370000.0)
(* z (* x 6.0))
(if (<= z -4e-88)
(* y 4.0)
(if (<= z 0.6) (* x -3.0) (* z (* y -6.0)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -6.8e+271) {
tmp = -6.0 * (y * z);
} else if (z <= -370000.0) {
tmp = z * (x * 6.0);
} else if (z <= -4e-88) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else {
tmp = z * (y * -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 <= (-6.8d+271)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-370000.0d0)) then
tmp = z * (x * 6.0d0)
else if (z <= (-4d-88)) then
tmp = y * 4.0d0
else if (z <= 0.6d0) then
tmp = x * (-3.0d0)
else
tmp = z * (y * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -6.8e+271) {
tmp = -6.0 * (y * z);
} else if (z <= -370000.0) {
tmp = z * (x * 6.0);
} else if (z <= -4e-88) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else {
tmp = z * (y * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -6.8e+271: tmp = -6.0 * (y * z) elif z <= -370000.0: tmp = z * (x * 6.0) elif z <= -4e-88: tmp = y * 4.0 elif z <= 0.6: tmp = x * -3.0 else: tmp = z * (y * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -6.8e+271) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -370000.0) tmp = Float64(z * Float64(x * 6.0)); elseif (z <= -4e-88) tmp = Float64(y * 4.0); elseif (z <= 0.6) tmp = Float64(x * -3.0); else tmp = Float64(z * Float64(y * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -6.8e+271) tmp = -6.0 * (y * z); elseif (z <= -370000.0) tmp = z * (x * 6.0); elseif (z <= -4e-88) tmp = y * 4.0; elseif (z <= 0.6) tmp = x * -3.0; else tmp = z * (y * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -6.8e+271], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -370000.0], N[(z * N[(x * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4e-88], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(x * -3.0), $MachinePrecision], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+271}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -370000:\\
\;\;\;\;z \cdot \left(x \cdot 6\right)\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-88}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\end{array}
\end{array}
if z < -6.80000000000000051e271Initial program 100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 87.6%
*-commutative87.6%
Simplified87.6%
if -6.80000000000000051e271 < z < -3.7e5Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 56.7%
sub-neg56.7%
distribute-rgt-in56.7%
metadata-eval56.7%
distribute-lft-neg-in56.7%
associate-+r+56.7%
metadata-eval56.7%
distribute-rgt-neg-in56.7%
metadata-eval56.7%
Simplified56.7%
Taylor expanded in z around inf 56.8%
Taylor expanded in z around inf 56.0%
if -3.7e5 < z < -3.99999999999999974e-88Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 95.3%
Taylor expanded in x around 0 64.8%
*-commutative64.8%
Simplified64.8%
if -3.99999999999999974e-88 < z < 0.599999999999999978Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 56.9%
sub-neg56.9%
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 0 56.4%
*-commutative56.4%
Simplified56.4%
if 0.599999999999999978 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.2%
neg-mul-197.2%
Simplified97.2%
distribute-rgt-neg-out97.2%
unsub-neg97.2%
associate-*l*97.2%
Applied egg-rr97.2%
Taylor expanded in x around 0 58.8%
associate-*r*58.8%
*-commutative58.8%
Simplified58.8%
Final simplification58.6%
(FPCore (x y z)
:precision binary64
(if (<= z -4.3e+272)
(* -6.0 (* y z))
(if (<= z -370000.0)
(* x (* z 6.0))
(if (<= z -2.3e-88)
(* y 4.0)
(if (<= z 0.58) (* x -3.0) (* z (* y -6.0)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -4.3e+272) {
tmp = -6.0 * (y * z);
} else if (z <= -370000.0) {
tmp = x * (z * 6.0);
} else if (z <= -2.3e-88) {
tmp = y * 4.0;
} else if (z <= 0.58) {
tmp = x * -3.0;
} else {
tmp = z * (y * -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 <= (-4.3d+272)) then
tmp = (-6.0d0) * (y * z)
else if (z <= (-370000.0d0)) then
tmp = x * (z * 6.0d0)
else if (z <= (-2.3d-88)) then
tmp = y * 4.0d0
else if (z <= 0.58d0) then
tmp = x * (-3.0d0)
else
tmp = z * (y * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -4.3e+272) {
tmp = -6.0 * (y * z);
} else if (z <= -370000.0) {
tmp = x * (z * 6.0);
} else if (z <= -2.3e-88) {
tmp = y * 4.0;
} else if (z <= 0.58) {
tmp = x * -3.0;
} else {
tmp = z * (y * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -4.3e+272: tmp = -6.0 * (y * z) elif z <= -370000.0: tmp = x * (z * 6.0) elif z <= -2.3e-88: tmp = y * 4.0 elif z <= 0.58: tmp = x * -3.0 else: tmp = z * (y * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -4.3e+272) tmp = Float64(-6.0 * Float64(y * z)); elseif (z <= -370000.0) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= -2.3e-88) tmp = Float64(y * 4.0); elseif (z <= 0.58) tmp = Float64(x * -3.0); else tmp = Float64(z * Float64(y * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -4.3e+272) tmp = -6.0 * (y * z); elseif (z <= -370000.0) tmp = x * (z * 6.0); elseif (z <= -2.3e-88) tmp = y * 4.0; elseif (z <= 0.58) tmp = x * -3.0; else tmp = z * (y * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -4.3e+272], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -370000.0], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.3e-88], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.58], N[(x * -3.0), $MachinePrecision], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+272}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -370000:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-88}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.58:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\end{array}
\end{array}
if z < -4.30000000000000004e272Initial program 100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
distribute-rgt-neg-out100.0%
unsub-neg100.0%
associate-*l*99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 87.6%
*-commutative87.6%
Simplified87.6%
if -4.30000000000000004e272 < z < -3.7e5Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 56.7%
sub-neg56.7%
distribute-rgt-in56.7%
metadata-eval56.7%
distribute-lft-neg-in56.7%
associate-+r+56.7%
metadata-eval56.7%
distribute-rgt-neg-in56.7%
metadata-eval56.7%
Simplified56.7%
Taylor expanded in z around inf 56.0%
*-commutative56.0%
associate-*r*56.0%
Simplified56.0%
if -3.7e5 < z < -2.29999999999999986e-88Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 95.3%
Taylor expanded in x around 0 64.8%
*-commutative64.8%
Simplified64.8%
if -2.29999999999999986e-88 < z < 0.57999999999999996Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 56.9%
sub-neg56.9%
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 0 56.4%
*-commutative56.4%
Simplified56.4%
if 0.57999999999999996 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.2%
neg-mul-197.2%
Simplified97.2%
distribute-rgt-neg-out97.2%
unsub-neg97.2%
associate-*l*97.2%
Applied egg-rr97.2%
Taylor expanded in x around 0 58.8%
associate-*r*58.8%
*-commutative58.8%
Simplified58.8%
Final simplification58.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -7e+273)
t_0
(if (<= z -370000.0)
(* x (* z 6.0))
(if (<= z -1.2e-88) (* y 4.0) (if (<= z 0.52) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -7e+273) {
tmp = t_0;
} else if (z <= -370000.0) {
tmp = x * (z * 6.0);
} else if (z <= -1.2e-88) {
tmp = y * 4.0;
} else if (z <= 0.52) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-7d+273)) then
tmp = t_0
else if (z <= (-370000.0d0)) then
tmp = x * (z * 6.0d0)
else if (z <= (-1.2d-88)) then
tmp = y * 4.0d0
else if (z <= 0.52d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -7e+273) {
tmp = t_0;
} else if (z <= -370000.0) {
tmp = x * (z * 6.0);
} else if (z <= -1.2e-88) {
tmp = y * 4.0;
} else if (z <= 0.52) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -7e+273: tmp = t_0 elif z <= -370000.0: tmp = x * (z * 6.0) elif z <= -1.2e-88: tmp = y * 4.0 elif z <= 0.52: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -7e+273) tmp = t_0; elseif (z <= -370000.0) tmp = Float64(x * Float64(z * 6.0)); elseif (z <= -1.2e-88) tmp = Float64(y * 4.0); elseif (z <= 0.52) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -7e+273) tmp = t_0; elseif (z <= -370000.0) tmp = x * (z * 6.0); elseif (z <= -1.2e-88) tmp = y * 4.0; elseif (z <= 0.52) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+273], t$95$0, If[LessEqual[z, -370000.0], N[(x * N[(z * 6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.2e-88], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.52], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -7 \cdot 10^{+273}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -370000:\\
\;\;\;\;x \cdot \left(z \cdot 6\right)\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-88}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.52:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -7.00000000000000022e273 or 0.52000000000000002 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.5%
neg-mul-197.5%
Simplified97.5%
distribute-rgt-neg-out97.5%
unsub-neg97.5%
associate-*l*97.5%
Applied egg-rr97.5%
Taylor expanded in x around 0 61.9%
*-commutative61.9%
Simplified61.9%
if -7.00000000000000022e273 < z < -3.7e5Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 56.7%
sub-neg56.7%
distribute-rgt-in56.7%
metadata-eval56.7%
distribute-lft-neg-in56.7%
associate-+r+56.7%
metadata-eval56.7%
distribute-rgt-neg-in56.7%
metadata-eval56.7%
Simplified56.7%
Taylor expanded in z around inf 56.0%
*-commutative56.0%
associate-*r*56.0%
Simplified56.0%
if -3.7e5 < z < -1.2e-88Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 95.3%
Taylor expanded in x around 0 64.8%
*-commutative64.8%
Simplified64.8%
if -1.2e-88 < z < 0.52000000000000002Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 56.9%
sub-neg56.9%
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 0 56.4%
*-commutative56.4%
Simplified56.4%
Final simplification58.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -2.1e+272)
t_0
(if (<= z -370000.0)
(* 6.0 (* x z))
(if (<= z -1.5e-88) (* y 4.0) (if (<= z 0.6) (* x -3.0) t_0))))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -2.1e+272) {
tmp = t_0;
} else if (z <= -370000.0) {
tmp = 6.0 * (x * z);
} else if (z <= -1.5e-88) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-2.1d+272)) then
tmp = t_0
else if (z <= (-370000.0d0)) then
tmp = 6.0d0 * (x * z)
else if (z <= (-1.5d-88)) then
tmp = y * 4.0d0
else if (z <= 0.6d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -2.1e+272) {
tmp = t_0;
} else if (z <= -370000.0) {
tmp = 6.0 * (x * z);
} else if (z <= -1.5e-88) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -2.1e+272: tmp = t_0 elif z <= -370000.0: tmp = 6.0 * (x * z) elif z <= -1.5e-88: tmp = y * 4.0 elif z <= 0.6: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -2.1e+272) tmp = t_0; elseif (z <= -370000.0) tmp = Float64(6.0 * Float64(x * z)); elseif (z <= -1.5e-88) tmp = Float64(y * 4.0); elseif (z <= 0.6) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -2.1e+272) tmp = t_0; elseif (z <= -370000.0) tmp = 6.0 * (x * z); elseif (z <= -1.5e-88) tmp = y * 4.0; elseif (z <= 0.6) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+272], t$95$0, If[LessEqual[z, -370000.0], N[(6.0 * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.5e-88], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(x * -3.0), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+272}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -370000:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-88}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.09999999999999996e272 or 0.599999999999999978 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.5%
neg-mul-197.5%
Simplified97.5%
distribute-rgt-neg-out97.5%
unsub-neg97.5%
associate-*l*97.5%
Applied egg-rr97.5%
Taylor expanded in x around 0 61.9%
*-commutative61.9%
Simplified61.9%
if -2.09999999999999996e272 < z < -3.7e5Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around inf 56.7%
sub-neg56.7%
distribute-rgt-in56.7%
metadata-eval56.7%
distribute-lft-neg-in56.7%
associate-+r+56.7%
metadata-eval56.7%
distribute-rgt-neg-in56.7%
metadata-eval56.7%
Simplified56.7%
Taylor expanded in z around inf 56.0%
if -3.7e5 < z < -1.5e-88Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 95.3%
Taylor expanded in x around 0 64.8%
*-commutative64.8%
Simplified64.8%
if -1.5e-88 < z < 0.599999999999999978Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 56.9%
sub-neg56.9%
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 0 56.4%
*-commutative56.4%
Simplified56.4%
Final simplification58.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- y x) (* z -6.0))))
(if (<= z -1.8e+15)
t_0
(if (<= z -2.6e-88)
(* y (+ 4.0 (* z -6.0)))
(if (<= z 4.5) (* x (+ -3.0 (* z 6.0))) t_0)))))
double code(double x, double y, double z) {
double t_0 = (y - x) * (z * -6.0);
double tmp;
if (z <= -1.8e+15) {
tmp = t_0;
} else if (z <= -2.6e-88) {
tmp = y * (4.0 + (z * -6.0));
} else if (z <= 4.5) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (y - x) * (z * (-6.0d0))
if (z <= (-1.8d+15)) then
tmp = t_0
else if (z <= (-2.6d-88)) then
tmp = y * (4.0d0 + (z * (-6.0d0)))
else if (z <= 4.5d0) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (y - x) * (z * -6.0);
double tmp;
if (z <= -1.8e+15) {
tmp = t_0;
} else if (z <= -2.6e-88) {
tmp = y * (4.0 + (z * -6.0));
} else if (z <= 4.5) {
tmp = x * (-3.0 + (z * 6.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = (y - x) * (z * -6.0) tmp = 0 if z <= -1.8e+15: tmp = t_0 elif z <= -2.6e-88: tmp = y * (4.0 + (z * -6.0)) elif z <= 4.5: tmp = x * (-3.0 + (z * 6.0)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(Float64(y - x) * Float64(z * -6.0)) tmp = 0.0 if (z <= -1.8e+15) tmp = t_0; elseif (z <= -2.6e-88) tmp = Float64(y * Float64(4.0 + Float64(z * -6.0))); elseif (z <= 4.5) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = (y - x) * (z * -6.0); tmp = 0.0; if (z <= -1.8e+15) tmp = t_0; elseif (z <= -2.6e-88) tmp = y * (4.0 + (z * -6.0)); elseif (z <= 4.5) tmp = x * (-3.0 + (z * 6.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+15], t$95$0, If[LessEqual[z, -2.6e-88], N[(y * N[(4.0 + N[(z * -6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+15}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-88}:\\
\;\;\;\;y \cdot \left(4 + z \cdot -6\right)\\
\mathbf{elif}\;z \leq 4.5:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -1.8e15 or 4.5 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 98.5%
neg-mul-198.5%
Simplified98.5%
distribute-rgt-neg-out98.5%
unsub-neg98.5%
associate-*l*98.5%
Applied egg-rr98.5%
Taylor expanded in z around inf 98.4%
*-commutative98.4%
associate-*r*98.5%
*-commutative98.5%
associate-*r*98.5%
Simplified98.5%
if -1.8e15 < z < -2.60000000000000014e-88Initial program 99.4%
+-commutative99.4%
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 70.4%
if -2.60000000000000014e-88 < z < 4.5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 56.9%
sub-neg56.9%
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%
Final simplification79.4%
(FPCore (x y z)
:precision binary64
(if (<= y -6e+116)
(* -6.0 (* y z))
(if (<= y 8.2e+96)
(* x (+ -3.0 (* z 6.0)))
(if (<= y 5.6e+162) (* y 4.0) (* z (* y -6.0))))))
double code(double x, double y, double z) {
double tmp;
if (y <= -6e+116) {
tmp = -6.0 * (y * z);
} else if (y <= 8.2e+96) {
tmp = x * (-3.0 + (z * 6.0));
} else if (y <= 5.6e+162) {
tmp = y * 4.0;
} else {
tmp = z * (y * -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 <= (-6d+116)) then
tmp = (-6.0d0) * (y * z)
else if (y <= 8.2d+96) then
tmp = x * ((-3.0d0) + (z * 6.0d0))
else if (y <= 5.6d+162) then
tmp = y * 4.0d0
else
tmp = z * (y * (-6.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -6e+116) {
tmp = -6.0 * (y * z);
} else if (y <= 8.2e+96) {
tmp = x * (-3.0 + (z * 6.0));
} else if (y <= 5.6e+162) {
tmp = y * 4.0;
} else {
tmp = z * (y * -6.0);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -6e+116: tmp = -6.0 * (y * z) elif y <= 8.2e+96: tmp = x * (-3.0 + (z * 6.0)) elif y <= 5.6e+162: tmp = y * 4.0 else: tmp = z * (y * -6.0) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -6e+116) tmp = Float64(-6.0 * Float64(y * z)); elseif (y <= 8.2e+96) tmp = Float64(x * Float64(-3.0 + Float64(z * 6.0))); elseif (y <= 5.6e+162) tmp = Float64(y * 4.0); else tmp = Float64(z * Float64(y * -6.0)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -6e+116) tmp = -6.0 * (y * z); elseif (y <= 8.2e+96) tmp = x * (-3.0 + (z * 6.0)); elseif (y <= 5.6e+162) tmp = y * 4.0; else tmp = z * (y * -6.0); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -6e+116], N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.2e+96], N[(x * N[(-3.0 + N[(z * 6.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.6e+162], N[(y * 4.0), $MachinePrecision], N[(z * N[(y * -6.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+116}:\\
\;\;\;\;-6 \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+96}:\\
\;\;\;\;x \cdot \left(-3 + z \cdot 6\right)\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+162}:\\
\;\;\;\;y \cdot 4\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot -6\right)\\
\end{array}
\end{array}
if y < -5.9999999999999997e116Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 59.6%
neg-mul-159.6%
Simplified59.6%
distribute-rgt-neg-out59.6%
unsub-neg59.6%
associate-*l*59.7%
Applied egg-rr59.7%
Taylor expanded in x around 0 57.4%
*-commutative57.4%
Simplified57.4%
if -5.9999999999999997e116 < y < 8.19999999999999996e96Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 68.9%
sub-neg68.9%
distribute-rgt-in69.0%
metadata-eval69.0%
distribute-lft-neg-in69.0%
associate-+r+69.0%
metadata-eval69.0%
distribute-rgt-neg-in69.0%
metadata-eval69.0%
Simplified69.0%
if 8.19999999999999996e96 < y < 5.59999999999999981e162Initial program 99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 91.6%
Taylor expanded in x around 0 73.6%
*-commutative73.6%
Simplified73.6%
if 5.59999999999999981e162 < y Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 60.2%
neg-mul-160.2%
Simplified60.2%
distribute-rgt-neg-out60.2%
unsub-neg60.2%
associate-*l*60.2%
Applied egg-rr60.2%
Taylor expanded in x around 0 60.5%
associate-*r*60.5%
*-commutative60.5%
Simplified60.5%
Final simplification66.2%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6.0 (* y z))))
(if (<= z -0.66)
t_0
(if (<= z -7e-88) (* y 4.0) (if (<= z 0.6) (* x -3.0) t_0)))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.66) {
tmp = t_0;
} else if (z <= -7e-88) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-0.66d0)) then
tmp = t_0
else if (z <= (-7d-88)) then
tmp = y * 4.0d0
else if (z <= 0.6d0) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -0.66) {
tmp = t_0;
} else if (z <= -7e-88) {
tmp = y * 4.0;
} else if (z <= 0.6) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -0.66: tmp = t_0 elif z <= -7e-88: tmp = y * 4.0 elif z <= 0.6: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -0.66) tmp = t_0; elseif (z <= -7e-88) tmp = Float64(y * 4.0); elseif (z <= 0.6) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -0.66) tmp = t_0; elseif (z <= -7e-88) tmp = y * 4.0; elseif (z <= 0.6) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.66], t$95$0, If[LessEqual[z, -7e-88], N[(y * 4.0), $MachinePrecision], If[LessEqual[z, 0.6], N[(x * -3.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -0.66:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-88}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 0.6:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -0.660000000000000031 or 0.599999999999999978 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 97.4%
neg-mul-197.4%
Simplified97.4%
distribute-rgt-neg-out97.4%
unsub-neg97.4%
associate-*l*97.4%
Applied egg-rr97.4%
Taylor expanded in x around 0 53.2%
*-commutative53.2%
Simplified53.2%
if -0.660000000000000031 < z < -7.0000000000000002e-88Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around 0 99.2%
Taylor expanded in x around 0 67.3%
*-commutative67.3%
Simplified67.3%
if -7.0000000000000002e-88 < z < 0.599999999999999978Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 56.9%
sub-neg56.9%
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 0 56.4%
*-commutative56.4%
Simplified56.4%
Final simplification55.6%
(FPCore (x y z) :precision binary64 (if (<= z -0.58) (* (- y x) (* z -6.0)) (if (<= z 0.68) (+ x (* (- y x) 4.0)) (+ x (* z (* 6.0 (- x y)))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.68) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x + (z * (6.0 * (x - y)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-0.58d0)) then
tmp = (y - x) * (z * (-6.0d0))
else if (z <= 0.68d0) then
tmp = x + ((y - x) * 4.0d0)
else
tmp = x + (z * (6.0d0 * (x - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.58) {
tmp = (y - x) * (z * -6.0);
} else if (z <= 0.68) {
tmp = x + ((y - x) * 4.0);
} else {
tmp = x + (z * (6.0 * (x - y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.58: tmp = (y - x) * (z * -6.0) elif z <= 0.68: tmp = x + ((y - x) * 4.0) else: tmp = x + (z * (6.0 * (x - y))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.58) tmp = Float64(Float64(y - x) * Float64(z * -6.0)); elseif (z <= 0.68) tmp = Float64(x + Float64(Float64(y - x) * 4.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.58) tmp = (y - x) * (z * -6.0); elseif (z <= 0.68) tmp = x + ((y - x) * 4.0); else tmp = x + (z * (6.0 * (x - y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.58], N[(N[(y - x), $MachinePrecision] * N[(z * -6.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.68], N[(x + N[(N[(y - x), $MachinePrecision] * 4.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.58:\\
\;\;\;\;\left(y - x\right) \cdot \left(z \cdot -6\right)\\
\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;x + \left(y - x\right) \cdot 4\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(6 \cdot \left(x - y\right)\right)\\
\end{array}
\end{array}
if z < -0.57999999999999996Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 97.5%
neg-mul-197.5%
Simplified97.5%
distribute-rgt-neg-out97.5%
unsub-neg97.5%
associate-*l*97.5%
Applied egg-rr97.5%
Taylor expanded in z around inf 97.5%
*-commutative97.5%
associate-*r*97.5%
*-commutative97.5%
associate-*r*97.5%
Simplified97.5%
if -0.57999999999999996 < z < 0.680000000000000049Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.4%
if 0.680000000000000049 < z Initial program 99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around inf 97.2%
neg-mul-197.2%
Simplified97.2%
Final simplification98.3%
(FPCore (x y z) :precision binary64 (if (or (<= z -0.58) (not (<= z 0.58))) (* (- y x) (* z -6.0)) (+ x (* (- y x) 4.0))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -0.58) || !(z <= 0.58)) {
tmp = (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.58d0)) .or. (.not. (z <= 0.58d0))) 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.58) || !(z <= 0.58)) {
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.58) or not (z <= 0.58): 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.58) || !(z <= 0.58)) 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.58) || ~((z <= 0.58))) 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.58], N[Not[LessEqual[z, 0.58]], $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.58 \lor \neg \left(z \leq 0.58\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.57999999999999996 or 0.57999999999999996 < z Initial program 99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 97.4%
neg-mul-197.4%
Simplified97.4%
distribute-rgt-neg-out97.4%
unsub-neg97.4%
associate-*l*97.4%
Applied egg-rr97.4%
Taylor expanded in z around inf 97.3%
*-commutative97.3%
associate-*r*97.4%
*-commutative97.4%
associate-*r*97.4%
Simplified97.4%
if -0.57999999999999996 < z < 0.57999999999999996Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in z around 0 99.4%
Final simplification98.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -2.3e-71) (not (<= y 5.9e-5))) (* 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.3e-71) || !(y <= 5.9e-5)) {
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.3d-71)) .or. (.not. (y <= 5.9d-5))) 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.3e-71) || !(y <= 5.9e-5)) {
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.3e-71) or not (y <= 5.9e-5): 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.3e-71) || !(y <= 5.9e-5)) 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.3e-71) || ~((y <= 5.9e-5))) 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.3e-71], N[Not[LessEqual[y, 5.9e-5]], $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.3 \cdot 10^{-71} \lor \neg \left(y \leq 5.9 \cdot 10^{-5}\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.2999999999999998e-71 or 5.8999999999999998e-5 < y Initial program 99.7%
+-commutative99.7%
associate-*l*99.9%
fma-define99.9%
sub-neg99.9%
distribute-rgt-in99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 76.7%
if -2.2999999999999998e-71 < y < 5.8999999999999998e-5Initial program 99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around inf 78.4%
sub-neg78.4%
distribute-rgt-in78.5%
metadata-eval78.5%
distribute-lft-neg-in78.5%
associate-+r+78.5%
metadata-eval78.5%
distribute-rgt-neg-in78.5%
metadata-eval78.5%
Simplified78.5%
Final simplification77.5%
(FPCore (x y z) :precision binary64 (if (or (<= x -4.7e+79) (not (<= x 4.1e+68))) (* x -3.0) (* y 4.0)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -4.7e+79) || !(x <= 4.1e+68)) {
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 <= (-4.7d+79)) .or. (.not. (x <= 4.1d+68))) 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 <= -4.7e+79) || !(x <= 4.1e+68)) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -4.7e+79) or not (x <= 4.1e+68): tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -4.7e+79) || !(x <= 4.1e+68)) 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 <= -4.7e+79) || ~((x <= 4.1e+68))) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -4.7e+79], N[Not[LessEqual[x, 4.1e+68]], $MachinePrecision]], N[(x * -3.0), $MachinePrecision], N[(y * 4.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{+79} \lor \neg \left(x \leq 4.1 \cdot 10^{+68}\right):\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
\end{array}
if x < -4.70000000000000023e79 or 4.0999999999999999e68 < x Initial program 99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 85.9%
sub-neg85.9%
distribute-rgt-in86.0%
metadata-eval86.0%
distribute-lft-neg-in86.0%
associate-+r+86.0%
metadata-eval86.0%
distribute-rgt-neg-in86.0%
metadata-eval86.0%
Simplified86.0%
Taylor expanded in z around 0 48.9%
*-commutative48.9%
Simplified48.9%
if -4.70000000000000023e79 < x < 4.0999999999999999e68Initial program 99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around 0 47.1%
Taylor expanded in x around 0 36.0%
*-commutative36.0%
Simplified36.0%
Final simplification40.7%
(FPCore (x y z) :precision binary64 (+ x (* (* 6.0 (- x y)) (- z 0.6666666666666666))))
double code(double x, double y, double z) {
return x + ((6.0 * (x - y)) * (z - 0.6666666666666666));
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((6.0d0 * (x - y)) * (z - 0.6666666666666666d0))
end function
public static double code(double x, double y, double z) {
return x + ((6.0 * (x - y)) * (z - 0.6666666666666666));
}
def code(x, y, z): return x + ((6.0 * (x - y)) * (z - 0.6666666666666666))
function code(x, y, z) return Float64(x + Float64(Float64(6.0 * Float64(x - y)) * Float64(z - 0.6666666666666666))) end
function tmp = code(x, y, z) tmp = x + ((6.0 * (x - y)) * (z - 0.6666666666666666)); end
code[x_, y_, z_] := N[(x + N[(N[(6.0 * N[(x - y), $MachinePrecision]), $MachinePrecision] * N[(z - 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(6 \cdot \left(x - y\right)\right) \cdot \left(z - 0.6666666666666666\right)
\end{array}
Initial program 99.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 51.0%
sub-neg51.0%
distribute-rgt-in51.0%
metadata-eval51.0%
distribute-lft-neg-in51.0%
associate-+r+51.0%
metadata-eval51.0%
distribute-rgt-neg-in51.0%
metadata-eval51.0%
Simplified51.0%
Taylor expanded in z around 0 26.1%
*-commutative26.1%
Simplified26.1%
(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 52.6%
Taylor expanded in z around 0 2.5%
herbie shell --seed 2024123
(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))))