Average Error: 18.4 → 1.4
Time: 3.5s
Precision: 64
\[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\]
\[\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}\]
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}
double code(double u, double v, double t1) {
	return ((-t1 * v) / ((t1 + u) * (t1 + u)));
}
double code(double u, double v, double t1) {
	return ((-t1 / (t1 + u)) * (v / (t1 + u)));
}

Error

Bits error versus u

Bits error versus v

Bits error versus t1

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 18.4

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\]
  2. Using strategy rm
  3. Applied times-frac1.4

    \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}}\]
  4. Final simplification1.4

    \[\leadsto \frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}\]

Reproduce

herbie shell --seed 2020106 
(FPCore (u v t1)
  :name "Rosa's DopplerBench"
  :precision binary64
  (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))