
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* (- 1.0 y) z))))
double code(double x, double y, double z) {
return x * (1.0 - ((1.0 - y) * 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 * (1.0d0 - ((1.0d0 - y) * z))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - ((1.0 - y) * z));
}
def code(x, y, z): return x * (1.0 - ((1.0 - y) * z))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(Float64(1.0 - y) * z))) end
function tmp = code(x, y, z) tmp = x * (1.0 - ((1.0 - y) * z)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* (- 1.0 y) z))))
double code(double x, double y, double z) {
return x * (1.0 - ((1.0 - y) * 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 * (1.0d0 - ((1.0d0 - y) * z))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - ((1.0 - y) * z));
}
def code(x, y, z): return x * (1.0 - ((1.0 - y) * z))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(Float64(1.0 - y) * z))) end
function tmp = code(x, y, z) tmp = x * (1.0 - ((1.0 - y) * z)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - \left(1 - y\right) \cdot z\right)
\end{array}
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- 1.0 y) z)))
(if (<= t_0 -1e+186)
(* z (* x (+ y -1.0)))
(if (<= t_0 1e+289)
(+ x (* x (- (* y z) z)))
(+ x (/ z (/ 1.0 (fma x y x))))))))
double code(double x, double y, double z) {
double t_0 = (1.0 - y) * z;
double tmp;
if (t_0 <= -1e+186) {
tmp = z * (x * (y + -1.0));
} else if (t_0 <= 1e+289) {
tmp = x + (x * ((y * z) - z));
} else {
tmp = x + (z / (1.0 / fma(x, y, x)));
}
return tmp;
}
function code(x, y, z) t_0 = Float64(Float64(1.0 - y) * z) tmp = 0.0 if (t_0 <= -1e+186) tmp = Float64(z * Float64(x * Float64(y + -1.0))); elseif (t_0 <= 1e+289) tmp = Float64(x + Float64(x * Float64(Float64(y * z) - z))); else tmp = Float64(x + Float64(z / Float64(1.0 / fma(x, y, x)))); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+186], N[(z * N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+289], N[(x + N[(x * N[(N[(y * z), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(1.0 / N[(x * y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - y\right) \cdot z\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+186}:\\
\;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\
\mathbf{elif}\;t\_0 \leq 10^{+289}:\\
\;\;\;\;x + x \cdot \left(y \cdot z - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{1}{\mathsf{fma}\left(x, y, x\right)}}\\
\end{array}
\end{array}
if (*.f64 (-.f64 1 y) z) < -9.9999999999999998e185Initial program 86.9%
Taylor expanded in z around inf 86.9%
*-commutative86.9%
associate-*l*99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
if -9.9999999999999998e185 < (*.f64 (-.f64 1 y) z) < 1.0000000000000001e289Initial program 99.9%
Taylor expanded in z around 0 99.9%
sub-neg99.9%
distribute-rgt-in99.9%
*-commutative99.9%
metadata-eval99.9%
neg-mul-199.9%
Applied egg-rr99.9%
unsub-neg99.9%
Applied egg-rr99.9%
if 1.0000000000000001e289 < (*.f64 (-.f64 1 y) z) Initial program 58.5%
Taylor expanded in z around 0 58.5%
sub-neg58.5%
distribute-rgt-in58.5%
*-commutative58.5%
metadata-eval58.5%
neg-mul-158.5%
Applied egg-rr58.5%
unsub-neg58.5%
Applied egg-rr58.5%
sub-neg58.5%
distribute-lft-in39.8%
*-commutative39.8%
associate-*r*80.9%
distribute-rgt-neg-in80.9%
distribute-lft-neg-in80.9%
distribute-rgt-in99.6%
flip-+49.9%
associate-*r/44.0%
add-sqr-sqrt24.8%
sqrt-unprod44.0%
sqr-neg44.0%
sqrt-unprod19.2%
add-sqr-sqrt44.0%
unsub-neg44.0%
Applied egg-rr50.3%
associate-/l*56.2%
unpow256.2%
associate-/r*62.3%
*-inverses99.8%
Simplified99.8%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (- x))) (t_1 (* x (* y z))))
(if (<= z -2.1e+169)
t_0
(if (<= z -2.25e-48)
t_1
(if (<= z 4.6e-82)
x
(if (<= z 8e-36)
t_1
(if (<= z 1.65e-14)
x
(if (or (<= z 1.9e+122) (not (<= z 6.8e+212))) t_1 t_0))))))))
double code(double x, double y, double z) {
double t_0 = z * -x;
double t_1 = x * (y * z);
double tmp;
if (z <= -2.1e+169) {
tmp = t_0;
} else if (z <= -2.25e-48) {
tmp = t_1;
} else if (z <= 4.6e-82) {
tmp = x;
} else if (z <= 8e-36) {
tmp = t_1;
} else if (z <= 1.65e-14) {
tmp = x;
} else if ((z <= 1.9e+122) || !(z <= 6.8e+212)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = z * -x
t_1 = x * (y * z)
if (z <= (-2.1d+169)) then
tmp = t_0
else if (z <= (-2.25d-48)) then
tmp = t_1
else if (z <= 4.6d-82) then
tmp = x
else if (z <= 8d-36) then
tmp = t_1
else if (z <= 1.65d-14) then
tmp = x
else if ((z <= 1.9d+122) .or. (.not. (z <= 6.8d+212))) then
tmp = t_1
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;
double t_1 = x * (y * z);
double tmp;
if (z <= -2.1e+169) {
tmp = t_0;
} else if (z <= -2.25e-48) {
tmp = t_1;
} else if (z <= 4.6e-82) {
tmp = x;
} else if (z <= 8e-36) {
tmp = t_1;
} else if (z <= 1.65e-14) {
tmp = x;
} else if ((z <= 1.9e+122) || !(z <= 6.8e+212)) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * -x t_1 = x * (y * z) tmp = 0 if z <= -2.1e+169: tmp = t_0 elif z <= -2.25e-48: tmp = t_1 elif z <= 4.6e-82: tmp = x elif z <= 8e-36: tmp = t_1 elif z <= 1.65e-14: tmp = x elif (z <= 1.9e+122) or not (z <= 6.8e+212): tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(-x)) t_1 = Float64(x * Float64(y * z)) tmp = 0.0 if (z <= -2.1e+169) tmp = t_0; elseif (z <= -2.25e-48) tmp = t_1; elseif (z <= 4.6e-82) tmp = x; elseif (z <= 8e-36) tmp = t_1; elseif (z <= 1.65e-14) tmp = x; elseif ((z <= 1.9e+122) || !(z <= 6.8e+212)) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * -x; t_1 = x * (y * z); tmp = 0.0; if (z <= -2.1e+169) tmp = t_0; elseif (z <= -2.25e-48) tmp = t_1; elseif (z <= 4.6e-82) tmp = x; elseif (z <= 8e-36) tmp = t_1; elseif (z <= 1.65e-14) tmp = x; elseif ((z <= 1.9e+122) || ~((z <= 6.8e+212))) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * (-x)), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+169], t$95$0, If[LessEqual[z, -2.25e-48], t$95$1, If[LessEqual[z, 4.6e-82], x, If[LessEqual[z, 8e-36], t$95$1, If[LessEqual[z, 1.65e-14], x, If[Or[LessEqual[z, 1.9e+122], N[Not[LessEqual[z, 6.8e+212]], $MachinePrecision]], t$95$1, t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(-x\right)\\
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+169}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq -2.25 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-82}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{-14}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+122} \lor \neg \left(z \leq 6.8 \cdot 10^{+212}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -2.1000000000000001e169 or 1.8999999999999999e122 < z < 6.80000000000000073e212Initial program 87.3%
Taylor expanded in z around inf 87.3%
*-commutative87.3%
associate-*l*99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 65.8%
neg-mul-165.8%
Simplified65.8%
if -2.1000000000000001e169 < z < -2.24999999999999994e-48 or 4.59999999999999994e-82 < z < 7.9999999999999995e-36 or 1.6499999999999999e-14 < z < 1.8999999999999999e122 or 6.80000000000000073e212 < z Initial program 92.7%
Taylor expanded in y around inf 59.6%
*-commutative59.6%
Simplified59.6%
if -2.24999999999999994e-48 < z < 4.59999999999999994e-82 or 7.9999999999999995e-36 < z < 1.6499999999999999e-14Initial program 99.9%
Taylor expanded in z around 0 83.6%
Final simplification69.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (* x (+ y -1.0)))))
(if (<= z -105000.0)
t_0
(if (<= z 4.6e-82)
(- x (* z x))
(if (<= z 1.2e-35)
(* x (* y z))
(if (<= z 2.1) (* x (- 1.0 z)) t_0))))))
double code(double x, double y, double z) {
double t_0 = z * (x * (y + -1.0));
double tmp;
if (z <= -105000.0) {
tmp = t_0;
} else if (z <= 4.6e-82) {
tmp = x - (z * x);
} else if (z <= 1.2e-35) {
tmp = x * (y * z);
} else if (z <= 2.1) {
tmp = x * (1.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 = z * (x * (y + (-1.0d0)))
if (z <= (-105000.0d0)) then
tmp = t_0
else if (z <= 4.6d-82) then
tmp = x - (z * x)
else if (z <= 1.2d-35) then
tmp = x * (y * z)
else if (z <= 2.1d0) then
tmp = x * (1.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 = z * (x * (y + -1.0));
double tmp;
if (z <= -105000.0) {
tmp = t_0;
} else if (z <= 4.6e-82) {
tmp = x - (z * x);
} else if (z <= 1.2e-35) {
tmp = x * (y * z);
} else if (z <= 2.1) {
tmp = x * (1.0 - z);
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * (x * (y + -1.0)) tmp = 0 if z <= -105000.0: tmp = t_0 elif z <= 4.6e-82: tmp = x - (z * x) elif z <= 1.2e-35: tmp = x * (y * z) elif z <= 2.1: tmp = x * (1.0 - z) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(z * Float64(x * Float64(y + -1.0))) tmp = 0.0 if (z <= -105000.0) tmp = t_0; elseif (z <= 4.6e-82) tmp = Float64(x - Float64(z * x)); elseif (z <= 1.2e-35) tmp = Float64(x * Float64(y * z)); elseif (z <= 2.1) tmp = Float64(x * Float64(1.0 - z)); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * (x * (y + -1.0)); tmp = 0.0; if (z <= -105000.0) tmp = t_0; elseif (z <= 4.6e-82) tmp = x - (z * x); elseif (z <= 1.2e-35) tmp = x * (y * z); elseif (z <= 2.1) tmp = x * (1.0 - z); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -105000.0], t$95$0, If[LessEqual[z, 4.6e-82], N[(x - N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e-35], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.1], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \left(x \cdot \left(y + -1\right)\right)\\
\mathbf{if}\;z \leq -105000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{-82}:\\
\;\;\;\;x - z \cdot x\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-35}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 2.1:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if z < -105000 or 2.10000000000000009 < z Initial program 89.6%
Taylor expanded in z around inf 89.6%
*-commutative89.6%
associate-*l*99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
if -105000 < z < 4.59999999999999994e-82Initial program 99.9%
Taylor expanded in y around 0 80.0%
sub-neg80.0%
distribute-rgt-in80.1%
*-un-lft-identity80.1%
Applied egg-rr80.1%
distribute-lft-neg-out80.1%
*-commutative80.1%
unsub-neg80.1%
Applied egg-rr80.1%
if 4.59999999999999994e-82 < z < 1.2000000000000001e-35Initial program 100.0%
Taylor expanded in y around inf 87.8%
*-commutative87.8%
Simplified87.8%
if 1.2000000000000001e-35 < z < 2.10000000000000009Initial program 99.8%
Taylor expanded in y around 0 77.8%
Final simplification90.9%
(FPCore (x y z)
:precision binary64
(if (<= z -105000.0)
(* z (- (* y x) x))
(if (<= z 8e-89)
(- x (* z x))
(if (<= z 9.8e-36)
(* x (* y z))
(if (<= z 0.112) (* x (- 1.0 z)) (* z (* x (+ y -1.0))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -105000.0) {
tmp = z * ((y * x) - x);
} else if (z <= 8e-89) {
tmp = x - (z * x);
} else if (z <= 9.8e-36) {
tmp = x * (y * z);
} else if (z <= 0.112) {
tmp = x * (1.0 - z);
} else {
tmp = z * (x * (y + -1.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 <= (-105000.0d0)) then
tmp = z * ((y * x) - x)
else if (z <= 8d-89) then
tmp = x - (z * x)
else if (z <= 9.8d-36) then
tmp = x * (y * z)
else if (z <= 0.112d0) then
tmp = x * (1.0d0 - z)
else
tmp = z * (x * (y + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -105000.0) {
tmp = z * ((y * x) - x);
} else if (z <= 8e-89) {
tmp = x - (z * x);
} else if (z <= 9.8e-36) {
tmp = x * (y * z);
} else if (z <= 0.112) {
tmp = x * (1.0 - z);
} else {
tmp = z * (x * (y + -1.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -105000.0: tmp = z * ((y * x) - x) elif z <= 8e-89: tmp = x - (z * x) elif z <= 9.8e-36: tmp = x * (y * z) elif z <= 0.112: tmp = x * (1.0 - z) else: tmp = z * (x * (y + -1.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -105000.0) tmp = Float64(z * Float64(Float64(y * x) - x)); elseif (z <= 8e-89) tmp = Float64(x - Float64(z * x)); elseif (z <= 9.8e-36) tmp = Float64(x * Float64(y * z)); elseif (z <= 0.112) tmp = Float64(x * Float64(1.0 - z)); else tmp = Float64(z * Float64(x * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -105000.0) tmp = z * ((y * x) - x); elseif (z <= 8e-89) tmp = x - (z * x); elseif (z <= 9.8e-36) tmp = x * (y * z); elseif (z <= 0.112) tmp = x * (1.0 - z); else tmp = z * (x * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -105000.0], N[(z * N[(N[(y * x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8e-89], N[(x - N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.8e-36], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.112], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(z * N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -105000:\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-89}:\\
\;\;\;\;x - z \cdot x\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq 0.112:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if z < -105000Initial program 92.3%
Taylor expanded in z around inf 92.3%
*-commutative92.3%
associate-*l*99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
distribute-lft-in99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 99.9%
if -105000 < z < 8.00000000000000031e-89Initial program 99.9%
Taylor expanded in y around 0 80.0%
sub-neg80.0%
distribute-rgt-in80.1%
*-un-lft-identity80.1%
Applied egg-rr80.1%
distribute-lft-neg-out80.1%
*-commutative80.1%
unsub-neg80.1%
Applied egg-rr80.1%
if 8.00000000000000031e-89 < z < 9.7999999999999994e-36Initial program 100.0%
Taylor expanded in y around inf 87.8%
*-commutative87.8%
Simplified87.8%
if 9.7999999999999994e-36 < z < 0.112000000000000002Initial program 99.8%
Taylor expanded in y around 0 77.8%
if 0.112000000000000002 < z Initial program 86.5%
Taylor expanded in z around inf 86.5%
*-commutative86.5%
associate-*l*99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification90.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (- 1.0 y) z)))
(if (or (<= t_0 -1e+186) (not (<= t_0 5e+201)))
(* z (* x (+ y -1.0)))
(+ x (* x (- (* y z) z))))))
double code(double x, double y, double z) {
double t_0 = (1.0 - y) * z;
double tmp;
if ((t_0 <= -1e+186) || !(t_0 <= 5e+201)) {
tmp = z * (x * (y + -1.0));
} else {
tmp = x + (x * ((y * z) - z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (1.0d0 - y) * z
if ((t_0 <= (-1d+186)) .or. (.not. (t_0 <= 5d+201))) then
tmp = z * (x * (y + (-1.0d0)))
else
tmp = x + (x * ((y * z) - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = (1.0 - y) * z;
double tmp;
if ((t_0 <= -1e+186) || !(t_0 <= 5e+201)) {
tmp = z * (x * (y + -1.0));
} else {
tmp = x + (x * ((y * z) - z));
}
return tmp;
}
def code(x, y, z): t_0 = (1.0 - y) * z tmp = 0 if (t_0 <= -1e+186) or not (t_0 <= 5e+201): tmp = z * (x * (y + -1.0)) else: tmp = x + (x * ((y * z) - z)) return tmp
function code(x, y, z) t_0 = Float64(Float64(1.0 - y) * z) tmp = 0.0 if ((t_0 <= -1e+186) || !(t_0 <= 5e+201)) tmp = Float64(z * Float64(x * Float64(y + -1.0))); else tmp = Float64(x + Float64(x * Float64(Float64(y * z) - z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = (1.0 - y) * z; tmp = 0.0; if ((t_0 <= -1e+186) || ~((t_0 <= 5e+201))) tmp = z * (x * (y + -1.0)); else tmp = x + (x * ((y * z) - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -1e+186], N[Not[LessEqual[t$95$0, 5e+201]], $MachinePrecision]], N[(z * N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(x * N[(N[(y * z), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - y\right) \cdot z\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+186} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+201}\right):\\
\;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + x \cdot \left(y \cdot z - z\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 1 y) z) < -9.9999999999999998e185 or 4.9999999999999995e201 < (*.f64 (-.f64 1 y) z) Initial program 84.3%
Taylor expanded in z around inf 84.3%
*-commutative84.3%
associate-*l*99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
if -9.9999999999999998e185 < (*.f64 (-.f64 1 y) z) < 4.9999999999999995e201Initial program 99.9%
Taylor expanded in z around 0 99.9%
sub-neg99.9%
distribute-rgt-in100.0%
*-commutative100.0%
metadata-eval100.0%
neg-mul-1100.0%
Applied egg-rr100.0%
unsub-neg100.0%
Applied egg-rr100.0%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= z -1e+25) (* z (- (* y x) x)) (if (<= z 1e+77) (* x (+ 1.0 (* z (+ y -1.0)))) (* z (* x (+ y -1.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1e+25) {
tmp = z * ((y * x) - x);
} else if (z <= 1e+77) {
tmp = x * (1.0 + (z * (y + -1.0)));
} else {
tmp = z * (x * (y + -1.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 <= (-1d+25)) then
tmp = z * ((y * x) - x)
else if (z <= 1d+77) then
tmp = x * (1.0d0 + (z * (y + (-1.0d0))))
else
tmp = z * (x * (y + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1e+25) {
tmp = z * ((y * x) - x);
} else if (z <= 1e+77) {
tmp = x * (1.0 + (z * (y + -1.0)));
} else {
tmp = z * (x * (y + -1.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1e+25: tmp = z * ((y * x) - x) elif z <= 1e+77: tmp = x * (1.0 + (z * (y + -1.0))) else: tmp = z * (x * (y + -1.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1e+25) tmp = Float64(z * Float64(Float64(y * x) - x)); elseif (z <= 1e+77) tmp = Float64(x * Float64(1.0 + Float64(z * Float64(y + -1.0)))); else tmp = Float64(z * Float64(x * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1e+25) tmp = z * ((y * x) - x); elseif (z <= 1e+77) tmp = x * (1.0 + (z * (y + -1.0))); else tmp = z * (x * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1e+25], N[(z * N[(N[(y * x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+77], N[(x * N[(1.0 + N[(z * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+25}:\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\
\mathbf{elif}\;z \leq 10^{+77}:\\
\;\;\;\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if z < -1.00000000000000009e25Initial program 91.9%
Taylor expanded in z around inf 91.9%
*-commutative91.9%
associate-*l*99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
distribute-lft-in99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 99.9%
if -1.00000000000000009e25 < z < 9.99999999999999983e76Initial program 99.9%
if 9.99999999999999983e76 < z Initial program 80.2%
Taylor expanded in z around inf 80.2%
*-commutative80.2%
associate-*l*99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= z -5e+29) (* z (- (* y x) x)) (if (<= z 1e+77) (- x (* (* (- 1.0 y) z) x)) (* z (* x (+ y -1.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -5e+29) {
tmp = z * ((y * x) - x);
} else if (z <= 1e+77) {
tmp = x - (((1.0 - y) * z) * x);
} else {
tmp = z * (x * (y + -1.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 <= (-5d+29)) then
tmp = z * ((y * x) - x)
else if (z <= 1d+77) then
tmp = x - (((1.0d0 - y) * z) * x)
else
tmp = z * (x * (y + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -5e+29) {
tmp = z * ((y * x) - x);
} else if (z <= 1e+77) {
tmp = x - (((1.0 - y) * z) * x);
} else {
tmp = z * (x * (y + -1.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -5e+29: tmp = z * ((y * x) - x) elif z <= 1e+77: tmp = x - (((1.0 - y) * z) * x) else: tmp = z * (x * (y + -1.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -5e+29) tmp = Float64(z * Float64(Float64(y * x) - x)); elseif (z <= 1e+77) tmp = Float64(x - Float64(Float64(Float64(1.0 - y) * z) * x)); else tmp = Float64(z * Float64(x * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -5e+29) tmp = z * ((y * x) - x); elseif (z <= 1e+77) tmp = x - (((1.0 - y) * z) * x); else tmp = z * (x * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -5e+29], N[(z * N[(N[(y * x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+77], N[(x - N[(N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(z * N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+29}:\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\
\mathbf{elif}\;z \leq 10^{+77}:\\
\;\;\;\;x - \left(\left(1 - y\right) \cdot z\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if z < -5.0000000000000001e29Initial program 91.9%
Taylor expanded in z around inf 91.9%
*-commutative91.9%
associate-*l*99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
distribute-lft-in99.9%
*-commutative99.9%
mul-1-neg99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 99.9%
if -5.0000000000000001e29 < z < 9.99999999999999983e76Initial program 99.9%
Taylor expanded in z around 0 100.0%
if 9.99999999999999983e76 < z Initial program 80.2%
Taylor expanded in z around inf 80.2%
*-commutative80.2%
associate-*l*99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (<= z -0.98) (* z (- (* y x) x)) (if (<= z 7400000.0) (+ x (* x (* y z))) (* z (* x (+ y -1.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -0.98) {
tmp = z * ((y * x) - x);
} else if (z <= 7400000.0) {
tmp = x + (x * (y * z));
} else {
tmp = z * (x * (y + -1.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.98d0)) then
tmp = z * ((y * x) - x)
else if (z <= 7400000.0d0) then
tmp = x + (x * (y * z))
else
tmp = z * (x * (y + (-1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -0.98) {
tmp = z * ((y * x) - x);
} else if (z <= 7400000.0) {
tmp = x + (x * (y * z));
} else {
tmp = z * (x * (y + -1.0));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -0.98: tmp = z * ((y * x) - x) elif z <= 7400000.0: tmp = x + (x * (y * z)) else: tmp = z * (x * (y + -1.0)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -0.98) tmp = Float64(z * Float64(Float64(y * x) - x)); elseif (z <= 7400000.0) tmp = Float64(x + Float64(x * Float64(y * z))); else tmp = Float64(z * Float64(x * Float64(y + -1.0))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -0.98) tmp = z * ((y * x) - x); elseif (z <= 7400000.0) tmp = x + (x * (y * z)); else tmp = z * (x * (y + -1.0)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -0.98], N[(z * N[(N[(y * x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7400000.0], N[(x + N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(x * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.98:\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\
\mathbf{elif}\;z \leq 7400000:\\
\;\;\;\;x + x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if z < -0.97999999999999998Initial program 92.5%
Taylor expanded in z around inf 90.7%
*-commutative90.7%
associate-*l*98.1%
*-commutative98.1%
sub-neg98.1%
metadata-eval98.1%
Simplified98.1%
distribute-lft-in98.2%
*-commutative98.2%
mul-1-neg98.2%
Applied egg-rr98.2%
Taylor expanded in z around 0 98.2%
if -0.97999999999999998 < z < 7.4e6Initial program 99.9%
Taylor expanded in z around 0 100.0%
Taylor expanded in y around inf 97.3%
*-commutative97.3%
Simplified97.3%
if 7.4e6 < z Initial program 85.6%
Taylor expanded in z around inf 85.6%
*-commutative85.6%
associate-*l*99.8%
*-commutative99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification98.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -4.45e+42) (not (<= y 1550000.0))) (* x (* y z)) (* x (- 1.0 z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -4.45e+42) || !(y <= 1550000.0)) {
tmp = x * (y * z);
} else {
tmp = x * (1.0 - z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-4.45d+42)) .or. (.not. (y <= 1550000.0d0))) then
tmp = x * (y * z)
else
tmp = x * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -4.45e+42) || !(y <= 1550000.0)) {
tmp = x * (y * z);
} else {
tmp = x * (1.0 - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -4.45e+42) or not (y <= 1550000.0): tmp = x * (y * z) else: tmp = x * (1.0 - z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -4.45e+42) || !(y <= 1550000.0)) tmp = Float64(x * Float64(y * z)); else tmp = Float64(x * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -4.45e+42) || ~((y <= 1550000.0))) tmp = x * (y * z); else tmp = x * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.45e+42], N[Not[LessEqual[y, 1550000.0]], $MachinePrecision]], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.45 \cdot 10^{+42} \lor \neg \left(y \leq 1550000\right):\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if y < -4.44999999999999988e42 or 1.55e6 < y Initial program 88.9%
Taylor expanded in y around inf 68.9%
*-commutative68.9%
Simplified68.9%
if -4.44999999999999988e42 < y < 1.55e6Initial program 99.9%
Taylor expanded in y around 0 94.5%
Final simplification81.6%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.12e+42) (not (<= y 4300.0))) (* y (* z x)) (* x (- 1.0 z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.12e+42) || !(y <= 4300.0)) {
tmp = y * (z * x);
} else {
tmp = x * (1.0 - z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.12d+42)) .or. (.not. (y <= 4300.0d0))) then
tmp = y * (z * x)
else
tmp = x * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.12e+42) || !(y <= 4300.0)) {
tmp = y * (z * x);
} else {
tmp = x * (1.0 - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.12e+42) or not (y <= 4300.0): tmp = y * (z * x) else: tmp = x * (1.0 - z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.12e+42) || !(y <= 4300.0)) tmp = Float64(y * Float64(z * x)); else tmp = Float64(x * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.12e+42) || ~((y <= 4300.0))) tmp = y * (z * x); else tmp = x * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.12e+42], N[Not[LessEqual[y, 4300.0]], $MachinePrecision]], N[(y * N[(z * x), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{+42} \lor \neg \left(y \leq 4300\right):\\
\;\;\;\;y \cdot \left(z \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if y < -1.12e42 or 4300 < y Initial program 88.9%
Taylor expanded in y around inf 68.9%
*-commutative68.9%
associate-*l*76.4%
*-commutative76.4%
Simplified76.4%
if -1.12e42 < y < 4300Initial program 99.9%
Taylor expanded in y around 0 94.5%
Final simplification85.3%
(FPCore (x y z) :precision binary64 (if (or (<= y -1.2e+42) (not (<= y 31500.0))) (* z (* y x)) (* x (- 1.0 z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1.2e+42) || !(y <= 31500.0)) {
tmp = z * (y * x);
} else {
tmp = x * (1.0 - z);
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((y <= (-1.2d+42)) .or. (.not. (y <= 31500.0d0))) then
tmp = z * (y * x)
else
tmp = x * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -1.2e+42) || !(y <= 31500.0)) {
tmp = z * (y * x);
} else {
tmp = x * (1.0 - z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1.2e+42) or not (y <= 31500.0): tmp = z * (y * x) else: tmp = x * (1.0 - z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1.2e+42) || !(y <= 31500.0)) tmp = Float64(z * Float64(y * x)); else tmp = Float64(x * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1.2e+42) || ~((y <= 31500.0))) tmp = z * (y * x); else tmp = x * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1.2e+42], N[Not[LessEqual[y, 31500.0]], $MachinePrecision]], N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+42} \lor \neg \left(y \leq 31500\right):\\
\;\;\;\;z \cdot \left(y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if y < -1.1999999999999999e42 or 31500 < y Initial program 88.9%
Taylor expanded in y around inf 68.9%
associate-*r*79.2%
*-commutative79.2%
Simplified79.2%
if -1.1999999999999999e42 < y < 31500Initial program 99.9%
Taylor expanded in y around 0 94.5%
Final simplification86.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -9.5e+41) (not (<= y 3850.0))) (* z (* y x)) (- x (* z x))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -9.5e+41) || !(y <= 3850.0)) {
tmp = z * (y * x);
} else {
tmp = x - (z * 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 ((y <= (-9.5d+41)) .or. (.not. (y <= 3850.0d0))) then
tmp = z * (y * x)
else
tmp = x - (z * x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -9.5e+41) || !(y <= 3850.0)) {
tmp = z * (y * x);
} else {
tmp = x - (z * x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -9.5e+41) or not (y <= 3850.0): tmp = z * (y * x) else: tmp = x - (z * x) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -9.5e+41) || !(y <= 3850.0)) tmp = Float64(z * Float64(y * x)); else tmp = Float64(x - Float64(z * x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -9.5e+41) || ~((y <= 3850.0))) tmp = z * (y * x); else tmp = x - (z * x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -9.5e+41], N[Not[LessEqual[y, 3850.0]], $MachinePrecision]], N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+41} \lor \neg \left(y \leq 3850\right):\\
\;\;\;\;z \cdot \left(y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot x\\
\end{array}
\end{array}
if y < -9.4999999999999996e41 or 3850 < y Initial program 88.9%
Taylor expanded in y around inf 68.9%
associate-*r*79.2%
*-commutative79.2%
Simplified79.2%
if -9.4999999999999996e41 < y < 3850Initial program 99.9%
Taylor expanded in y around 0 94.5%
sub-neg94.5%
distribute-rgt-in94.5%
*-un-lft-identity94.5%
Applied egg-rr94.5%
distribute-lft-neg-out94.5%
*-commutative94.5%
unsub-neg94.5%
Applied egg-rr94.5%
Final simplification86.8%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 7.6))) (* z (- x)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 7.6)) {
tmp = z * -x;
} else {
tmp = 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 <= (-1.0d0)) .or. (.not. (z <= 7.6d0))) then
tmp = z * -x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 7.6)) {
tmp = z * -x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 7.6): tmp = z * -x else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 7.6)) tmp = Float64(z * Float64(-x)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 7.6))) tmp = z * -x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 7.6]], $MachinePrecision]], N[(z * (-x)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 7.6\right):\\
\;\;\;\;z \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1 or 7.5999999999999996 < z Initial program 89.7%
Taylor expanded in z around inf 88.7%
*-commutative88.7%
associate-*l*98.9%
*-commutative98.9%
sub-neg98.9%
metadata-eval98.9%
Simplified98.9%
Taylor expanded in y around 0 46.7%
neg-mul-146.7%
Simplified46.7%
if -1 < z < 7.5999999999999996Initial program 99.9%
Taylor expanded in z around 0 72.1%
Final simplification58.3%
(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 94.4%
Taylor expanded in z around 0 34.9%
Final simplification34.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (- 1.0 (* (- 1.0 y) z))))
(t_1 (+ x (* (- 1.0 y) (* (- z) x)))))
(if (< t_0 -1.618195973607049e+50)
t_1
(if (< t_0 3.892237649663903e+134) (- (* (* x y) z) (- (* x z) x)) t_1))))
double code(double x, double y, double z) {
double t_0 = x * (1.0 - ((1.0 - y) * z));
double t_1 = x + ((1.0 - y) * (-z * x));
double tmp;
if (t_0 < -1.618195973607049e+50) {
tmp = t_1;
} else if (t_0 < 3.892237649663903e+134) {
tmp = ((x * y) * z) - ((x * z) - x);
} 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 * (1.0d0 - ((1.0d0 - y) * z))
t_1 = x + ((1.0d0 - y) * (-z * x))
if (t_0 < (-1.618195973607049d+50)) then
tmp = t_1
else if (t_0 < 3.892237649663903d+134) then
tmp = ((x * y) * z) - ((x * z) - x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * (1.0 - ((1.0 - y) * z));
double t_1 = x + ((1.0 - y) * (-z * x));
double tmp;
if (t_0 < -1.618195973607049e+50) {
tmp = t_1;
} else if (t_0 < 3.892237649663903e+134) {
tmp = ((x * y) * z) - ((x * z) - x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * (1.0 - ((1.0 - y) * z)) t_1 = x + ((1.0 - y) * (-z * x)) tmp = 0 if t_0 < -1.618195973607049e+50: tmp = t_1 elif t_0 < 3.892237649663903e+134: tmp = ((x * y) * z) - ((x * z) - x) else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(1.0 - Float64(Float64(1.0 - y) * z))) t_1 = Float64(x + Float64(Float64(1.0 - y) * Float64(Float64(-z) * x))) tmp = 0.0 if (t_0 < -1.618195973607049e+50) tmp = t_1; elseif (t_0 < 3.892237649663903e+134) tmp = Float64(Float64(Float64(x * y) * z) - Float64(Float64(x * z) - x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (1.0 - ((1.0 - y) * z)); t_1 = x + ((1.0 - y) * (-z * x)); tmp = 0.0; if (t_0 < -1.618195973607049e+50) tmp = t_1; elseif (t_0 < 3.892237649663903e+134) tmp = ((x * y) * z) - ((x * z) - x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(1.0 - N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(N[(1.0 - y), $MachinePrecision] * N[((-z) * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$0, -1.618195973607049e+50], t$95$1, If[Less[t$95$0, 3.892237649663903e+134], N[(N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision] - N[(N[(x * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(1 - \left(1 - y\right) \cdot z\right)\\
t_1 := x + \left(1 - y\right) \cdot \left(\left(-z\right) \cdot x\right)\\
\mathbf{if}\;t\_0 < -1.618195973607049 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 < 3.892237649663903 \cdot 10^{+134}:\\
\;\;\;\;\left(x \cdot y\right) \cdot z - \left(x \cdot z - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024029
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, J"
:precision binary64
:herbie-target
(if (< (* x (- 1.0 (* (- 1.0 y) z))) -1.618195973607049e+50) (+ x (* (- 1.0 y) (* (- z) x))) (if (< (* x (- 1.0 (* (- 1.0 y) z))) 3.892237649663903e+134) (- (* (* x y) z) (- (* x z) x)) (+ x (* (- 1.0 y) (* (- z) x)))))
(* x (- 1.0 (* (- 1.0 y) z))))