
(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 (<= f -2.4e+25) (not (<= f 9.2e-52))) (/ (+ f n) (- f)) (+ 1.0 (* 2.0 (/ f n)))))
double code(double f, double n) {
double tmp;
if ((f <= -2.4e+25) || !(f <= 9.2e-52)) {
tmp = (f + n) / -f;
} else {
tmp = 1.0 + (2.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 ((f <= (-2.4d+25)) .or. (.not. (f <= 9.2d-52))) then
tmp = (f + n) / -f
else
tmp = 1.0d0 + (2.0d0 * (f / n))
end if
code = tmp
end function
public static double code(double f, double n) {
double tmp;
if ((f <= -2.4e+25) || !(f <= 9.2e-52)) {
tmp = (f + n) / -f;
} else {
tmp = 1.0 + (2.0 * (f / n));
}
return tmp;
}
def code(f, n): tmp = 0 if (f <= -2.4e+25) or not (f <= 9.2e-52): tmp = (f + n) / -f else: tmp = 1.0 + (2.0 * (f / n)) return tmp
function code(f, n) tmp = 0.0 if ((f <= -2.4e+25) || !(f <= 9.2e-52)) tmp = Float64(Float64(f + n) / Float64(-f)); else tmp = Float64(1.0 + Float64(2.0 * Float64(f / n))); end return tmp end
function tmp_2 = code(f, n) tmp = 0.0; if ((f <= -2.4e+25) || ~((f <= 9.2e-52))) tmp = (f + n) / -f; else tmp = 1.0 + (2.0 * (f / n)); end tmp_2 = tmp; end
code[f_, n_] := If[Or[LessEqual[f, -2.4e+25], N[Not[LessEqual[f, 9.2e-52]], $MachinePrecision]], N[(N[(f + n), $MachinePrecision] / (-f)), $MachinePrecision], N[(1.0 + N[(2.0 * N[(f / n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;f \leq -2.4 \cdot 10^{+25} \lor \neg \left(f \leq 9.2 \cdot 10^{-52}\right):\\
\;\;\;\;\frac{f + n}{-f}\\
\mathbf{else}:\\
\;\;\;\;1 + 2 \cdot \frac{f}{n}\\
\end{array}
\end{array}
if f < -2.39999999999999996e25 or 9.19999999999999977e-52 < f 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 n around 0 80.9%
neg-mul-180.9%
Simplified80.9%
if -2.39999999999999996e25 < f < 9.19999999999999977e-52Initial 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 78.6%
Final simplification79.7%
(FPCore (f n) :precision binary64 (if (<= f -2.7e+25) (/ (+ f n) (- f)) (if (<= f 2.7e-51) (+ 1.0 (* 2.0 (/ f n))) (+ (* -2.0 (/ n f)) -1.0))))
double code(double f, double n) {
double tmp;
if (f <= -2.7e+25) {
tmp = (f + n) / -f;
} else if (f <= 2.7e-51) {
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 (f <= (-2.7d+25)) then
tmp = (f + n) / -f
else if (f <= 2.7d-51) 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 (f <= -2.7e+25) {
tmp = (f + n) / -f;
} else if (f <= 2.7e-51) {
tmp = 1.0 + (2.0 * (f / n));
} else {
tmp = (-2.0 * (n / f)) + -1.0;
}
return tmp;
}
def code(f, n): tmp = 0 if f <= -2.7e+25: tmp = (f + n) / -f elif f <= 2.7e-51: 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 (f <= -2.7e+25) tmp = Float64(Float64(f + n) / Float64(-f)); elseif (f <= 2.7e-51) 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 (f <= -2.7e+25) tmp = (f + n) / -f; elseif (f <= 2.7e-51) tmp = 1.0 + (2.0 * (f / n)); else tmp = (-2.0 * (n / f)) + -1.0; end tmp_2 = tmp; end
code[f_, n_] := If[LessEqual[f, -2.7e+25], N[(N[(f + n), $MachinePrecision] / (-f)), $MachinePrecision], If[LessEqual[f, 2.7e-51], 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}\;f \leq -2.7 \cdot 10^{+25}:\\
\;\;\;\;\frac{f + n}{-f}\\
\mathbf{elif}\;f \leq 2.7 \cdot 10^{-51}:\\
\;\;\;\;1 + 2 \cdot \frac{f}{n}\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{n}{f} + -1\\
\end{array}
\end{array}
if f < -2.7e25Initial 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 76.4%
neg-mul-176.4%
Simplified76.4%
if -2.7e25 < f < 2.6999999999999997e-51Initial 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 78.6%
if 2.6999999999999997e-51 < f 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 n around 0 84.0%
Final simplification79.7%
(FPCore (f n) :precision binary64 (if (or (<= f -2.55e+25) (not (<= f 1.8e-51))) (/ (+ f n) (- f)) (/ n (- n f))))
double code(double f, double n) {
double tmp;
if ((f <= -2.55e+25) || !(f <= 1.8e-51)) {
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 ((f <= (-2.55d+25)) .or. (.not. (f <= 1.8d-51))) 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 ((f <= -2.55e+25) || !(f <= 1.8e-51)) {
tmp = (f + n) / -f;
} else {
tmp = n / (n - f);
}
return tmp;
}
def code(f, n): tmp = 0 if (f <= -2.55e+25) or not (f <= 1.8e-51): tmp = (f + n) / -f else: tmp = n / (n - f) return tmp
function code(f, n) tmp = 0.0 if ((f <= -2.55e+25) || !(f <= 1.8e-51)) 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 ((f <= -2.55e+25) || ~((f <= 1.8e-51))) tmp = (f + n) / -f; else tmp = n / (n - f); end tmp_2 = tmp; end
code[f_, n_] := If[Or[LessEqual[f, -2.55e+25], N[Not[LessEqual[f, 1.8e-51]], $MachinePrecision]], N[(N[(f + n), $MachinePrecision] / (-f)), $MachinePrecision], N[(n / N[(n - f), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;f \leq -2.55 \cdot 10^{+25} \lor \neg \left(f \leq 1.8 \cdot 10^{-51}\right):\\
\;\;\;\;\frac{f + n}{-f}\\
\mathbf{else}:\\
\;\;\;\;\frac{n}{n - f}\\
\end{array}
\end{array}
if f < -2.5500000000000002e25 or 1.8e-51 < f 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 n around 0 80.9%
neg-mul-180.9%
Simplified80.9%
if -2.5500000000000002e25 < f < 1.8e-51Initial 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 78.4%
Final simplification79.7%
(FPCore (f n) :precision binary64 (if (or (<= f -2.4e+25) (not (<= f 9.2e-52))) (/ f (- n f)) (/ n (- n f))))
double code(double f, double n) {
double tmp;
if ((f <= -2.4e+25) || !(f <= 9.2e-52)) {
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 ((f <= (-2.4d+25)) .or. (.not. (f <= 9.2d-52))) 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 ((f <= -2.4e+25) || !(f <= 9.2e-52)) {
tmp = f / (n - f);
} else {
tmp = n / (n - f);
}
return tmp;
}
def code(f, n): tmp = 0 if (f <= -2.4e+25) or not (f <= 9.2e-52): tmp = f / (n - f) else: tmp = n / (n - f) return tmp
function code(f, n) tmp = 0.0 if ((f <= -2.4e+25) || !(f <= 9.2e-52)) 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 ((f <= -2.4e+25) || ~((f <= 9.2e-52))) tmp = f / (n - f); else tmp = n / (n - f); end tmp_2 = tmp; end
code[f_, n_] := If[Or[LessEqual[f, -2.4e+25], N[Not[LessEqual[f, 9.2e-52]], $MachinePrecision]], N[(f / N[(n - f), $MachinePrecision]), $MachinePrecision], N[(n / N[(n - f), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;f \leq -2.4 \cdot 10^{+25} \lor \neg \left(f \leq 9.2 \cdot 10^{-52}\right):\\
\;\;\;\;\frac{f}{n - f}\\
\mathbf{else}:\\
\;\;\;\;\frac{n}{n - f}\\
\end{array}
\end{array}
if f < -2.39999999999999996e25 or 9.19999999999999977e-52 < f 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 80.8%
if -2.39999999999999996e25 < f < 9.19999999999999977e-52Initial 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 78.4%
Final simplification79.6%
(FPCore (f n) :precision binary64 (if (or (<= f -2.5e+25) (not (<= f 2.55e-51))) (/ f (- n f)) (+ 1.0 (/ f n))))
double code(double f, double n) {
double tmp;
if ((f <= -2.5e+25) || !(f <= 2.55e-51)) {
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 ((f <= (-2.5d+25)) .or. (.not. (f <= 2.55d-51))) 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 ((f <= -2.5e+25) || !(f <= 2.55e-51)) {
tmp = f / (n - f);
} else {
tmp = 1.0 + (f / n);
}
return tmp;
}
def code(f, n): tmp = 0 if (f <= -2.5e+25) or not (f <= 2.55e-51): tmp = f / (n - f) else: tmp = 1.0 + (f / n) return tmp
function code(f, n) tmp = 0.0 if ((f <= -2.5e+25) || !(f <= 2.55e-51)) 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 ((f <= -2.5e+25) || ~((f <= 2.55e-51))) tmp = f / (n - f); else tmp = 1.0 + (f / n); end tmp_2 = tmp; end
code[f_, n_] := If[Or[LessEqual[f, -2.5e+25], N[Not[LessEqual[f, 2.55e-51]], $MachinePrecision]], N[(f / N[(n - f), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(f / n), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;f \leq -2.5 \cdot 10^{+25} \lor \neg \left(f \leq 2.55 \cdot 10^{-51}\right):\\
\;\;\;\;\frac{f}{n - f}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{f}{n}\\
\end{array}
\end{array}
if f < -2.50000000000000012e25 or 2.5499999999999999e-51 < f 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 80.8%
if -2.50000000000000012e25 < f < 2.5499999999999999e-51Initial 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 78.4%
Taylor expanded in n around inf 78.2%
Final simplification79.5%
(FPCore (f n) :precision binary64 (if (<= f -1.55e+26) -1.0 (if (<= f 1.5e-50) (+ 1.0 (/ f n)) -1.0)))
double code(double f, double n) {
double tmp;
if (f <= -1.55e+26) {
tmp = -1.0;
} else if (f <= 1.5e-50) {
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 (f <= (-1.55d+26)) then
tmp = -1.0d0
else if (f <= 1.5d-50) 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 (f <= -1.55e+26) {
tmp = -1.0;
} else if (f <= 1.5e-50) {
tmp = 1.0 + (f / n);
} else {
tmp = -1.0;
}
return tmp;
}
def code(f, n): tmp = 0 if f <= -1.55e+26: tmp = -1.0 elif f <= 1.5e-50: tmp = 1.0 + (f / n) else: tmp = -1.0 return tmp
function code(f, n) tmp = 0.0 if (f <= -1.55e+26) tmp = -1.0; elseif (f <= 1.5e-50) 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 (f <= -1.55e+26) tmp = -1.0; elseif (f <= 1.5e-50) tmp = 1.0 + (f / n); else tmp = -1.0; end tmp_2 = tmp; end
code[f_, n_] := If[LessEqual[f, -1.55e+26], -1.0, If[LessEqual[f, 1.5e-50], N[(1.0 + N[(f / n), $MachinePrecision]), $MachinePrecision], -1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;f \leq -1.55 \cdot 10^{+26}:\\
\;\;\;\;-1\\
\mathbf{elif}\;f \leq 1.5 \cdot 10^{-50}:\\
\;\;\;\;1 + \frac{f}{n}\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if f < -1.55e26 or 1.49999999999999995e-50 < f 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 80.4%
if -1.55e26 < f < 1.49999999999999995e-50Initial 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 78.4%
Taylor expanded in n around inf 78.2%
(FPCore (f n) :precision binary64 (if (<= f -1.12e+26) -1.0 (if (<= f 1e-51) 1.0 -1.0)))
double code(double f, double n) {
double tmp;
if (f <= -1.12e+26) {
tmp = -1.0;
} else if (f <= 1e-51) {
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 (f <= (-1.12d+26)) then
tmp = -1.0d0
else if (f <= 1d-51) 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 (f <= -1.12e+26) {
tmp = -1.0;
} else if (f <= 1e-51) {
tmp = 1.0;
} else {
tmp = -1.0;
}
return tmp;
}
def code(f, n): tmp = 0 if f <= -1.12e+26: tmp = -1.0 elif f <= 1e-51: tmp = 1.0 else: tmp = -1.0 return tmp
function code(f, n) tmp = 0.0 if (f <= -1.12e+26) tmp = -1.0; elseif (f <= 1e-51) tmp = 1.0; else tmp = -1.0; end return tmp end
function tmp_2 = code(f, n) tmp = 0.0; if (f <= -1.12e+26) tmp = -1.0; elseif (f <= 1e-51) tmp = 1.0; else tmp = -1.0; end tmp_2 = tmp; end
code[f_, n_] := If[LessEqual[f, -1.12e+26], -1.0, If[LessEqual[f, 1e-51], 1.0, -1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;f \leq -1.12 \cdot 10^{+26}:\\
\;\;\;\;-1\\
\mathbf{elif}\;f \leq 10^{-51}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\end{array}
if f < -1.1200000000000001e26 or 1e-51 < f 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 80.4%
if -1.1200000000000001e26 < f < 1e-51Initial 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.7%
(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 51.9%
herbie shell --seed 2024182
(FPCore (f n)
:name "subtraction fraction"
:precision binary64
(/ (- (+ f n)) (- f n)))