(FPCore (f n) :precision binary64 (/ (- (+ f n)) (- f n)))
(FPCore (f n) :precision binary64 (let* ((t_0 (/ (+ f n) (- n f)))) (+ (* 0.5 t_0) (log (sqrt (exp t_0))))))
double code(double f, double n) {
return -(f + n) / (f - n);
}
double code(double f, double n) {
double t_0 = (f + n) / (n - f);
return (0.5 * t_0) + log(sqrt(exp(t_0)));
}
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
code = -(f + n) / (f - n)
end function
real(8) function code(f, n)
real(8), intent (in) :: f
real(8), intent (in) :: n
real(8) :: t_0
t_0 = (f + n) / (n - f)
code = (0.5d0 * t_0) + log(sqrt(exp(t_0)))
end function
public static double code(double f, double n) {
return -(f + n) / (f - n);
}
public static double code(double f, double n) {
double t_0 = (f + n) / (n - f);
return (0.5 * t_0) + Math.log(Math.sqrt(Math.exp(t_0)));
}
def code(f, n): return -(f + n) / (f - n)
def code(f, n): t_0 = (f + n) / (n - f) return (0.5 * t_0) + math.log(math.sqrt(math.exp(t_0)))
function code(f, n) return Float64(Float64(-Float64(f + n)) / Float64(f - n)) end
function code(f, n) t_0 = Float64(Float64(f + n) / Float64(n - f)) return Float64(Float64(0.5 * t_0) + log(sqrt(exp(t_0)))) end
function tmp = code(f, n) tmp = -(f + n) / (f - n); end
function tmp = code(f, n) t_0 = (f + n) / (n - f); tmp = (0.5 * t_0) + log(sqrt(exp(t_0))); end
code[f_, n_] := N[((-N[(f + n), $MachinePrecision]) / N[(f - n), $MachinePrecision]), $MachinePrecision]
code[f_, n_] := Block[{t$95$0 = N[(N[(f + n), $MachinePrecision] / N[(n - f), $MachinePrecision]), $MachinePrecision]}, N[(N[(0.5 * t$95$0), $MachinePrecision] + N[Log[N[Sqrt[N[Exp[t$95$0], $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\frac{-\left(f + n\right)}{f - n}
\begin{array}{l}
t_0 := \frac{f + n}{n - f}\\
0.5 \cdot t_0 + \log \left(\sqrt{e^{t_0}}\right)
\end{array}
Results
Initial program 0.0
Simplified0.0
Applied egg-rr0.0
Applied egg-rr0.0
Applied egg-rr0.0
Final simplification0.0
herbie shell --seed 2022210
(FPCore (f n)
:name "subtraction fraction"
:precision binary64
(/ (- (+ f n)) (- f n)))