\frac{\left(\frac{8}{3} \cdot \sin \left(x \cdot 0.5\right)\right) \cdot \sin \left(x \cdot 0.5\right)}{\sin x}\sin \left(x \cdot 0.5\right) \cdot \frac{\sqrt{2.6666666666666665} \cdot \left(\sin \left(x \cdot 0.5\right) \cdot \sqrt{2.6666666666666665}\right)}{\sin x}(FPCore (x) :precision binary64 (/ (* (* (/ 8.0 3.0) (sin (* x 0.5))) (sin (* x 0.5))) (sin x)))
(FPCore (x) :precision binary64 (* (sin (* x 0.5)) (/ (* (sqrt 2.6666666666666665) (* (sin (* x 0.5)) (sqrt 2.6666666666666665))) (sin x))))
double code(double x) {
return (((8.0 / 3.0) * sin(x * 0.5)) * sin(x * 0.5)) / sin(x);
}
double code(double x) {
return sin(x * 0.5) * ((sqrt(2.6666666666666665) * (sin(x * 0.5) * sqrt(2.6666666666666665))) / sin(x));
}




Bits error versus x
Results
| Original | 14.8 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
Initial program 14.8
Simplified14.8
rmApplied *-un-lft-identity_binary64_1576414.8
Applied times-frac_binary64_157700.5
Simplified0.5
Simplified0.5
rmApplied add-sqr-sqrt_binary64_157860.5
Applied associate-*r*_binary64_157040.4
Final simplification0.4
herbie shell --seed 2020295
(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)))