| Alternative 1 | |
|---|---|
| Error | 31.9 |
| Cost | 6656 |
\[{\left(\frac{1.5}{x}\right)}^{-1}
\]
(FPCore (x) :precision binary64 (/ (* (* (/ 8.0 3.0) (sin (* x 0.5))) (sin (* x 0.5))) (sin x)))
(FPCore (x) :precision binary64 (/ (tan (* x 0.5)) 0.75))
double code(double x) {
return (((8.0 / 3.0) * sin((x * 0.5))) * sin((x * 0.5))) / sin(x);
}
double code(double x) {
return tan((x * 0.5)) / 0.75;
}
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
code = tan((x * 0.5d0)) / 0.75d0
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) {
return Math.tan((x * 0.5)) / 0.75;
}
def code(x): return (((8.0 / 3.0) * math.sin((x * 0.5))) * math.sin((x * 0.5))) / math.sin(x)
def code(x): return math.tan((x * 0.5)) / 0.75
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) return Float64(tan(Float64(x * 0.5)) / 0.75) 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) tmp = tan((x * 0.5)) / 0.75; 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_] := N[(N[Tan[N[(x * 0.5), $MachinePrecision]], $MachinePrecision] / 0.75), $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}
\frac{\tan \left(x \cdot 0.5\right)}{0.75}
Results
| Original | 14.2 |
|---|---|
| Target | 0.3 |
| Herbie | 0.1 |
Initial program 14.2
Simplified14.2
Applied egg-rr29.7
Applied egg-rr1.0
Applied egg-rr0.1
Final simplification0.1
| Alternative 1 | |
|---|---|
| Error | 31.9 |
| Cost | 6656 |
| Alternative 2 | |
|---|---|
| Error | 31.9 |
| Cost | 320 |
| Alternative 3 | |
|---|---|
| Error | 31.9 |
| Cost | 192 |

herbie shell --seed 2022295
(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)))