Average Error: 14.8 → 0.3
Time: 4.6s
Precision: 64
\[\frac{\left(\frac{8}{3} \cdot \sin \left(x \cdot 0.5\right)\right) \cdot \sin \left(x \cdot 0.5\right)}{\sin x}\]
\[\frac{8 \cdot \sin \left(0.5 \cdot x\right)}{3 \cdot \frac{\sin x}{\sin \left(0.5 \cdot x\right)}}\]
\frac{\left(\frac{8}{3} \cdot \sin \left(x \cdot 0.5\right)\right) \cdot \sin \left(x \cdot 0.5\right)}{\sin x}
\frac{8 \cdot \sin \left(0.5 \cdot x\right)}{3 \cdot \frac{\sin x}{\sin \left(0.5 \cdot x\right)}}
double code(double x) {
	return ((((8.0 / 3.0) * sin((x * 0.5))) * sin((x * 0.5))) / sin(x));
}
double code(double x) {
	return ((8.0 * sin((0.5 * x))) / (3.0 * (sin(x) / sin((0.5 * x)))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original14.8
Target0.3
Herbie0.3
\[\frac{\frac{8 \cdot \sin \left(x \cdot 0.5\right)}{3}}{\frac{\sin x}{\sin \left(x \cdot 0.5\right)}}\]

Derivation

  1. Initial program 14.8

    \[\frac{\left(\frac{8}{3} \cdot \sin \left(x \cdot 0.5\right)\right) \cdot \sin \left(x \cdot 0.5\right)}{\sin x}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity14.8

    \[\leadsto \frac{\left(\frac{8}{3} \cdot \sin \left(x \cdot 0.5\right)\right) \cdot \sin \left(x \cdot 0.5\right)}{\color{blue}{1 \cdot \sin x}}\]
  4. Applied times-frac0.5

    \[\leadsto \color{blue}{\frac{\frac{8}{3} \cdot \sin \left(x \cdot 0.5\right)}{1} \cdot \frac{\sin \left(x \cdot 0.5\right)}{\sin x}}\]
  5. Simplified0.5

    \[\leadsto \color{blue}{\left(\frac{8}{3} \cdot \sin \left(x \cdot 0.5\right)\right)} \cdot \frac{\sin \left(x \cdot 0.5\right)}{\sin x}\]
  6. Simplified0.5

    \[\leadsto \left(\frac{8}{3} \cdot \sin \left(x \cdot 0.5\right)\right) \cdot \color{blue}{\frac{\sin \left(0.5 \cdot x\right)}{\sin x}}\]
  7. Using strategy rm
  8. Applied div-inv0.5

    \[\leadsto \left(\color{blue}{\left(8 \cdot \frac{1}{3}\right)} \cdot \sin \left(x \cdot 0.5\right)\right) \cdot \frac{\sin \left(0.5 \cdot x\right)}{\sin x}\]
  9. Applied associate-*l*0.5

    \[\leadsto \color{blue}{\left(8 \cdot \left(\frac{1}{3} \cdot \sin \left(x \cdot 0.5\right)\right)\right)} \cdot \frac{\sin \left(0.5 \cdot x\right)}{\sin x}\]
  10. Simplified0.3

    \[\leadsto \left(8 \cdot \color{blue}{\frac{\sin \left(0.5 \cdot x\right)}{3}}\right) \cdot \frac{\sin \left(0.5 \cdot x\right)}{\sin x}\]
  11. Using strategy rm
  12. Applied clear-num0.3

    \[\leadsto \left(8 \cdot \frac{\sin \left(0.5 \cdot x\right)}{3}\right) \cdot \color{blue}{\frac{1}{\frac{\sin x}{\sin \left(0.5 \cdot x\right)}}}\]
  13. Using strategy rm
  14. Applied associate-*r/0.3

    \[\leadsto \color{blue}{\frac{8 \cdot \sin \left(0.5 \cdot x\right)}{3}} \cdot \frac{1}{\frac{\sin x}{\sin \left(0.5 \cdot x\right)}}\]
  15. Applied frac-times0.3

    \[\leadsto \color{blue}{\frac{\left(8 \cdot \sin \left(0.5 \cdot x\right)\right) \cdot 1}{3 \cdot \frac{\sin x}{\sin \left(0.5 \cdot x\right)}}}\]
  16. Simplified0.3

    \[\leadsto \frac{\color{blue}{8 \cdot \sin \left(0.5 \cdot x\right)}}{3 \cdot \frac{\sin x}{\sin \left(0.5 \cdot x\right)}}\]
  17. Final simplification0.3

    \[\leadsto \frac{8 \cdot \sin \left(0.5 \cdot x\right)}{3 \cdot \frac{\sin x}{\sin \left(0.5 \cdot x\right)}}\]

Reproduce

herbie shell --seed 2020060 
(FPCore (x)
  :name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, A"
  :precision binary64

  :herbie-target
  (/ (/ (* 8 (sin (* x 0.5))) 3) (/ (sin x) (sin (* x 0.5))))

  (/ (* (* (/ 8 3) (sin (* x 0.5))) (sin (* x 0.5))) (sin x)))