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

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.0

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

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

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

Reproduce

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