
(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 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%
(FPCore (f n) :precision binary64 (if (or (<= n -650000.0) (not (<= n 1.7e-10))) (+ 1.0 (* 2.0 (/ f n))) (+ (* -2.0 (/ n f)) -1.0)))
double code(double f, double n) {
double tmp;
if ((n <= -650000.0) || !(n <= 1.7e-10)) {
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 <= (-650000.0d0)) .or. (.not. (n <= 1.7d-10))) 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 <= -650000.0) || !(n <= 1.7e-10)) {
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 <= -650000.0) or not (n <= 1.7e-10): 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 <= -650000.0) || !(n <= 1.7e-10)) 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 <= -650000.0) || ~((n <= 1.7e-10))) 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, -650000.0], N[Not[LessEqual[n, 1.7e-10]], $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 -650000 \lor \neg \left(n \leq 1.7 \cdot 10^{-10}\right):\\
\;\;\;\;1 + 2 \cdot \frac{f}{n}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{n}{f} + -1\\
\end{array}
\end{array}
if n < -6.5e5 or 1.70000000000000007e-10 < 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 80.5%
if -6.5e5 < n < 1.70000000000000007e-10Initial 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 n around 0 74.3%
Final simplification77.5%
(FPCore (f n) :precision binary64 (if (or (<= n -500000.0) (not (<= n 6.9e-10))) (+ 1.0 (* 2.0 (/ f n))) (/ (+ f n) (- f))))
double code(double f, double n) {
double tmp;
if ((n <= -500000.0) || !(n <= 6.9e-10)) {
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 <= (-500000.0d0)) .or. (.not. (n <= 6.9d-10))) 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 <= -500000.0) || !(n <= 6.9e-10)) {
tmp = 1.0 + (2.0 * (f / n));
} else {
tmp = (f + n) / -f;
}
return tmp;
}
def code(f, n): tmp = 0 if (n <= -500000.0) or not (n <= 6.9e-10): tmp = 1.0 + (2.0 * (f / n)) else: tmp = (f + n) / -f return tmp
function code(f, n) tmp = 0.0 if ((n <= -500000.0) || !(n <= 6.9e-10)) 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 <= -500000.0) || ~((n <= 6.9e-10))) tmp = 1.0 + (2.0 * (f / n)); else tmp = (f + n) / -f; end tmp_2 = tmp; end
code[f_, n_] := If[Or[LessEqual[n, -500000.0], N[Not[LessEqual[n, 6.9e-10]], $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 -500000 \lor \neg \left(n \leq 6.9 \cdot 10^{-10}\right):\\
\;\;\;\;1 + 2 \cdot \frac{f}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{f + n}{-f}\\
\end{array}
\end{array}
if n < -5e5 or 6.89999999999999995e-10 < 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 80.5%
if -5e5 < n < 6.89999999999999995e-10Initial 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 n around 0 74.0%
neg-mul-174.0%
Simplified74.0%
Final simplification77.3%
(FPCore (f n) :precision binary64 (if (<= n -500000.0) (/ n (- n f)) (if (<= n 1.52e-9) (/ (+ f n) (- f)) (+ 1.0 (/ f n)))))
double code(double f, double n) {
double tmp;
if (n <= -500000.0) {
tmp = n / (n - f);
} else if (n <= 1.52e-9) {
tmp = (f + n) / -f;
} else {
tmp = 1.0 + (f / n);
}
return tmp;
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-500000.0d0)) then
tmp = n / (n - f)
else if (n <= 1.52d-9) then
tmp = (f + n) / -f
else
tmp = 1.0d0 + (f / n)
end if
code = tmp
end function
public static double code(double f, double n) {
double tmp;
if (n <= -500000.0) {
tmp = n / (n - f);
} else if (n <= 1.52e-9) {
tmp = (f + n) / -f;
} else {
tmp = 1.0 + (f / n);
}
return tmp;
}
def code(f, n): tmp = 0 if n <= -500000.0: tmp = n / (n - f) elif n <= 1.52e-9: tmp = (f + n) / -f else: tmp = 1.0 + (f / n) return tmp
function code(f, n) tmp = 0.0 if (n <= -500000.0) tmp = Float64(n / Float64(n - f)); elseif (n <= 1.52e-9) tmp = Float64(Float64(f + n) / Float64(-f)); else tmp = Float64(1.0 + Float64(f / n)); end return tmp end
function tmp_2 = code(f, n) tmp = 0.0; if (n <= -500000.0) tmp = n / (n - f); elseif (n <= 1.52e-9) tmp = (f + n) / -f; else tmp = 1.0 + (f / n); end tmp_2 = tmp; end
code[f_, n_] := If[LessEqual[n, -500000.0], N[(n / N[(n - f), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.52e-9], N[(N[(f + n), $MachinePrecision] / (-f)), $MachinePrecision], N[(1.0 + N[(f / n), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -500000:\\
\;\;\;\;\frac{n}{n - f}\\
\mathbf{elif}\;n \leq 1.52 \cdot 10^{-9}:\\
\;\;\;\;\frac{f + n}{-f}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{f}{n}\\
\end{array}
\end{array}
if n < -5e5Initial 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 80.3%
if -5e5 < n < 1.51999999999999992e-9Initial 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 n around 0 74.0%
neg-mul-174.0%
Simplified74.0%
if 1.51999999999999992e-9 < n 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 0 78.8%
Taylor expanded in n around inf 79.5%
(FPCore (f n) :precision binary64 (if (or (<= n -9.2e-15) (not (<= n 1.82e-9))) (+ 1.0 (/ f n)) (/ f (- n f))))
double code(double f, double n) {
double tmp;
if ((n <= -9.2e-15) || !(n <= 1.82e-9)) {
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 <= (-9.2d-15)) .or. (.not. (n <= 1.82d-9))) 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 <= -9.2e-15) || !(n <= 1.82e-9)) {
tmp = 1.0 + (f / n);
} else {
tmp = f / (n - f);
}
return tmp;
}
def code(f, n): tmp = 0 if (n <= -9.2e-15) or not (n <= 1.82e-9): tmp = 1.0 + (f / n) else: tmp = f / (n - f) return tmp
function code(f, n) tmp = 0.0 if ((n <= -9.2e-15) || !(n <= 1.82e-9)) 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 <= -9.2e-15) || ~((n <= 1.82e-9))) tmp = 1.0 + (f / n); else tmp = f / (n - f); end tmp_2 = tmp; end
code[f_, n_] := If[Or[LessEqual[n, -9.2e-15], N[Not[LessEqual[n, 1.82e-9]], $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 -9.2 \cdot 10^{-15} \lor \neg \left(n \leq 1.82 \cdot 10^{-9}\right):\\
\;\;\;\;1 + \frac{f}{n}\\
\mathbf{else}:\\
\;\;\;\;\frac{f}{n - f}\\
\end{array}
\end{array}
if n < -9.19999999999999961e-15 or 1.8199999999999999e-9 < 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 79.2%
Taylor expanded in n around inf 79.5%
if -9.19999999999999961e-15 < n < 1.8199999999999999e-9Initial 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 inf 74.2%
Final simplification76.9%
(FPCore (f n) :precision binary64 (if (or (<= n -5.8e-12) (not (<= n 2.9e-10))) (+ 1.0 (/ f n)) -1.0))
double code(double f, double n) {
double tmp;
if ((n <= -5.8e-12) || !(n <= 2.9e-10)) {
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 <= (-5.8d-12)) .or. (.not. (n <= 2.9d-10))) 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 <= -5.8e-12) || !(n <= 2.9e-10)) {
tmp = 1.0 + (f / n);
} else {
tmp = -1.0;
}
return tmp;
}
def code(f, n): tmp = 0 if (n <= -5.8e-12) or not (n <= 2.9e-10): tmp = 1.0 + (f / n) else: tmp = -1.0 return tmp
function code(f, n) tmp = 0.0 if ((n <= -5.8e-12) || !(n <= 2.9e-10)) 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 <= -5.8e-12) || ~((n <= 2.9e-10))) tmp = 1.0 + (f / n); else tmp = -1.0; end tmp_2 = tmp; end
code[f_, n_] := If[Or[LessEqual[n, -5.8e-12], N[Not[LessEqual[n, 2.9e-10]], $MachinePrecision]], N[(1.0 + N[(f / n), $MachinePrecision]), $MachinePrecision], -1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -5.8 \cdot 10^{-12} \lor \neg \left(n \leq 2.9 \cdot 10^{-10}\right):\\
\;\;\;\;1 + \frac{f}{n}\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if n < -5.8000000000000003e-12 or 2.89999999999999981e-10 < 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 79.2%
Taylor expanded in n around inf 79.5%
if -5.8000000000000003e-12 < n < 2.89999999999999981e-10Initial 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 inf 73.5%
Final simplification76.6%
(FPCore (f n) :precision binary64 (if (<= n -3.4e-12) (/ n (- n f)) (if (<= n 4.15e-10) (/ f (- n f)) (+ 1.0 (/ f n)))))
double code(double f, double n) {
double tmp;
if (n <= -3.4e-12) {
tmp = n / (n - f);
} else if (n <= 4.15e-10) {
tmp = f / (n - f);
} else {
tmp = 1.0 + (f / n);
}
return tmp;
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
real(8) :: tmp
if (n <= (-3.4d-12)) then
tmp = n / (n - f)
else if (n <= 4.15d-10) then
tmp = f / (n - f)
else
tmp = 1.0d0 + (f / n)
end if
code = tmp
end function
public static double code(double f, double n) {
double tmp;
if (n <= -3.4e-12) {
tmp = n / (n - f);
} else if (n <= 4.15e-10) {
tmp = f / (n - f);
} else {
tmp = 1.0 + (f / n);
}
return tmp;
}
def code(f, n): tmp = 0 if n <= -3.4e-12: tmp = n / (n - f) elif n <= 4.15e-10: tmp = f / (n - f) else: tmp = 1.0 + (f / n) return tmp
function code(f, n) tmp = 0.0 if (n <= -3.4e-12) tmp = Float64(n / Float64(n - f)); elseif (n <= 4.15e-10) tmp = Float64(f / Float64(n - f)); else tmp = Float64(1.0 + Float64(f / n)); end return tmp end
function tmp_2 = code(f, n) tmp = 0.0; if (n <= -3.4e-12) tmp = n / (n - f); elseif (n <= 4.15e-10) tmp = f / (n - f); else tmp = 1.0 + (f / n); end tmp_2 = tmp; end
code[f_, n_] := If[LessEqual[n, -3.4e-12], N[(n / N[(n - f), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 4.15e-10], N[(f / N[(n - f), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(f / n), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.4 \cdot 10^{-12}:\\
\;\;\;\;\frac{n}{n - f}\\
\mathbf{elif}\;n \leq 4.15 \cdot 10^{-10}:\\
\;\;\;\;\frac{f}{n - f}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{f}{n}\\
\end{array}
\end{array}
if n < -3.4000000000000001e-12Initial 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 79.5%
if -3.4000000000000001e-12 < n < 4.1500000000000001e-10Initial 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 inf 74.2%
if 4.1500000000000001e-10 < n 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 0 78.8%
Taylor expanded in n around inf 79.5%
(FPCore (f n) :precision binary64 (if (<= n -500000.0) 1.0 (if (<= n 2.1e-10) -1.0 1.0)))
double code(double f, double n) {
double tmp;
if (n <= -500000.0) {
tmp = 1.0;
} else if (n <= 2.1e-10) {
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 <= (-500000.0d0)) then
tmp = 1.0d0
else if (n <= 2.1d-10) 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 <= -500000.0) {
tmp = 1.0;
} else if (n <= 2.1e-10) {
tmp = -1.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(f, n): tmp = 0 if n <= -500000.0: tmp = 1.0 elif n <= 2.1e-10: tmp = -1.0 else: tmp = 1.0 return tmp
function code(f, n) tmp = 0.0 if (n <= -500000.0) tmp = 1.0; elseif (n <= 2.1e-10) tmp = -1.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(f, n) tmp = 0.0; if (n <= -500000.0) tmp = 1.0; elseif (n <= 2.1e-10) tmp = -1.0; else tmp = 1.0; end tmp_2 = tmp; end
code[f_, n_] := If[LessEqual[n, -500000.0], 1.0, If[LessEqual[n, 2.1e-10], -1.0, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -500000:\\
\;\;\;\;1\\
\mathbf{elif}\;n \leq 2.1 \cdot 10^{-10}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if n < -5e5 or 2.1e-10 < 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 79.1%
if -5e5 < n < 2.1e-10Initial 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 inf 73.2%
(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 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 inf 46.2%
herbie shell --seed 2024131
(FPCore (f n)
:name "subtraction fraction"
:precision binary64
(/ (- (+ f n)) (- f n)))