
(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 13 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 (fma (+ y -1.0) (* x z) x))
double code(double x, double y, double z) {
return fma((y + -1.0), (x * z), x);
}
function code(x, y, z) return fma(Float64(y + -1.0), Float64(x * z), x) end
code[x_, y_, z_] := N[(N[(y + -1.0), $MachinePrecision] * N[(x * z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y + -1, x \cdot z, x\right)
\end{array}
Initial program 96.6%
distribute-rgt-out--96.6%
*-lft-identity96.6%
cancel-sign-sub-inv96.6%
+-commutative96.6%
distribute-lft-neg-in96.6%
associate-*l*98.6%
fma-def98.6%
neg-sub098.6%
associate--r-98.6%
metadata-eval98.6%
+-commutative98.6%
*-commutative98.6%
Simplified98.6%
Final simplification98.6%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* x z))) (t_1 (* x (- z))))
(if (<= z -1.3e+270)
t_0
(if (<= z -3.7e+71)
t_1
(if (<= z -1.02e-16)
t_0
(if (<= z 3.75e-103)
x
(if (<= z 9e-65)
t_0
(if (<= z 1.6e-11) x (if (<= z 1.95e+85) t_0 t_1)))))))))
double code(double x, double y, double z) {
double t_0 = y * (x * z);
double t_1 = x * -z;
double tmp;
if (z <= -1.3e+270) {
tmp = t_0;
} else if (z <= -3.7e+71) {
tmp = t_1;
} else if (z <= -1.02e-16) {
tmp = t_0;
} else if (z <= 3.75e-103) {
tmp = x;
} else if (z <= 9e-65) {
tmp = t_0;
} else if (z <= 1.6e-11) {
tmp = x;
} else if (z <= 1.95e+85) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = y * (x * z)
t_1 = x * -z
if (z <= (-1.3d+270)) then
tmp = t_0
else if (z <= (-3.7d+71)) then
tmp = t_1
else if (z <= (-1.02d-16)) then
tmp = t_0
else if (z <= 3.75d-103) then
tmp = x
else if (z <= 9d-65) then
tmp = t_0
else if (z <= 1.6d-11) then
tmp = x
else if (z <= 1.95d+85) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x * z);
double t_1 = x * -z;
double tmp;
if (z <= -1.3e+270) {
tmp = t_0;
} else if (z <= -3.7e+71) {
tmp = t_1;
} else if (z <= -1.02e-16) {
tmp = t_0;
} else if (z <= 3.75e-103) {
tmp = x;
} else if (z <= 9e-65) {
tmp = t_0;
} else if (z <= 1.6e-11) {
tmp = x;
} else if (z <= 1.95e+85) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x * z) t_1 = x * -z tmp = 0 if z <= -1.3e+270: tmp = t_0 elif z <= -3.7e+71: tmp = t_1 elif z <= -1.02e-16: tmp = t_0 elif z <= 3.75e-103: tmp = x elif z <= 9e-65: tmp = t_0 elif z <= 1.6e-11: tmp = x elif z <= 1.95e+85: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x * z)) t_1 = Float64(x * Float64(-z)) tmp = 0.0 if (z <= -1.3e+270) tmp = t_0; elseif (z <= -3.7e+71) tmp = t_1; elseif (z <= -1.02e-16) tmp = t_0; elseif (z <= 3.75e-103) tmp = x; elseif (z <= 9e-65) tmp = t_0; elseif (z <= 1.6e-11) tmp = x; elseif (z <= 1.95e+85) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x * z); t_1 = x * -z; tmp = 0.0; if (z <= -1.3e+270) tmp = t_0; elseif (z <= -3.7e+71) tmp = t_1; elseif (z <= -1.02e-16) tmp = t_0; elseif (z <= 3.75e-103) tmp = x; elseif (z <= 9e-65) tmp = t_0; elseif (z <= 1.6e-11) tmp = x; elseif (z <= 1.95e+85) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * (-z)), $MachinePrecision]}, If[LessEqual[z, -1.3e+270], t$95$0, If[LessEqual[z, -3.7e+71], t$95$1, If[LessEqual[z, -1.02e-16], t$95$0, If[LessEqual[z, 3.75e-103], x, If[LessEqual[z, 9e-65], t$95$0, If[LessEqual[z, 1.6e-11], x, If[LessEqual[z, 1.95e+85], t$95$0, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(x \cdot z\right)\\
t_1 := x \cdot \left(-z\right)\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+270}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.7 \cdot 10^{+71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-16}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 3.75 \cdot 10^{-103}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-65}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-11}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.95 \cdot 10^{+85}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.30000000000000006e270 or -3.7e71 < z < -1.0200000000000001e-16 or 3.75e-103 < z < 8.9999999999999995e-65 or 1.59999999999999997e-11 < z < 1.95000000000000017e85Initial program 96.6%
Taylor expanded in y around inf 70.1%
if -1.30000000000000006e270 < z < -3.7e71 or 1.95000000000000017e85 < z Initial program 91.7%
Taylor expanded in z around inf 99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
distribute-rgt-in99.9%
neg-mul-199.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 69.5%
neg-mul-169.5%
Simplified69.5%
if -1.0200000000000001e-16 < z < 3.75e-103 or 8.9999999999999995e-65 < z < 1.59999999999999997e-11Initial program 99.9%
Taylor expanded in z around 0 87.5%
Final simplification77.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (* x z))) (t_1 (* z (* y x))) (t_2 (* x (- z))))
(if (<= z -9e+273)
t_1
(if (<= z -7e+75)
t_2
(if (<= z -9.2e-26)
t_0
(if (<= z 3.75e-103)
x
(if (<= z 9e-65)
t_0
(if (<= z 2.5e-12) x (if (<= z 3e+86) t_1 t_2)))))))))
double code(double x, double y, double z) {
double t_0 = y * (x * z);
double t_1 = z * (y * x);
double t_2 = x * -z;
double tmp;
if (z <= -9e+273) {
tmp = t_1;
} else if (z <= -7e+75) {
tmp = t_2;
} else if (z <= -9.2e-26) {
tmp = t_0;
} else if (z <= 3.75e-103) {
tmp = x;
} else if (z <= 9e-65) {
tmp = t_0;
} else if (z <= 2.5e-12) {
tmp = x;
} else if (z <= 3e+86) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_0 = y * (x * z)
t_1 = z * (y * x)
t_2 = x * -z
if (z <= (-9d+273)) then
tmp = t_1
else if (z <= (-7d+75)) then
tmp = t_2
else if (z <= (-9.2d-26)) then
tmp = t_0
else if (z <= 3.75d-103) then
tmp = x
else if (z <= 9d-65) then
tmp = t_0
else if (z <= 2.5d-12) then
tmp = x
else if (z <= 3d+86) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * (x * z);
double t_1 = z * (y * x);
double t_2 = x * -z;
double tmp;
if (z <= -9e+273) {
tmp = t_1;
} else if (z <= -7e+75) {
tmp = t_2;
} else if (z <= -9.2e-26) {
tmp = t_0;
} else if (z <= 3.75e-103) {
tmp = x;
} else if (z <= 9e-65) {
tmp = t_0;
} else if (z <= 2.5e-12) {
tmp = x;
} else if (z <= 3e+86) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z): t_0 = y * (x * z) t_1 = z * (y * x) t_2 = x * -z tmp = 0 if z <= -9e+273: tmp = t_1 elif z <= -7e+75: tmp = t_2 elif z <= -9.2e-26: tmp = t_0 elif z <= 3.75e-103: tmp = x elif z <= 9e-65: tmp = t_0 elif z <= 2.5e-12: tmp = x elif z <= 3e+86: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z) t_0 = Float64(y * Float64(x * z)) t_1 = Float64(z * Float64(y * x)) t_2 = Float64(x * Float64(-z)) tmp = 0.0 if (z <= -9e+273) tmp = t_1; elseif (z <= -7e+75) tmp = t_2; elseif (z <= -9.2e-26) tmp = t_0; elseif (z <= 3.75e-103) tmp = x; elseif (z <= 9e-65) tmp = t_0; elseif (z <= 2.5e-12) tmp = x; elseif (z <= 3e+86) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * (x * z); t_1 = z * (y * x); t_2 = x * -z; tmp = 0.0; if (z <= -9e+273) tmp = t_1; elseif (z <= -7e+75) tmp = t_2; elseif (z <= -9.2e-26) tmp = t_0; elseif (z <= 3.75e-103) tmp = x; elseif (z <= 9e-65) tmp = t_0; elseif (z <= 2.5e-12) tmp = x; elseif (z <= 3e+86) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * (-z)), $MachinePrecision]}, If[LessEqual[z, -9e+273], t$95$1, If[LessEqual[z, -7e+75], t$95$2, If[LessEqual[z, -9.2e-26], t$95$0, If[LessEqual[z, 3.75e-103], x, If[LessEqual[z, 9e-65], t$95$0, If[LessEqual[z, 2.5e-12], x, If[LessEqual[z, 3e+86], t$95$1, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(x \cdot z\right)\\
t_1 := z \cdot \left(y \cdot x\right)\\
t_2 := x \cdot \left(-z\right)\\
\mathbf{if}\;z \leq -9 \cdot 10^{+273}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7 \cdot 10^{+75}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{-26}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 3.75 \cdot 10^{-103}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-65}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-12}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+86}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -8.99999999999999987e273 or 2.49999999999999985e-12 < z < 2.99999999999999977e86Initial program 94.8%
Taylor expanded in y around inf 68.8%
*-commutative68.8%
associate-*r*68.9%
*-commutative68.9%
Simplified68.9%
if -8.99999999999999987e273 < z < -6.9999999999999997e75 or 2.99999999999999977e86 < z Initial program 91.7%
Taylor expanded in z around inf 99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
distribute-rgt-in99.9%
neg-mul-199.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 69.5%
neg-mul-169.5%
Simplified69.5%
if -6.9999999999999997e75 < z < -9.20000000000000035e-26 or 3.75e-103 < z < 8.9999999999999995e-65Initial program 99.8%
Taylor expanded in y around inf 72.3%
if -9.20000000000000035e-26 < z < 3.75e-103 or 8.9999999999999995e-65 < z < 2.49999999999999985e-12Initial program 99.9%
Taylor expanded in z around 0 87.5%
Final simplification77.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (* y z))) (t_1 (* x (- z))))
(if (<= z -6e+272)
t_0
(if (<= z -1.0)
t_1
(if (<= z 3.75e-103)
x
(if (<= z 9e-65)
t_0
(if (<= z 2.9e-11) x (if (<= z 6e+84) t_0 t_1))))))))
double code(double x, double y, double z) {
double t_0 = x * (y * z);
double t_1 = x * -z;
double tmp;
if (z <= -6e+272) {
tmp = t_0;
} else if (z <= -1.0) {
tmp = t_1;
} else if (z <= 3.75e-103) {
tmp = x;
} else if (z <= 9e-65) {
tmp = t_0;
} else if (z <= 2.9e-11) {
tmp = x;
} else if (z <= 6e+84) {
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 * (y * z)
t_1 = x * -z
if (z <= (-6d+272)) then
tmp = t_0
else if (z <= (-1.0d0)) then
tmp = t_1
else if (z <= 3.75d-103) then
tmp = x
else if (z <= 9d-65) then
tmp = t_0
else if (z <= 2.9d-11) then
tmp = x
else if (z <= 6d+84) 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 * (y * z);
double t_1 = x * -z;
double tmp;
if (z <= -6e+272) {
tmp = t_0;
} else if (z <= -1.0) {
tmp = t_1;
} else if (z <= 3.75e-103) {
tmp = x;
} else if (z <= 9e-65) {
tmp = t_0;
} else if (z <= 2.9e-11) {
tmp = x;
} else if (z <= 6e+84) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z): t_0 = x * (y * z) t_1 = x * -z tmp = 0 if z <= -6e+272: tmp = t_0 elif z <= -1.0: tmp = t_1 elif z <= 3.75e-103: tmp = x elif z <= 9e-65: tmp = t_0 elif z <= 2.9e-11: tmp = x elif z <= 6e+84: tmp = t_0 else: tmp = t_1 return tmp
function code(x, y, z) t_0 = Float64(x * Float64(y * z)) t_1 = Float64(x * Float64(-z)) tmp = 0.0 if (z <= -6e+272) tmp = t_0; elseif (z <= -1.0) tmp = t_1; elseif (z <= 3.75e-103) tmp = x; elseif (z <= 9e-65) tmp = t_0; elseif (z <= 2.9e-11) tmp = x; elseif (z <= 6e+84) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * (y * z); t_1 = x * -z; tmp = 0.0; if (z <= -6e+272) tmp = t_0; elseif (z <= -1.0) tmp = t_1; elseif (z <= 3.75e-103) tmp = x; elseif (z <= 9e-65) tmp = t_0; elseif (z <= 2.9e-11) tmp = x; elseif (z <= 6e+84) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * (-z)), $MachinePrecision]}, If[LessEqual[z, -6e+272], t$95$0, If[LessEqual[z, -1.0], t$95$1, If[LessEqual[z, 3.75e-103], x, If[LessEqual[z, 9e-65], t$95$0, If[LessEqual[z, 2.9e-11], x, If[LessEqual[z, 6e+84], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \left(y \cdot z\right)\\
t_1 := x \cdot \left(-z\right)\\
\mathbf{if}\;z \leq -6 \cdot 10^{+272}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.75 \cdot 10^{-103}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 9 \cdot 10^{-65}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-11}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+84}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -6.0000000000000004e272 or 3.75e-103 < z < 8.9999999999999995e-65 or 2.9e-11 < z < 5.99999999999999992e84Initial program 95.7%
distribute-rgt-out--95.8%
*-lft-identity95.8%
cancel-sign-sub-inv95.8%
+-commutative95.8%
distribute-lft-neg-in95.8%
associate-*l*99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
metadata-eval99.9%
+-commutative99.9%
*-commutative99.9%
Simplified99.9%
fma-udef99.9%
flip-+36.1%
associate-*r*36.0%
associate-*r*36.0%
associate-*r*35.7%
Applied egg-rr35.7%
difference-of-squares36.1%
fma-def36.1%
associate-/l*58.5%
fma-def58.5%
metadata-eval58.5%
sub-neg58.5%
*-commutative58.5%
associate-*r*54.4%
distribute-lft1-in54.4%
+-commutative54.4%
*-inverses95.7%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in y around inf 70.2%
associate-*r*66.0%
*-commutative66.0%
*-commutative66.0%
Simplified66.0%
if -6.0000000000000004e272 < z < -1 or 5.99999999999999992e84 < z Initial program 92.7%
Taylor expanded in z around inf 99.2%
*-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
distribute-rgt-in99.2%
neg-mul-199.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in y around 0 66.1%
neg-mul-166.1%
Simplified66.1%
if -1 < z < 3.75e-103 or 8.9999999999999995e-65 < z < 2.9e-11Initial program 99.9%
Taylor expanded in z around 0 86.1%
Final simplification75.4%
(FPCore (x y z) :precision binary64 (if (or (<= y -160000000.0) (not (<= y 1.95e-5))) (+ x (* z (* y x))) (- x (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -160000000.0) || !(y <= 1.95e-5)) {
tmp = x + (z * (y * x));
} else {
tmp = x - (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 ((y <= (-160000000.0d0)) .or. (.not. (y <= 1.95d-5))) then
tmp = x + (z * (y * x))
else
tmp = x - (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -160000000.0) || !(y <= 1.95e-5)) {
tmp = x + (z * (y * x));
} else {
tmp = x - (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -160000000.0) or not (y <= 1.95e-5): tmp = x + (z * (y * x)) else: tmp = x - (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -160000000.0) || !(y <= 1.95e-5)) tmp = Float64(x + Float64(z * Float64(y * x))); else tmp = Float64(x - Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -160000000.0) || ~((y <= 1.95e-5))) tmp = x + (z * (y * x)); else tmp = x - (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -160000000.0], N[Not[LessEqual[y, 1.95e-5]], $MachinePrecision]], N[(x + N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -160000000 \lor \neg \left(y \leq 1.95 \cdot 10^{-5}\right):\\
\;\;\;\;x + z \cdot \left(y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot z\\
\end{array}
\end{array}
if y < -1.6e8 or 1.95e-5 < y Initial program 92.3%
sub-neg92.3%
distribute-rgt-in92.3%
*-un-lft-identity92.3%
distribute-rgt-neg-in92.3%
Applied egg-rr92.3%
Taylor expanded in y around inf 96.6%
*-commutative96.6%
associate-*r*89.0%
Simplified89.0%
if -1.6e8 < y < 1.95e-5Initial program 100.0%
Taylor expanded in y around 0 99.2%
*-commutative99.2%
distribute-rgt-out--99.2%
*-lft-identity99.2%
Simplified99.2%
Final simplification94.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -160000000.0) (not (<= y 1.95e-5))) (+ x (* y (* x z))) (- x (* x z))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -160000000.0) || !(y <= 1.95e-5)) {
tmp = x + (y * (x * z));
} else {
tmp = x - (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 ((y <= (-160000000.0d0)) .or. (.not. (y <= 1.95d-5))) then
tmp = x + (y * (x * z))
else
tmp = x - (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -160000000.0) || !(y <= 1.95e-5)) {
tmp = x + (y * (x * z));
} else {
tmp = x - (x * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -160000000.0) or not (y <= 1.95e-5): tmp = x + (y * (x * z)) else: tmp = x - (x * z) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -160000000.0) || !(y <= 1.95e-5)) tmp = Float64(x + Float64(y * Float64(x * z))); else tmp = Float64(x - Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -160000000.0) || ~((y <= 1.95e-5))) tmp = x + (y * (x * z)); else tmp = x - (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -160000000.0], N[Not[LessEqual[y, 1.95e-5]], $MachinePrecision]], N[(x + N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -160000000 \lor \neg \left(y \leq 1.95 \cdot 10^{-5}\right):\\
\;\;\;\;x + y \cdot \left(x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot z\\
\end{array}
\end{array}
if y < -1.6e8 or 1.95e-5 < y Initial program 92.3%
sub-neg92.3%
distribute-rgt-in92.3%
*-un-lft-identity92.3%
distribute-rgt-neg-in92.3%
Applied egg-rr92.3%
Taylor expanded in y around inf 96.6%
*-commutative96.6%
Simplified96.6%
if -1.6e8 < y < 1.95e-5Initial program 100.0%
Taylor expanded in y around 0 99.2%
*-commutative99.2%
distribute-rgt-out--99.2%
*-lft-identity99.2%
Simplified99.2%
Final simplification98.1%
(FPCore (x y z) :precision binary64 (if (<= z -2.6e+112) (* z (- (* y x) x)) (* x (+ 1.0 (* z (+ y -1.0))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.6e+112) {
tmp = z * ((y * x) - x);
} else {
tmp = x * (1.0 + (z * (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 <= (-2.6d+112)) then
tmp = z * ((y * x) - x)
else
tmp = x * (1.0d0 + (z * (y + (-1.0d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.6e+112) {
tmp = z * ((y * x) - x);
} else {
tmp = x * (1.0 + (z * (y + -1.0)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.6e+112: tmp = z * ((y * x) - x) else: tmp = x * (1.0 + (z * (y + -1.0))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.6e+112) tmp = Float64(z * Float64(Float64(y * x) - x)); else tmp = Float64(x * Float64(1.0 + Float64(z * Float64(y + -1.0)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.6e+112) tmp = z * ((y * x) - x); else tmp = x * (1.0 + (z * (y + -1.0))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.6e+112], N[(z * N[(N[(y * x), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(z * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+112}:\\
\;\;\;\;z \cdot \left(y \cdot x - x\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if z < -2.6000000000000001e112Initial program 87.2%
Taylor expanded in z around inf 99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
distribute-rgt-in99.9%
neg-mul-199.9%
unsub-neg99.9%
Simplified99.9%
if -2.6000000000000001e112 < z Initial program 98.2%
Final simplification98.5%
(FPCore (x y z) :precision binary64 (if (<= x 4e+116) (- x (* z (* x (- 1.0 y)))) (* x (+ 1.0 (* z (+ y -1.0))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 4e+116) {
tmp = x - (z * (x * (1.0 - y)));
} else {
tmp = x * (1.0 + (z * (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 (x <= 4d+116) then
tmp = x - (z * (x * (1.0d0 - y)))
else
tmp = x * (1.0d0 + (z * (y + (-1.0d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 4e+116) {
tmp = x - (z * (x * (1.0 - y)));
} else {
tmp = x * (1.0 + (z * (y + -1.0)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 4e+116: tmp = x - (z * (x * (1.0 - y))) else: tmp = x * (1.0 + (z * (y + -1.0))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 4e+116) tmp = Float64(x - Float64(z * Float64(x * Float64(1.0 - y)))); else tmp = Float64(x * Float64(1.0 + Float64(z * Float64(y + -1.0)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 4e+116) tmp = x - (z * (x * (1.0 - y))); else tmp = x * (1.0 + (z * (y + -1.0))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 4e+116], N[(x - N[(z * N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(z * N[(y + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{+116}:\\
\;\;\;\;x - z \cdot \left(x \cdot \left(1 - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + z \cdot \left(y + -1\right)\right)\\
\end{array}
\end{array}
if x < 4.00000000000000006e116Initial program 95.8%
distribute-rgt-out--95.8%
*-lft-identity95.8%
cancel-sign-sub-inv95.8%
+-commutative95.8%
distribute-lft-neg-in95.8%
associate-*l*98.2%
fma-def98.2%
neg-sub098.2%
associate--r-98.2%
metadata-eval98.2%
+-commutative98.2%
*-commutative98.2%
Simplified98.2%
fma-udef98.2%
associate-*r*98.1%
Applied egg-rr98.1%
if 4.00000000000000006e116 < x Initial program 100.0%
Final simplification98.5%
(FPCore (x y z) :precision binary64 (if (<= x 2.2e+116) (- x (* z (* x (- 1.0 y)))) (- x (* x (* z (- 1.0 y))))))
double code(double x, double y, double z) {
double tmp;
if (x <= 2.2e+116) {
tmp = x - (z * (x * (1.0 - y)));
} else {
tmp = x - (x * (z * (1.0 - 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 (x <= 2.2d+116) then
tmp = x - (z * (x * (1.0d0 - y)))
else
tmp = x - (x * (z * (1.0d0 - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= 2.2e+116) {
tmp = x - (z * (x * (1.0 - y)));
} else {
tmp = x - (x * (z * (1.0 - y)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= 2.2e+116: tmp = x - (z * (x * (1.0 - y))) else: tmp = x - (x * (z * (1.0 - y))) return tmp
function code(x, y, z) tmp = 0.0 if (x <= 2.2e+116) tmp = Float64(x - Float64(z * Float64(x * Float64(1.0 - y)))); else tmp = Float64(x - Float64(x * Float64(z * Float64(1.0 - y)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= 2.2e+116) tmp = x - (z * (x * (1.0 - y))); else tmp = x - (x * (z * (1.0 - y))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, 2.2e+116], N[(x - N[(z * N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2.2 \cdot 10^{+116}:\\
\;\;\;\;x - z \cdot \left(x \cdot \left(1 - y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \left(z \cdot \left(1 - y\right)\right)\\
\end{array}
\end{array}
if x < 2.2e116Initial program 95.8%
distribute-rgt-out--95.8%
*-lft-identity95.8%
cancel-sign-sub-inv95.8%
+-commutative95.8%
distribute-lft-neg-in95.8%
associate-*l*98.2%
fma-def98.2%
neg-sub098.2%
associate--r-98.2%
metadata-eval98.2%
+-commutative98.2%
*-commutative98.2%
Simplified98.2%
fma-udef98.2%
associate-*r*98.1%
Applied egg-rr98.1%
if 2.2e116 < x Initial program 100.0%
sub-neg100.0%
distribute-rgt-in100.0%
*-un-lft-identity100.0%
distribute-rgt-neg-in100.0%
Applied egg-rr100.0%
Final simplification98.5%
(FPCore (x y z) :precision binary64 (if (<= y -5.8e+154) (* y (* x z)) (if (<= y 1.75e+22) (- x (* x z)) (* z (* y x)))))
double code(double x, double y, double z) {
double tmp;
if (y <= -5.8e+154) {
tmp = y * (x * z);
} else if (y <= 1.75e+22) {
tmp = x - (x * z);
} else {
tmp = z * (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 (y <= (-5.8d+154)) then
tmp = y * (x * z)
else if (y <= 1.75d+22) then
tmp = x - (x * z)
else
tmp = z * (y * x)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -5.8e+154) {
tmp = y * (x * z);
} else if (y <= 1.75e+22) {
tmp = x - (x * z);
} else {
tmp = z * (y * x);
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -5.8e+154: tmp = y * (x * z) elif y <= 1.75e+22: tmp = x - (x * z) else: tmp = z * (y * x) return tmp
function code(x, y, z) tmp = 0.0 if (y <= -5.8e+154) tmp = Float64(y * Float64(x * z)); elseif (y <= 1.75e+22) tmp = Float64(x - Float64(x * z)); else tmp = Float64(z * Float64(y * x)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -5.8e+154) tmp = y * (x * z); elseif (y <= 1.75e+22) tmp = x - (x * z); else tmp = z * (y * x); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -5.8e+154], N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e+22], N[(x - N[(x * z), $MachinePrecision]), $MachinePrecision], N[(z * N[(y * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+154}:\\
\;\;\;\;y \cdot \left(x \cdot z\right)\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+22}:\\
\;\;\;\;x - x \cdot z\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y \cdot x\right)\\
\end{array}
\end{array}
if y < -5.79999999999999959e154Initial program 89.5%
Taylor expanded in y around inf 99.6%
if -5.79999999999999959e154 < y < 1.75e22Initial program 100.0%
Taylor expanded in y around 0 93.0%
*-commutative93.0%
distribute-rgt-out--93.0%
*-lft-identity93.0%
Simplified93.0%
if 1.75e22 < y Initial program 88.9%
Taylor expanded in y around inf 77.1%
*-commutative77.1%
associate-*r*77.9%
*-commutative77.9%
Simplified77.9%
Final simplification89.9%
(FPCore (x y z) :precision binary64 (if (or (<= z -1.0) (not (<= z 1900.0))) (* x (- z)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -1.0) || !(z <= 1900.0)) {
tmp = x * -z;
} 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 <= 1900.0d0))) then
tmp = x * -z
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 <= 1900.0)) {
tmp = x * -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -1.0) or not (z <= 1900.0): tmp = x * -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -1.0) || !(z <= 1900.0)) tmp = Float64(x * Float64(-z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -1.0) || ~((z <= 1900.0))) tmp = x * -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -1.0], N[Not[LessEqual[z, 1900.0]], $MachinePrecision]], N[(x * (-z)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1900\right):\\
\;\;\;\;x \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1 or 1900 < z Initial program 93.1%
Taylor expanded in z around inf 99.4%
*-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
distribute-rgt-in99.4%
neg-mul-199.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in y around 0 58.3%
neg-mul-158.3%
Simplified58.3%
if -1 < z < 1900Initial program 99.9%
Taylor expanded in z around 0 79.9%
Final simplification69.4%
(FPCore (x y z) :precision binary64 (if (<= z -7.5e+176) (* x z) (if (<= z 1.25e+47) x (* x z))))
double code(double x, double y, double z) {
double tmp;
if (z <= -7.5e+176) {
tmp = x * z;
} else if (z <= 1.25e+47) {
tmp = x;
} else {
tmp = 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 <= (-7.5d+176)) then
tmp = x * z
else if (z <= 1.25d+47) then
tmp = x
else
tmp = x * z
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -7.5e+176) {
tmp = x * z;
} else if (z <= 1.25e+47) {
tmp = x;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -7.5e+176: tmp = x * z elif z <= 1.25e+47: tmp = x else: tmp = x * z return tmp
function code(x, y, z) tmp = 0.0 if (z <= -7.5e+176) tmp = Float64(x * z); elseif (z <= 1.25e+47) tmp = x; else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -7.5e+176) tmp = x * z; elseif (z <= 1.25e+47) tmp = x; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -7.5e+176], N[(x * z), $MachinePrecision], If[LessEqual[z, 1.25e+47], x, N[(x * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+176}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+47}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if z < -7.499999999999999e176 or 1.25000000000000005e47 < z Initial program 91.7%
Taylor expanded in z around inf 99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
distribute-rgt-in99.9%
neg-mul-199.9%
unsub-neg99.9%
Simplified99.9%
sub-neg99.9%
flip-+61.8%
pow261.8%
Applied egg-rr61.8%
clear-num61.7%
un-div-inv61.6%
clear-num61.7%
unpow261.7%
sqr-neg61.7%
sub-neg61.7%
remove-double-neg61.7%
flip--99.8%
sub-neg99.8%
fma-def99.8%
add-sqr-sqrt38.3%
sqrt-prod55.1%
sqr-neg55.1%
sqrt-prod29.8%
add-sqr-sqrt46.3%
Applied egg-rr46.3%
Taylor expanded in y around 0 13.8%
if -7.499999999999999e176 < z < 1.25000000000000005e47Initial program 99.4%
Taylor expanded in z around 0 64.9%
Final simplification46.7%
(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 96.6%
Taylor expanded in z around 0 42.8%
Final simplification42.8%
(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 2023228
(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))))