
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* y z))))
double code(double x, double y, double z) {
return x * (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 - (y * z))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - (y * z));
}
def code(x, y, z): return x * (1.0 - (y * z))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(y * z))) end
function tmp = code(x, y, z) tmp = x * (1.0 - (y * z)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - y \cdot z\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (* x (- 1.0 (* y z))))
double code(double x, double y, double z) {
return x * (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 - (y * z))
end function
public static double code(double x, double y, double z) {
return x * (1.0 - (y * z));
}
def code(x, y, z): return x * (1.0 - (y * z))
function code(x, y, z) return Float64(x * Float64(1.0 - Float64(y * z))) end
function tmp = code(x, y, z) tmp = x * (1.0 - (y * z)); end
code[x_, y_, z_] := N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - y \cdot z\right)
\end{array}
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= (* y z) -5e+231) (not (<= (* y z) 2e+222))) (* z (* y (- x))) (- x (* x (* y z)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (((y * z) <= -5e+231) || !((y * z) <= 2e+222)) {
tmp = z * (y * -x);
} else {
tmp = x - (x * (y * z));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
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 * z) <= (-5d+231)) .or. (.not. ((y * z) <= 2d+222))) then
tmp = z * (y * -x)
else
tmp = x - (x * (y * z))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if (((y * z) <= -5e+231) || !((y * z) <= 2e+222)) {
tmp = z * (y * -x);
} else {
tmp = x - (x * (y * z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if ((y * z) <= -5e+231) or not ((y * z) <= 2e+222): tmp = z * (y * -x) else: tmp = x - (x * (y * z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if ((Float64(y * z) <= -5e+231) || !(Float64(y * z) <= 2e+222)) tmp = Float64(z * Float64(y * Float64(-x))); else tmp = Float64(x - Float64(x * Float64(y * z))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (((y * z) <= -5e+231) || ~(((y * z) <= 2e+222)))
tmp = z * (y * -x);
else
tmp = x - (x * (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[Or[LessEqual[N[(y * z), $MachinePrecision], -5e+231], N[Not[LessEqual[N[(y * z), $MachinePrecision], 2e+222]], $MachinePrecision]], N[(z * N[(y * (-x)), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot z \leq -5 \cdot 10^{+231} \lor \neg \left(y \cdot z \leq 2 \cdot 10^{+222}\right):\\
\;\;\;\;z \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 y z) < -5.00000000000000028e231 or 2.0000000000000001e222 < (*.f64 y z) Initial program 75.6%
sub-neg75.6%
distribute-rgt-in75.6%
*-un-lft-identity75.6%
distribute-rgt-neg-in75.6%
Applied egg-rr75.6%
Taylor expanded in z around inf 99.8%
+-commutative99.8%
mul-1-neg99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
mul-1-neg99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
Simplified99.8%
if -5.00000000000000028e231 < (*.f64 y z) < 2.0000000000000001e222Initial program 99.8%
sub-neg99.8%
distribute-rgt-in99.8%
*-un-lft-identity99.8%
distribute-rgt-neg-in99.8%
Applied egg-rr99.8%
associate-*l*93.0%
add-sqr-sqrt50.0%
sqrt-unprod68.6%
sqr-neg68.6%
sqrt-unprod28.1%
add-sqr-sqrt60.0%
cancel-sign-sub-inv60.0%
associate-*l*61.0%
distribute-rgt-neg-out61.0%
distribute-lft-neg-in61.0%
associate-*r*60.0%
add-sqr-sqrt28.1%
sqrt-unprod68.6%
sqr-neg68.6%
sqrt-unprod50.0%
add-sqr-sqrt93.0%
Applied egg-rr93.0%
Taylor expanded in y around 0 99.8%
Final simplification99.8%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= (* y z) -5e+231) (not (<= (* y z) 2e+222))) (* z (* y (- x))) (* x (- 1.0 (* y z)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (((y * z) <= -5e+231) || !((y * z) <= 2e+222)) {
tmp = z * (y * -x);
} else {
tmp = x * (1.0 - (y * z));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
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 * z) <= (-5d+231)) .or. (.not. ((y * z) <= 2d+222))) then
tmp = z * (y * -x)
else
tmp = x * (1.0d0 - (y * z))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if (((y * z) <= -5e+231) || !((y * z) <= 2e+222)) {
tmp = z * (y * -x);
} else {
tmp = x * (1.0 - (y * z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if ((y * z) <= -5e+231) or not ((y * z) <= 2e+222): tmp = z * (y * -x) else: tmp = x * (1.0 - (y * z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if ((Float64(y * z) <= -5e+231) || !(Float64(y * z) <= 2e+222)) tmp = Float64(z * Float64(y * Float64(-x))); else tmp = Float64(x * Float64(1.0 - Float64(y * z))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (((y * z) <= -5e+231) || ~(((y * z) <= 2e+222)))
tmp = z * (y * -x);
else
tmp = x * (1.0 - (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[Or[LessEqual[N[(y * z), $MachinePrecision], -5e+231], N[Not[LessEqual[N[(y * z), $MachinePrecision], 2e+222]], $MachinePrecision]], N[(z * N[(y * (-x)), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot z \leq -5 \cdot 10^{+231} \lor \neg \left(y \cdot z \leq 2 \cdot 10^{+222}\right):\\
\;\;\;\;z \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y \cdot z\right)\\
\end{array}
\end{array}
if (*.f64 y z) < -5.00000000000000028e231 or 2.0000000000000001e222 < (*.f64 y z) Initial program 75.6%
sub-neg75.6%
distribute-rgt-in75.6%
*-un-lft-identity75.6%
distribute-rgt-neg-in75.6%
Applied egg-rr75.6%
Taylor expanded in z around inf 99.8%
+-commutative99.8%
mul-1-neg99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
mul-1-neg99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
Simplified99.8%
if -5.00000000000000028e231 < (*.f64 y z) < 2.0000000000000001e222Initial program 99.8%
Final simplification99.8%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= y -6.5e+63) (not (<= y 6.8e-105))) (* z (* y (- x))) x))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if ((y <= -6.5e+63) || !(y <= 6.8e-105)) {
tmp = z * (y * -x);
} else {
tmp = x;
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
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 <= (-6.5d+63)) .or. (.not. (y <= 6.8d-105))) then
tmp = z * (y * -x)
else
tmp = x
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -6.5e+63) || !(y <= 6.8e-105)) {
tmp = z * (y * -x);
} else {
tmp = x;
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if (y <= -6.5e+63) or not (y <= 6.8e-105): tmp = z * (y * -x) else: tmp = x return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if ((y <= -6.5e+63) || !(y <= 6.8e-105)) tmp = Float64(z * Float64(y * Float64(-x))); else tmp = x; end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((y <= -6.5e+63) || ~((y <= 6.8e-105)))
tmp = z * (y * -x);
else
tmp = x;
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[Or[LessEqual[y, -6.5e+63], N[Not[LessEqual[y, 6.8e-105]], $MachinePrecision]], N[(z * N[(y * (-x)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+63} \lor \neg \left(y \leq 6.8 \cdot 10^{-105}\right):\\
\;\;\;\;z \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -6.49999999999999992e63 or 6.79999999999999984e-105 < y Initial program 89.6%
sub-neg89.6%
distribute-rgt-in89.7%
*-un-lft-identity89.7%
distribute-rgt-neg-in89.7%
Applied egg-rr89.7%
Taylor expanded in z around inf 90.7%
+-commutative90.7%
mul-1-neg90.7%
unsub-neg90.7%
Simplified90.7%
Taylor expanded in z around inf 69.7%
mul-1-neg69.7%
*-commutative69.7%
distribute-rgt-neg-in69.7%
Simplified69.7%
if -6.49999999999999992e63 < y < 6.79999999999999984e-105Initial program 99.9%
Taylor expanded in y around 0 69.8%
Final simplification69.8%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (or (<= y -5.8e+65) (not (<= y 6.8e-105))) (* x (* y (- z))) x))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if ((y <= -5.8e+65) || !(y <= 6.8e-105)) {
tmp = x * (y * -z);
} else {
tmp = x;
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
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+65)) .or. (.not. (y <= 6.8d-105))) then
tmp = x * (y * -z)
else
tmp = x
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -5.8e+65) || !(y <= 6.8e-105)) {
tmp = x * (y * -z);
} else {
tmp = x;
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if (y <= -5.8e+65) or not (y <= 6.8e-105): tmp = x * (y * -z) else: tmp = x return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if ((y <= -5.8e+65) || !(y <= 6.8e-105)) tmp = Float64(x * Float64(y * Float64(-z))); else tmp = x; end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if ((y <= -5.8e+65) || ~((y <= 6.8e-105)))
tmp = x * (y * -z);
else
tmp = x;
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[Or[LessEqual[y, -5.8e+65], N[Not[LessEqual[y, 6.8e-105]], $MachinePrecision]], N[(x * N[(y * (-z)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+65} \lor \neg \left(y \leq 6.8 \cdot 10^{-105}\right):\\
\;\;\;\;x \cdot \left(y \cdot \left(-z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -5.8000000000000001e65 or 6.79999999999999984e-105 < y Initial program 89.6%
Taylor expanded in y around inf 61.9%
mul-1-neg61.9%
distribute-rgt-neg-out61.9%
Simplified61.9%
if -5.8000000000000001e65 < y < 6.79999999999999984e-105Initial program 99.9%
Taylor expanded in y around 0 69.8%
Final simplification65.8%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y -3.3e+66) (* z (* y (- x))) (if (<= y 6.8e-105) x (* (- y) (* x z)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -3.3e+66) {
tmp = z * (y * -x);
} else if (y <= 6.8e-105) {
tmp = x;
} else {
tmp = -y * (x * z);
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-3.3d+66)) then
tmp = z * (y * -x)
else if (y <= 6.8d-105) then
tmp = x
else
tmp = -y * (x * z)
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if (y <= -3.3e+66) {
tmp = z * (y * -x);
} else if (y <= 6.8e-105) {
tmp = x;
} else {
tmp = -y * (x * z);
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -3.3e+66: tmp = z * (y * -x) elif y <= 6.8e-105: tmp = x else: tmp = -y * (x * z) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -3.3e+66) tmp = Float64(z * Float64(y * Float64(-x))); elseif (y <= 6.8e-105) tmp = x; else tmp = Float64(Float64(-y) * Float64(x * z)); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= -3.3e+66)
tmp = z * (y * -x);
elseif (y <= 6.8e-105)
tmp = x;
else
tmp = -y * (x * z);
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, -3.3e+66], N[(z * N[(y * (-x)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e-105], x, N[((-y) * N[(x * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{+66}:\\
\;\;\;\;z \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-105}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) \cdot \left(x \cdot z\right)\\
\end{array}
\end{array}
if y < -3.3000000000000001e66Initial program 91.6%
sub-neg91.6%
distribute-rgt-in91.6%
*-un-lft-identity91.6%
distribute-rgt-neg-in91.6%
Applied egg-rr91.6%
Taylor expanded in z around inf 95.5%
+-commutative95.5%
mul-1-neg95.5%
unsub-neg95.5%
Simplified95.5%
Taylor expanded in z around inf 81.4%
mul-1-neg81.4%
*-commutative81.4%
distribute-rgt-neg-in81.4%
Simplified81.4%
if -3.3000000000000001e66 < y < 6.79999999999999984e-105Initial program 99.9%
Taylor expanded in y around 0 69.8%
if 6.79999999999999984e-105 < y Initial program 88.6%
Taylor expanded in y around inf 55.5%
mul-1-neg55.5%
*-commutative55.5%
associate-*r*65.4%
distribute-rgt-neg-in65.4%
Simplified65.4%
Final simplification70.5%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y -1.1e+102) (* (+ z (/ -1.0 y)) (* y (- x))) (- x (* x (* y z)))))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -1.1e+102) {
tmp = (z + (-1.0 / y)) * (y * -x);
} else {
tmp = x - (x * (y * z));
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
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.1d+102)) then
tmp = (z + ((-1.0d0) / y)) * (y * -x)
else
tmp = x - (x * (y * z))
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.1e+102) {
tmp = (z + (-1.0 / y)) * (y * -x);
} else {
tmp = x - (x * (y * z));
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -1.1e+102: tmp = (z + (-1.0 / y)) * (y * -x) else: tmp = x - (x * (y * z)) return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -1.1e+102) tmp = Float64(Float64(z + Float64(-1.0 / y)) * Float64(y * Float64(-x))); else tmp = Float64(x - Float64(x * Float64(y * z))); end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= -1.1e+102)
tmp = (z + (-1.0 / y)) * (y * -x);
else
tmp = x - (x * (y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, -1.1e+102], N[(N[(z + N[(-1.0 / y), $MachinePrecision]), $MachinePrecision] * N[(y * (-x)), $MachinePrecision]), $MachinePrecision], N[(x - N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+102}:\\
\;\;\;\;\left(z + \frac{-1}{y}\right) \cdot \left(y \cdot \left(-x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - x \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if y < -1.10000000000000004e102Initial program 90.0%
Taylor expanded in y around inf 85.3%
Taylor expanded in x around -inf 90.1%
mul-1-neg90.1%
associate-*r*99.7%
distribute-lft-neg-in99.7%
distribute-rgt-neg-in99.7%
sub-neg99.7%
distribute-neg-frac99.7%
metadata-eval99.7%
Simplified99.7%
if -1.10000000000000004e102 < y Initial program 95.5%
sub-neg95.5%
distribute-rgt-in95.6%
*-un-lft-identity95.6%
distribute-rgt-neg-in95.6%
Applied egg-rr95.6%
associate-*l*95.5%
add-sqr-sqrt59.8%
sqrt-unprod72.4%
sqr-neg72.4%
sqrt-unprod24.5%
add-sqr-sqrt54.3%
cancel-sign-sub-inv54.3%
associate-*l*55.2%
distribute-rgt-neg-out55.2%
distribute-lft-neg-in55.2%
associate-*r*54.3%
add-sqr-sqrt24.5%
sqrt-unprod72.4%
sqr-neg72.4%
sqrt-unprod59.8%
add-sqr-sqrt95.5%
Applied egg-rr95.5%
Taylor expanded in y around 0 95.6%
Final simplification96.2%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y -1.7e+168) (/ (* y x) y) x))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -1.7e+168) {
tmp = (y * x) / y;
} else {
tmp = x;
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
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.7d+168)) then
tmp = (y * x) / y
else
tmp = x
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.7e+168) {
tmp = (y * x) / y;
} else {
tmp = x;
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -1.7e+168: tmp = (y * x) / y else: tmp = x return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -1.7e+168) tmp = Float64(Float64(y * x) / y); else tmp = x; end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= -1.7e+168)
tmp = (y * x) / y;
else
tmp = x;
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, -1.7e+168], N[(N[(y * x), $MachinePrecision] / y), $MachinePrecision], x]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{+168}:\\
\;\;\;\;\frac{y \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.70000000000000001e168Initial program 93.7%
Taylor expanded in y around inf 84.6%
Taylor expanded in z around 0 6.6%
associate-*r/34.9%
Applied egg-rr34.9%
if -1.70000000000000001e168 < y Initial program 94.8%
Taylor expanded in y around 0 54.9%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 (if (<= y -1.2e+102) (/ (* x z) z) x))
assert(x < y && y < z);
double code(double x, double y, double z) {
double tmp;
if (y <= -1.2e+102) {
tmp = (x * z) / z;
} else {
tmp = x;
}
return tmp;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
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+102)) then
tmp = (x * z) / z
else
tmp = x
end if
code = tmp
end function
assert x < y && y < z;
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.2e+102) {
tmp = (x * z) / z;
} else {
tmp = x;
}
return tmp;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): tmp = 0 if y <= -1.2e+102: tmp = (x * z) / z else: tmp = x return tmp
x, y, z = sort([x, y, z]) function code(x, y, z) tmp = 0.0 if (y <= -1.2e+102) tmp = Float64(Float64(x * z) / z); else tmp = x; end return tmp end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (y <= -1.2e+102)
tmp = (x * z) / z;
else
tmp = x;
end
tmp_2 = tmp;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := If[LessEqual[y, -1.2e+102], N[(N[(x * z), $MachinePrecision] / z), $MachinePrecision], x]
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+102}:\\
\;\;\;\;\frac{x \cdot z}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.19999999999999997e102Initial program 90.0%
sub-neg90.0%
distribute-rgt-in90.0%
*-un-lft-identity90.0%
distribute-rgt-neg-in90.0%
Applied egg-rr90.0%
Taylor expanded in z around inf 97.1%
+-commutative97.1%
mul-1-neg97.1%
unsub-neg97.1%
Simplified97.1%
Taylor expanded in z around 0 13.8%
*-commutative13.8%
associate-*l/15.6%
Applied egg-rr15.6%
if -1.19999999999999997e102 < y Initial program 95.5%
Taylor expanded in y around 0 56.4%
NOTE: x, y, and z should be sorted in increasing order before calling this function. (FPCore (x y z) :precision binary64 x)
assert(x < y && y < z);
double code(double x, double y, double z) {
return x;
}
NOTE: x, y, and z should be sorted in increasing order before calling this function.
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
assert x < y && y < z;
public static double code(double x, double y, double z) {
return x;
}
[x, y, z] = sort([x, y, z]) def code(x, y, z): return x
x, y, z = sort([x, y, z]) function code(x, y, z) return x end
x, y, z = num2cell(sort([x, y, z])){:}
function tmp = code(x, y, z)
tmp = x;
end
NOTE: x, y, and z should be sorted in increasing order before calling this function. code[x_, y_, z_] := x
\begin{array}{l}
[x, y, z] = \mathsf{sort}([x, y, z])\\
\\
x
\end{array}
Initial program 94.7%
Taylor expanded in y around 0 49.5%
herbie shell --seed 2024170
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSV:hsv from colour-2.3.3, I"
:precision binary64
(* x (- 1.0 (* y z))))