Average Error: 0.0 → 0.0
Time: 2.5s
Precision: binary64
\[\frac{-\left(f + n\right)}{f - n} \]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{f + n}{n - f}\right)\right) \]
(FPCore (f n) :precision binary64 (/ (- (+ f n)) (- f n)))
(FPCore (f n) :precision binary64 (log1p (expm1 (/ (+ f n) (- n f)))))
double code(double f, double n) {
	return -(f + n) / (f - n);
}
double code(double f, double n) {
	return log1p(expm1(((f + n) / (n - f))));
}
public static double code(double f, double n) {
	return -(f + n) / (f - n);
}
public static double code(double f, double n) {
	return Math.log1p(Math.expm1(((f + n) / (n - f))));
}
def code(f, n):
	return -(f + n) / (f - n)
def code(f, n):
	return math.log1p(math.expm1(((f + n) / (n - f))))
function code(f, n)
	return Float64(Float64(-Float64(f + n)) / Float64(f - n))
end
function code(f, n)
	return log1p(expm1(Float64(Float64(f + n) / Float64(n - f))))
end
code[f_, n_] := N[((-N[(f + n), $MachinePrecision]) / N[(f - n), $MachinePrecision]), $MachinePrecision]
code[f_, n_] := N[Log[1 + N[(Exp[N[(N[(f + n), $MachinePrecision] / N[(n - f), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]
\frac{-\left(f + n\right)}{f - n}
\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{f + n}{n - f}\right)\right)

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[\frac{-\left(f + n\right)}{f - n} \]
  2. Simplified0.0

    \[\leadsto \color{blue}{\frac{f + n}{n - f}} \]
  3. Applied egg-rr0.1

    \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{f + n}{n - f}}\right)}^{3}} \]
  4. Applied egg-rr0.0

    \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{f + n}{n - f}\right)\right)} \]
  5. Final simplification0.0

    \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{f + n}{n - f}\right)\right) \]

Reproduce

herbie shell --seed 2022212 
(FPCore (f n)
  :name "subtraction fraction"
  :precision binary64
  (/ (- (+ f n)) (- f n)))