(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
(/
(* (sqrt 2.6666666666666665) (* t_0 (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) {
double t_0 = sin((x * 0.5));
return t_0 * ((sqrt(2.6666666666666665) * (t_0 * sqrt(2.6666666666666665))) / sin(x));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (((8.0d0 / 3.0d0) * sin((x * 0.5d0))) * sin((x * 0.5d0))) / sin(x)
end function
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: t_0
t_0 = sin((x * 0.5d0))
code = t_0 * ((sqrt(2.6666666666666665d0) * (t_0 * sqrt(2.6666666666666665d0))) / sin(x))
end function
public static double code(double x) {
return (((8.0 / 3.0) * Math.sin((x * 0.5))) * Math.sin((x * 0.5))) / Math.sin(x);
}
public static double code(double x) {
double t_0 = Math.sin((x * 0.5));
return t_0 * ((Math.sqrt(2.6666666666666665) * (t_0 * Math.sqrt(2.6666666666666665))) / Math.sin(x));
}
def code(x): return (((8.0 / 3.0) * math.sin((x * 0.5))) * math.sin((x * 0.5))) / math.sin(x)
def code(x): t_0 = math.sin((x * 0.5)) return t_0 * ((math.sqrt(2.6666666666666665) * (t_0 * math.sqrt(2.6666666666666665))) / math.sin(x))
function code(x) return Float64(Float64(Float64(Float64(8.0 / 3.0) * sin(Float64(x * 0.5))) * sin(Float64(x * 0.5))) / sin(x)) end
function code(x) t_0 = sin(Float64(x * 0.5)) return Float64(t_0 * Float64(Float64(sqrt(2.6666666666666665) * Float64(t_0 * sqrt(2.6666666666666665))) / sin(x))) end
function tmp = code(x) tmp = (((8.0 / 3.0) * sin((x * 0.5))) * sin((x * 0.5))) / sin(x); end
function tmp = code(x) t_0 = sin((x * 0.5)); tmp = t_0 * ((sqrt(2.6666666666666665) * (t_0 * sqrt(2.6666666666666665))) / sin(x)); end
code[x_] := N[(N[(N[(N[(8.0 / 3.0), $MachinePrecision] * N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[x], $MachinePrecision]), $MachinePrecision]
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(t$95$0 * N[(N[(N[Sqrt[2.6666666666666665], $MachinePrecision] * N[(t$95$0 * N[Sqrt[2.6666666666666665], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\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)\\
t_0 \cdot \frac{\sqrt{2.6666666666666665} \cdot \left(t_0 \cdot \sqrt{2.6666666666666665}\right)}{\sin x}
\end{array}




Bits error versus x
Results
| Original | 14.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
Initial program 14.7
Simplified14.7
Applied *-un-lft-identity_binary6414.7
Applied times-frac_binary640.5
Simplified0.5
Applied add-sqr-sqrt_binary640.5
Applied associate-*l*_binary640.5
Simplified0.5
Final simplification0.5
herbie shell --seed 2022129
(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)))