?

Average Error: 0.0 → 0.0
Time: 3.0s
Precision: binary64
Cost: 512

?

\[\frac{-\left(f + n\right)}{f - n} \]
\[\frac{-\left(f + n\right)}{f - n} \]
(FPCore (f n) :precision binary64 (/ (- (+ f n)) (- f n)))
(FPCore (f n) :precision binary64 (/ (- (+ f n)) (- f n)))
double code(double f, double n) {
	return -(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
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);
}
public static double code(double f, double n) {
	return -(f + n) / (f - n);
}
def code(f, 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 code(f, n)
	return Float64(Float64(-Float64(f + n)) / Float64(f - n))
end
function tmp = code(f, n)
	tmp = -(f + n) / (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]
code[f_, n_] := N[((-N[(f + n), $MachinePrecision]) / N[(f - n), $MachinePrecision]), $MachinePrecision]
\frac{-\left(f + n\right)}{f - n}
\frac{-\left(f + n\right)}{f - n}

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

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

Alternatives

Alternative 1
Error17.0
Cost856
\[\begin{array}{l} \mathbf{if}\;f \leq -1.05 \cdot 10^{+74}:\\ \;\;\;\;-1\\ \mathbf{elif}\;f \leq 3 \cdot 10^{-58}:\\ \;\;\;\;1\\ \mathbf{elif}\;f \leq 8000000:\\ \;\;\;\;-1\\ \mathbf{elif}\;f \leq 4 \cdot 10^{+26}:\\ \;\;\;\;1\\ \mathbf{elif}\;f \leq 4 \cdot 10^{+79}:\\ \;\;\;\;-1\\ \mathbf{elif}\;f \leq 1.45 \cdot 10^{+111}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;-1\\ \end{array} \]
Alternative 2
Error17.3
Cost712
\[\begin{array}{l} t_0 := 2 \cdot \frac{f}{n} + 1\\ \mathbf{if}\;n \leq -4.2 \cdot 10^{-62}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;n \leq 2.06 \cdot 10^{-97}:\\ \;\;\;\;-1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error17.0
Cost712
\[\begin{array}{l} t_0 := 2 \cdot \frac{f}{n} + 1\\ \mathbf{if}\;n \leq -4.4 \cdot 10^{-61}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;n \leq 2.06 \cdot 10^{-97}:\\ \;\;\;\;-2 \cdot \frac{n}{f} - 1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error32.2
Cost64
\[-1 \]

Error

Reproduce?

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