\frac{\left(\frac{8}{3} \cdot \sin \left(x \cdot 0.5\right)\right) \cdot \sin \left(x \cdot 0.5\right)}{\sin x}
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
\frac{-t_0}{\sin x} \cdot \frac{t_0}{-0.375}
\end{array}
(FPCore (x) :precision binary64 (/ (* (* (/ 8.0 3.0) (sin (* x 0.5))) (sin (* x 0.5))) (sin x)))
(FPCore (x) :precision binary64 (let* ((t_0 (sin (* x 0.5)))) (* (/ (- t_0) (sin x)) (/ t_0 -0.375))))
double code(double x) {
return (((8.0 / 3.0) * sin(x * 0.5)) * sin(x * 0.5)) / sin(x);
}
double code(double x) {
double t_0 = sin(x * 0.5);
return (-t_0 / sin(x)) * (t_0 / -0.375);
}




Bits error versus x
Results
| Original | 14.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 14.8
Simplified14.8
Applied associate-/l*_binary640.5
Applied clear-num_binary640.4
Applied frac-2neg_binary640.4
Simplified0.3
Applied neg-mul-1_binary640.3
Applied times-frac_binary640.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2021220
(FPCore (x)
:name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, A"
:precision binary64
:herbie-target
(/ (/ (* 8.0 (sin (* x 0.5))) 3.0) (/ (sin x) (sin (* x 0.5))))
(/ (* (* (/ 8.0 3.0) (sin (* x 0.5))) (sin (* x 0.5))) (sin x)))