Average Error: 0.1 → 0.1
Time: 6.4s
Precision: binary64
\[0 \leq e \land e \leq 1\]
\[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
\[\frac{e \cdot \sin v}{\mathsf{fma}\left(e, \cos v, 1\right)} \]
\frac{e \cdot \sin v}{1 + e \cdot \cos v}
\frac{e \cdot \sin v}{\mathsf{fma}\left(e, \cos v, 1\right)}
(FPCore (e v) :precision binary64 (/ (* e (sin v)) (+ 1.0 (* e (cos v)))))
(FPCore (e v) :precision binary64 (/ (* e (sin v)) (fma e (cos v) 1.0)))
double code(double e, double v) {
	return (e * sin(v)) / (1.0 + (e * cos(v)));
}
double code(double e, double v) {
	return (e * sin(v)) / fma(e, cos(v), 1.0);
}

Error

Bits error versus e

Bits error versus v

Derivation

  1. Initial program 0.1

    \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
  2. Simplified0.1

    \[\leadsto \color{blue}{\frac{e \cdot \sin v}{\mathsf{fma}\left(e, \cos v, 1\right)}} \]
  3. Applied associate-/l*_binary640.3

    \[\leadsto \color{blue}{\frac{e}{\frac{\mathsf{fma}\left(e, \cos v, 1\right)}{\sin v}}} \]
  4. Applied *-un-lft-identity_binary640.3

    \[\leadsto \frac{e}{\frac{\mathsf{fma}\left(e, \cos v, 1\right)}{\color{blue}{1 \cdot \sin v}}} \]
  5. Applied add-sqr-sqrt_binary640.3

    \[\leadsto \frac{e}{\frac{\color{blue}{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)} \cdot \sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}}{1 \cdot \sin v}} \]
  6. Applied times-frac_binary640.3

    \[\leadsto \frac{e}{\color{blue}{\frac{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}{1} \cdot \frac{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}{\sin v}}} \]
  7. Applied *-un-lft-identity_binary640.3

    \[\leadsto \frac{\color{blue}{1 \cdot e}}{\frac{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}{1} \cdot \frac{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}{\sin v}} \]
  8. Applied times-frac_binary640.3

    \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}{1}} \cdot \frac{e}{\frac{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}{\sin v}}} \]
  9. Simplified0.3

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}} \cdot \frac{e}{\frac{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}{\sin v}} \]
  10. Applied *-un-lft-identity_binary640.3

    \[\leadsto \frac{1}{\color{blue}{1 \cdot \sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}} \cdot \frac{e}{\frac{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}{\sin v}} \]
  11. Applied add-sqr-sqrt_binary640.3

    \[\leadsto \frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}}}{1 \cdot \sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}} \cdot \frac{e}{\frac{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}{\sin v}} \]
  12. Applied times-frac_binary640.3

    \[\leadsto \color{blue}{\left(\frac{\sqrt{1}}{1} \cdot \frac{\sqrt{1}}{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}\right)} \cdot \frac{e}{\frac{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}{\sin v}} \]
  13. Applied associate-*l*_binary640.3

    \[\leadsto \color{blue}{\frac{\sqrt{1}}{1} \cdot \left(\frac{\sqrt{1}}{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}} \cdot \frac{e}{\frac{\sqrt{\mathsf{fma}\left(e, \cos v, 1\right)}}{\sin v}}\right)} \]
  14. Simplified0.1

    \[\leadsto \frac{\sqrt{1}}{1} \cdot \color{blue}{\frac{e \cdot \sin v}{\mathsf{fma}\left(e, \cos v, 1\right)}} \]
  15. Final simplification0.1

    \[\leadsto \frac{e \cdot \sin v}{\mathsf{fma}\left(e, \cos v, 1\right)} \]

Reproduce

herbie shell --seed 2022068 
(FPCore (e v)
  :name "Trigonometry A"
  :precision binary64
  :pre (and (<= 0.0 e) (<= e 1.0))
  (/ (* e (sin v)) (+ 1.0 (* e (cos v)))))