
(FPCore (f n) :precision binary64 (/ (- (+ f n)) (- f n)))
double code(double f, double n) {
return -(f + n) / (f - n);
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
code = -(f + n) / (f - n)
end function
public static double code(double f, double n) {
return -(f + n) / (f - n);
}
def code(f, n): return -(f + n) / (f - n)
function code(f, n) return Float64(Float64(-Float64(f + n)) / Float64(f - n)) end
function tmp = code(f, n) tmp = -(f + n) / (f - n); end
code[f_, n_] := N[((-N[(f + n), $MachinePrecision]) / N[(f - n), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-\left(f + n\right)}{f - n}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (f n) :precision binary64 (/ (- (+ f n)) (- f n)))
double code(double f, double n) {
return -(f + n) / (f - n);
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
code = -(f + n) / (f - n)
end function
public static double code(double f, double n) {
return -(f + n) / (f - n);
}
def code(f, n): return -(f + n) / (f - n)
function code(f, n) return Float64(Float64(-Float64(f + n)) / Float64(f - n)) end
function tmp = code(f, n) tmp = -(f + n) / (f - n); end
code[f_, n_] := N[((-N[(f + n), $MachinePrecision]) / N[(f - n), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-\left(f + n\right)}{f - n}
\end{array}
(FPCore (f n) :precision binary64 (/ (+ f n) (- n f)))
double code(double f, double n) {
return (f + n) / (n - f);
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
code = (f + n) / (n - f)
end function
public static double code(double f, double n) {
return (f + n) / (n - f);
}
def code(f, n): return (f + n) / (n - f)
function code(f, n) return Float64(Float64(f + n) / Float64(n - f)) end
function tmp = code(f, n) tmp = (f + n) / (n - f); end
code[f_, n_] := N[(N[(f + n), $MachinePrecision] / N[(n - f), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{f + n}{n - f}
\end{array}
Initial program 99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
(FPCore (f n) :precision binary64 (if (or (<= n -6.2e+48) (not (<= n 4.4e-36))) (+ 1.0 (* 2.0 (/ f n))) (+ (* -2.0 (/ n f)) -1.0)))
double code(double f, double n) {
double tmp;
if ((n <= -6.2e+48) || !(n <= 4.4e-36)) {
tmp = 1.0 + (2.0 * (f / n));
} else {
tmp = (-2.0 * (n / f)) + -1.0;
}
return tmp;
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-6.2d+48)) .or. (.not. (n <= 4.4d-36))) then
tmp = 1.0d0 + (2.0d0 * (f / n))
else
tmp = ((-2.0d0) * (n / f)) + (-1.0d0)
end if
code = tmp
end function
public static double code(double f, double n) {
double tmp;
if ((n <= -6.2e+48) || !(n <= 4.4e-36)) {
tmp = 1.0 + (2.0 * (f / n));
} else {
tmp = (-2.0 * (n / f)) + -1.0;
}
return tmp;
}
def code(f, n): tmp = 0 if (n <= -6.2e+48) or not (n <= 4.4e-36): tmp = 1.0 + (2.0 * (f / n)) else: tmp = (-2.0 * (n / f)) + -1.0 return tmp
function code(f, n) tmp = 0.0 if ((n <= -6.2e+48) || !(n <= 4.4e-36)) tmp = Float64(1.0 + Float64(2.0 * Float64(f / n))); else tmp = Float64(Float64(-2.0 * Float64(n / f)) + -1.0); end return tmp end
function tmp_2 = code(f, n) tmp = 0.0; if ((n <= -6.2e+48) || ~((n <= 4.4e-36))) tmp = 1.0 + (2.0 * (f / n)); else tmp = (-2.0 * (n / f)) + -1.0; end tmp_2 = tmp; end
code[f_, n_] := If[Or[LessEqual[n, -6.2e+48], N[Not[LessEqual[n, 4.4e-36]], $MachinePrecision]], N[(1.0 + N[(2.0 * N[(f / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 * N[(n / f), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -6.2 \cdot 10^{+48} \lor \neg \left(n \leq 4.4 \cdot 10^{-36}\right):\\
\;\;\;\;1 + 2 \cdot \frac{f}{n}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{n}{f} + -1\\
\end{array}
\end{array}
if n < -6.20000000000000011e48 or 4.3999999999999999e-36 < n Initial program 100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in f around 0 77.2%
if -6.20000000000000011e48 < n < 4.3999999999999999e-36Initial program 99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in n around 0 82.6%
Final simplification79.9%
(FPCore (f n) :precision binary64 (if (or (<= n -2.8e+49) (not (<= n 4.2e-36))) (+ 1.0 (* 2.0 (/ f n))) (/ (+ f n) (- f))))
double code(double f, double n) {
double tmp;
if ((n <= -2.8e+49) || !(n <= 4.2e-36)) {
tmp = 1.0 + (2.0 * (f / n));
} else {
tmp = (f + n) / -f;
}
return tmp;
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-2.8d+49)) .or. (.not. (n <= 4.2d-36))) then
tmp = 1.0d0 + (2.0d0 * (f / n))
else
tmp = (f + n) / -f
end if
code = tmp
end function
public static double code(double f, double n) {
double tmp;
if ((n <= -2.8e+49) || !(n <= 4.2e-36)) {
tmp = 1.0 + (2.0 * (f / n));
} else {
tmp = (f + n) / -f;
}
return tmp;
}
def code(f, n): tmp = 0 if (n <= -2.8e+49) or not (n <= 4.2e-36): tmp = 1.0 + (2.0 * (f / n)) else: tmp = (f + n) / -f return tmp
function code(f, n) tmp = 0.0 if ((n <= -2.8e+49) || !(n <= 4.2e-36)) tmp = Float64(1.0 + Float64(2.0 * Float64(f / n))); else tmp = Float64(Float64(f + n) / Float64(-f)); end return tmp end
function tmp_2 = code(f, n) tmp = 0.0; if ((n <= -2.8e+49) || ~((n <= 4.2e-36))) tmp = 1.0 + (2.0 * (f / n)); else tmp = (f + n) / -f; end tmp_2 = tmp; end
code[f_, n_] := If[Or[LessEqual[n, -2.8e+49], N[Not[LessEqual[n, 4.2e-36]], $MachinePrecision]], N[(1.0 + N[(2.0 * N[(f / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(f + n), $MachinePrecision] / (-f)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.8 \cdot 10^{+49} \lor \neg \left(n \leq 4.2 \cdot 10^{-36}\right):\\
\;\;\;\;1 + 2 \cdot \frac{f}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{f + n}{-f}\\
\end{array}
\end{array}
if n < -2.7999999999999998e49 or 4.19999999999999982e-36 < n Initial program 100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in f around 0 77.2%
if -2.7999999999999998e49 < n < 4.19999999999999982e-36Initial program 99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in n around 0 81.0%
neg-mul-181.0%
Simplified81.0%
Final simplification79.1%
(FPCore (f n) :precision binary64 (if (<= n -2.4e+49) (+ 1.0 (/ f n)) (if (<= n 4.4e-36) (/ (+ f n) (- f)) (/ n (- n f)))))
double code(double f, double n) {
double tmp;
if (n <= -2.4e+49) {
tmp = 1.0 + (f / n);
} else if (n <= 4.4e-36) {
tmp = (f + n) / -f;
} else {
tmp = n / (n - f);
}
return tmp;
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-2.4d+49)) then
tmp = 1.0d0 + (f / n)
else if (n <= 4.4d-36) then
tmp = (f + n) / -f
else
tmp = n / (n - f)
end if
code = tmp
end function
public static double code(double f, double n) {
double tmp;
if (n <= -2.4e+49) {
tmp = 1.0 + (f / n);
} else if (n <= 4.4e-36) {
tmp = (f + n) / -f;
} else {
tmp = n / (n - f);
}
return tmp;
}
def code(f, n): tmp = 0 if n <= -2.4e+49: tmp = 1.0 + (f / n) elif n <= 4.4e-36: tmp = (f + n) / -f else: tmp = n / (n - f) return tmp
function code(f, n) tmp = 0.0 if (n <= -2.4e+49) tmp = Float64(1.0 + Float64(f / n)); elseif (n <= 4.4e-36) tmp = Float64(Float64(f + n) / Float64(-f)); else tmp = Float64(n / Float64(n - f)); end return tmp end
function tmp_2 = code(f, n) tmp = 0.0; if (n <= -2.4e+49) tmp = 1.0 + (f / n); elseif (n <= 4.4e-36) tmp = (f + n) / -f; else tmp = n / (n - f); end tmp_2 = tmp; end
code[f_, n_] := If[LessEqual[n, -2.4e+49], N[(1.0 + N[(f / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 4.4e-36], N[(N[(f + n), $MachinePrecision] / (-f)), $MachinePrecision], N[(n / N[(n - f), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -2.4 \cdot 10^{+49}:\\
\;\;\;\;1 + \frac{f}{n}\\
\mathbf{elif}\;n \leq 4.4 \cdot 10^{-36}:\\
\;\;\;\;\frac{f + n}{-f}\\
\mathbf{else}:\\
\;\;\;\;\frac{n}{n - f}\\
\end{array}
\end{array}
if n < -2.4e49Initial program 99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in f around 0 82.5%
Taylor expanded in n around inf 82.6%
if -2.4e49 < n < 4.3999999999999999e-36Initial program 99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in n around 0 81.0%
neg-mul-181.0%
Simplified81.0%
if 4.3999999999999999e-36 < n Initial program 100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in f around 0 72.4%
(FPCore (f n) :precision binary64 (if (or (<= n -4.8e+51) (not (<= n 4.4e-36))) (+ 1.0 (/ f n)) (/ f (- n f))))
double code(double f, double n) {
double tmp;
if ((n <= -4.8e+51) || !(n <= 4.4e-36)) {
tmp = 1.0 + (f / n);
} else {
tmp = f / (n - f);
}
return tmp;
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-4.8d+51)) .or. (.not. (n <= 4.4d-36))) then
tmp = 1.0d0 + (f / n)
else
tmp = f / (n - f)
end if
code = tmp
end function
public static double code(double f, double n) {
double tmp;
if ((n <= -4.8e+51) || !(n <= 4.4e-36)) {
tmp = 1.0 + (f / n);
} else {
tmp = f / (n - f);
}
return tmp;
}
def code(f, n): tmp = 0 if (n <= -4.8e+51) or not (n <= 4.4e-36): tmp = 1.0 + (f / n) else: tmp = f / (n - f) return tmp
function code(f, n) tmp = 0.0 if ((n <= -4.8e+51) || !(n <= 4.4e-36)) tmp = Float64(1.0 + Float64(f / n)); else tmp = Float64(f / Float64(n - f)); end return tmp end
function tmp_2 = code(f, n) tmp = 0.0; if ((n <= -4.8e+51) || ~((n <= 4.4e-36))) tmp = 1.0 + (f / n); else tmp = f / (n - f); end tmp_2 = tmp; end
code[f_, n_] := If[Or[LessEqual[n, -4.8e+51], N[Not[LessEqual[n, 4.4e-36]], $MachinePrecision]], N[(1.0 + N[(f / n), $MachinePrecision]), $MachinePrecision], N[(f / N[(n - f), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -4.8 \cdot 10^{+51} \lor \neg \left(n \leq 4.4 \cdot 10^{-36}\right):\\
\;\;\;\;1 + \frac{f}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{f}{n - f}\\
\end{array}
\end{array}
if n < -4.7999999999999997e51 or 4.3999999999999999e-36 < n Initial program 100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in f around 0 76.9%
Taylor expanded in n around inf 76.9%
if -4.7999999999999997e51 < n < 4.3999999999999999e-36Initial program 99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in f around inf 80.5%
Final simplification78.7%
(FPCore (f n) :precision binary64 (if (or (<= n -4e+52) (not (<= n 4.4e-36))) (+ 1.0 (/ f n)) -1.0))
double code(double f, double n) {
double tmp;
if ((n <= -4e+52) || !(n <= 4.4e-36)) {
tmp = 1.0 + (f / n);
} else {
tmp = -1.0;
}
return tmp;
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
real(8) :: tmp
if ((n <= (-4d+52)) .or. (.not. (n <= 4.4d-36))) then
tmp = 1.0d0 + (f / n)
else
tmp = -1.0d0
end if
code = tmp
end function
public static double code(double f, double n) {
double tmp;
if ((n <= -4e+52) || !(n <= 4.4e-36)) {
tmp = 1.0 + (f / n);
} else {
tmp = -1.0;
}
return tmp;
}
def code(f, n): tmp = 0 if (n <= -4e+52) or not (n <= 4.4e-36): tmp = 1.0 + (f / n) else: tmp = -1.0 return tmp
function code(f, n) tmp = 0.0 if ((n <= -4e+52) || !(n <= 4.4e-36)) tmp = Float64(1.0 + Float64(f / n)); else tmp = -1.0; end return tmp end
function tmp_2 = code(f, n) tmp = 0.0; if ((n <= -4e+52) || ~((n <= 4.4e-36))) tmp = 1.0 + (f / n); else tmp = -1.0; end tmp_2 = tmp; end
code[f_, n_] := If[Or[LessEqual[n, -4e+52], N[Not[LessEqual[n, 4.4e-36]], $MachinePrecision]], N[(1.0 + N[(f / n), $MachinePrecision]), $MachinePrecision], -1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -4 \cdot 10^{+52} \lor \neg \left(n \leq 4.4 \cdot 10^{-36}\right):\\
\;\;\;\;1 + \frac{f}{n}\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if n < -4e52 or 4.3999999999999999e-36 < n Initial program 100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in f around 0 76.9%
Taylor expanded in n around inf 76.9%
if -4e52 < n < 4.3999999999999999e-36Initial program 99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in f around inf 80.1%
Final simplification78.5%
(FPCore (f n) :precision binary64 (if (<= n -3.2e+52) (+ 1.0 (/ f n)) (if (<= n 4.4e-36) (/ f (- n f)) (/ n (- n f)))))
double code(double f, double n) {
double tmp;
if (n <= -3.2e+52) {
tmp = 1.0 + (f / n);
} else if (n <= 4.4e-36) {
tmp = f / (n - f);
} else {
tmp = n / (n - f);
}
return tmp;
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-3.2d+52)) then
tmp = 1.0d0 + (f / n)
else if (n <= 4.4d-36) then
tmp = f / (n - f)
else
tmp = n / (n - f)
end if
code = tmp
end function
public static double code(double f, double n) {
double tmp;
if (n <= -3.2e+52) {
tmp = 1.0 + (f / n);
} else if (n <= 4.4e-36) {
tmp = f / (n - f);
} else {
tmp = n / (n - f);
}
return tmp;
}
def code(f, n): tmp = 0 if n <= -3.2e+52: tmp = 1.0 + (f / n) elif n <= 4.4e-36: tmp = f / (n - f) else: tmp = n / (n - f) return tmp
function code(f, n) tmp = 0.0 if (n <= -3.2e+52) tmp = Float64(1.0 + Float64(f / n)); elseif (n <= 4.4e-36) tmp = Float64(f / Float64(n - f)); else tmp = Float64(n / Float64(n - f)); end return tmp end
function tmp_2 = code(f, n) tmp = 0.0; if (n <= -3.2e+52) tmp = 1.0 + (f / n); elseif (n <= 4.4e-36) tmp = f / (n - f); else tmp = n / (n - f); end tmp_2 = tmp; end
code[f_, n_] := If[LessEqual[n, -3.2e+52], N[(1.0 + N[(f / n), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 4.4e-36], N[(f / N[(n - f), $MachinePrecision]), $MachinePrecision], N[(n / N[(n - f), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.2 \cdot 10^{+52}:\\
\;\;\;\;1 + \frac{f}{n}\\
\mathbf{elif}\;n \leq 4.4 \cdot 10^{-36}:\\
\;\;\;\;\frac{f}{n - f}\\
\mathbf{else}:\\
\;\;\;\;\frac{n}{n - f}\\
\end{array}
\end{array}
if n < -3.2e52Initial program 99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in f around 0 83.7%
Taylor expanded in n around inf 83.9%
if -3.2e52 < n < 4.3999999999999999e-36Initial program 99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in f around inf 80.5%
if 4.3999999999999999e-36 < n Initial program 100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in f around 0 72.4%
(FPCore (f n) :precision binary64 (if (<= n -7e+51) 1.0 (if (<= n 3.8e-36) -1.0 1.0)))
double code(double f, double n) {
double tmp;
if (n <= -7e+51) {
tmp = 1.0;
} else if (n <= 3.8e-36) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-7d+51)) then
tmp = 1.0d0
else if (n <= 3.8d-36) then
tmp = -1.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double f, double n) {
double tmp;
if (n <= -7e+51) {
tmp = 1.0;
} else if (n <= 3.8e-36) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(f, n): tmp = 0 if n <= -7e+51: tmp = 1.0 elif n <= 3.8e-36: tmp = -1.0 else: tmp = 1.0 return tmp
function code(f, n) tmp = 0.0 if (n <= -7e+51) tmp = 1.0; elseif (n <= 3.8e-36) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(f, n) tmp = 0.0; if (n <= -7e+51) tmp = 1.0; elseif (n <= 3.8e-36) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[f_, n_] := If[LessEqual[n, -7e+51], 1.0, If[LessEqual[n, 3.8e-36], -1.0, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -7 \cdot 10^{+51}:\\
\;\;\;\;1\\
\mathbf{elif}\;n \leq 3.8 \cdot 10^{-36}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if n < -7e51 or 3.79999999999999971e-36 < n Initial program 100.0%
distribute-frac-neg100.0%
distribute-neg-frac2100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
remove-double-neg100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in f around 0 76.3%
if -7e51 < n < 3.79999999999999971e-36Initial program 99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in f around inf 80.1%
(FPCore (f n) :precision binary64 -1.0)
double code(double f, double n) {
return -1.0;
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
code = -1.0d0
end function
public static double code(double f, double n) {
return -1.0;
}
def code(f, n): return -1.0
function code(f, n) return -1.0 end
function tmp = code(f, n) tmp = -1.0; end
code[f_, n_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in f around inf 51.5%
herbie shell --seed 2024181
(FPCore (f n)
:name "subtraction fraction"
:precision binary64
(/ (- (+ f n)) (- f n)))