Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, A

Percentage Accurate: 77.2% → 99.8%
Time: 11.4s
Alternatives: 5
Speedup: 3.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(x \cdot 0.5\right)\\ \frac{\left(\frac{8}{3} \cdot t\_0\right) \cdot t\_0}{\sin x} \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (sin (* x 0.5)))) (/ (* (* (/ 8.0 3.0) t_0) t_0) (sin x))))
double code(double x) {
	double t_0 = sin((x * 0.5));
	return (((8.0 / 3.0) * t_0) * t_0) / sin(x);
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    t_0 = sin((x * 0.5d0))
    code = (((8.0d0 / 3.0d0) * t_0) * t_0) / sin(x)
end function
public static double code(double x) {
	double t_0 = Math.sin((x * 0.5));
	return (((8.0 / 3.0) * t_0) * t_0) / Math.sin(x);
}
def code(x):
	t_0 = math.sin((x * 0.5))
	return (((8.0 / 3.0) * t_0) * t_0) / math.sin(x)
function code(x)
	t_0 = sin(Float64(x * 0.5))
	return Float64(Float64(Float64(Float64(8.0 / 3.0) * t_0) * t_0) / sin(x))
end
function tmp = code(x)
	t_0 = sin((x * 0.5));
	tmp = (((8.0 / 3.0) * t_0) * t_0) / sin(x);
end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[(N[(8.0 / 3.0), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision] / N[Sin[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
\frac{\left(\frac{8}{3} \cdot t\_0\right) \cdot t\_0}{\sin x}
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 5 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 77.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(x \cdot 0.5\right)\\ \frac{\left(\frac{8}{3} \cdot t\_0\right) \cdot t\_0}{\sin x} \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (sin (* x 0.5)))) (/ (* (* (/ 8.0 3.0) t_0) t_0) (sin x))))
double code(double x) {
	double t_0 = sin((x * 0.5));
	return (((8.0 / 3.0) * t_0) * t_0) / sin(x);
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    t_0 = sin((x * 0.5d0))
    code = (((8.0d0 / 3.0d0) * t_0) * t_0) / sin(x)
end function
public static double code(double x) {
	double t_0 = Math.sin((x * 0.5));
	return (((8.0 / 3.0) * t_0) * t_0) / Math.sin(x);
}
def code(x):
	t_0 = math.sin((x * 0.5))
	return (((8.0 / 3.0) * t_0) * t_0) / math.sin(x)
function code(x)
	t_0 = sin(Float64(x * 0.5))
	return Float64(Float64(Float64(Float64(8.0 / 3.0) * t_0) * t_0) / sin(x))
end
function tmp = code(x)
	t_0 = sin((x * 0.5));
	tmp = (((8.0 / 3.0) * t_0) * t_0) / sin(x);
end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[(N[(8.0 / 3.0), $MachinePrecision] * t$95$0), $MachinePrecision] * t$95$0), $MachinePrecision] / N[Sin[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
\frac{\left(\frac{8}{3} \cdot t\_0\right) \cdot t\_0}{\sin x}
\end{array}
\end{array}

Alternative 1: 99.8% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \frac{\tan \left(\frac{x}{2}\right)}{0.75} \end{array} \]
(FPCore (x) :precision binary64 (/ (tan (/ x 2.0)) 0.75))
double code(double x) {
	return tan((x / 2.0)) / 0.75;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = tan((x / 2.0d0)) / 0.75d0
end function
public static double code(double x) {
	return Math.tan((x / 2.0)) / 0.75;
}
def code(x):
	return math.tan((x / 2.0)) / 0.75
function code(x)
	return Float64(tan(Float64(x / 2.0)) / 0.75)
end
function tmp = code(x)
	tmp = tan((x / 2.0)) / 0.75;
end
code[x_] := N[(N[Tan[N[(x / 2.0), $MachinePrecision]], $MachinePrecision] / 0.75), $MachinePrecision]
\begin{array}{l}

\\
\frac{\tan \left(\frac{x}{2}\right)}{0.75}
\end{array}
Derivation
  1. Initial program 75.7%

    \[\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. Step-by-step derivation
    1. associate-/l*N/A

      \[\leadsto \left(\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)\right) \cdot \color{blue}{\frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}} \]
    2. *-commutativeN/A

      \[\leadsto \left(\sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{8}{3}\right) \cdot \frac{\color{blue}{\sin \left(x \cdot \frac{1}{2}\right)}}{\sin x} \]
    3. associate-*l*N/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \color{blue}{\left(\frac{8}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)} \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\sin \left(x \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{8}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)}\right) \]
    5. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\left(x \cdot \frac{1}{2}\right)\right), \left(\color{blue}{\frac{8}{3}} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\color{blue}{8}}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)\right) \]
    7. associate-*r/N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)}{\color{blue}{\sin x}}\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{8}{3}}{\sin \color{blue}{x}}\right)\right) \]
    9. associate-/l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\sin \left(x \cdot \frac{1}{2}\right) \cdot \color{blue}{\frac{\frac{8}{3}}{\sin x}}\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\sin \left(x \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{\frac{8}{3}}{\sin x}\right)}\right)\right) \]
    11. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\left(x \cdot \frac{1}{2}\right)\right), \left(\frac{\color{blue}{\frac{8}{3}}}{\sin x}\right)\right)\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\frac{\color{blue}{8}}{3}}{\sin x}\right)\right)\right) \]
    13. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\left(\frac{8}{3}\right), \color{blue}{\sin x}\right)\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\frac{8}{3}, \sin \color{blue}{x}\right)\right)\right) \]
    15. sin-lowering-sin.f6499.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\frac{8}{3}, \mathsf{sin.f64}\left(x\right)\right)\right)\right) \]
  3. Simplified99.2%

    \[\leadsto \color{blue}{\sin \left(x \cdot 0.5\right) \cdot \left(\sin \left(x \cdot 0.5\right) \cdot \frac{2.6666666666666665}{\sin x}\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. clear-numN/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \left(\sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{1}{\color{blue}{\frac{\sin x}{\frac{8}{3}}}}\right) \]
    2. un-div-invN/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\color{blue}{\frac{\sin x}{\frac{8}{3}}}} \]
    3. associate-*r/N/A

      \[\leadsto \frac{\sin \left(x \cdot \frac{1}{2}\right) \cdot \sin \left(x \cdot \frac{1}{2}\right)}{\color{blue}{\frac{\sin x}{\frac{8}{3}}}} \]
    4. sin-multN/A

      \[\leadsto \frac{\frac{\cos \left(x \cdot \frac{1}{2} - x \cdot \frac{1}{2}\right) - \cos \left(x \cdot \frac{1}{2} + x \cdot \frac{1}{2}\right)}{2}}{\frac{\color{blue}{\sin x}}{\frac{8}{3}}} \]
    5. div-invN/A

      \[\leadsto \frac{\left(\cos \left(x \cdot \frac{1}{2} - x \cdot \frac{1}{2}\right) - \cos \left(x \cdot \frac{1}{2} + x \cdot \frac{1}{2}\right)\right) \cdot \frac{1}{2}}{\frac{\color{blue}{\sin x}}{\frac{8}{3}}} \]
    6. metadata-evalN/A

      \[\leadsto \frac{\left(\cos \left(x \cdot \frac{1}{2} - x \cdot \frac{1}{2}\right) - \cos \left(x \cdot \frac{1}{2} + x \cdot \frac{1}{2}\right)\right) \cdot \frac{1}{2}}{\frac{\sin x}{\frac{8}{3}}} \]
    7. associate-/l*N/A

      \[\leadsto \left(\cos \left(x \cdot \frac{1}{2} - x \cdot \frac{1}{2}\right) - \cos \left(x \cdot \frac{1}{2} + x \cdot \frac{1}{2}\right)\right) \cdot \color{blue}{\frac{\frac{1}{2}}{\frac{\sin x}{\frac{8}{3}}}} \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\cos \left(x \cdot \frac{1}{2} - x \cdot \frac{1}{2}\right) - \cos \left(x \cdot \frac{1}{2} + x \cdot \frac{1}{2}\right)\right), \color{blue}{\left(\frac{\frac{1}{2}}{\frac{\sin x}{\frac{8}{3}}}\right)}\right) \]
  6. Applied egg-rr54.0%

    \[\leadsto \color{blue}{\left(1 - \cos x\right) \cdot \frac{1.3333333333333333}{\sin x}} \]
  7. Step-by-step derivation
    1. clear-numN/A

      \[\leadsto \left(1 - \cos x\right) \cdot \frac{1}{\color{blue}{\frac{\sin x}{\frac{4}{3}}}} \]
    2. un-div-invN/A

      \[\leadsto \frac{1 - \cos x}{\color{blue}{\frac{\sin x}{\frac{4}{3}}}} \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(1 - \cos x\right), \color{blue}{\left(\frac{\sin x}{\frac{4}{3}}\right)}\right) \]
    4. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \cos x\right), \left(\frac{\color{blue}{\sin x}}{\frac{4}{3}}\right)\right) \]
    5. cos-lowering-cos.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{cos.f64}\left(x\right)\right), \left(\frac{\sin x}{\frac{4}{3}}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{cos.f64}\left(x\right)\right), \mathsf{/.f64}\left(\sin x, \color{blue}{\frac{4}{3}}\right)\right) \]
    7. sin-lowering-sin.f6454.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{cos.f64}\left(x\right)\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(x\right), \frac{4}{3}\right)\right) \]
  8. Applied egg-rr54.0%

    \[\leadsto \color{blue}{\frac{1 - \cos x}{\frac{\sin x}{1.3333333333333333}}} \]
  9. Step-by-step derivation
    1. div-invN/A

      \[\leadsto \frac{1 - \cos x}{\sin x \cdot \color{blue}{\frac{1}{\frac{4}{3}}}} \]
    2. associate-/r*N/A

      \[\leadsto \frac{\frac{1 - \cos x}{\sin x}}{\color{blue}{\frac{1}{\frac{4}{3}}}} \]
    3. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{1 - \cos x}{\sin x}\right), \color{blue}{\left(\frac{1}{\frac{4}{3}}\right)}\right) \]
    4. hang-p0-tanN/A

      \[\leadsto \mathsf{/.f64}\left(\tan \left(\frac{x}{2}\right), \left(\frac{\color{blue}{1}}{\frac{4}{3}}\right)\right) \]
    5. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{tan.f64}\left(\left(\frac{x}{2}\right)\right), \left(\frac{\color{blue}{1}}{\frac{4}{3}}\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{tan.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right), \left(\frac{1}{\frac{4}{3}}\right)\right) \]
    7. metadata-eval99.8%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{tan.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right), \frac{3}{4}\right) \]
  10. Applied egg-rr99.8%

    \[\leadsto \color{blue}{\frac{\tan \left(\frac{x}{2}\right)}{0.75}} \]
  11. Add Preprocessing

Alternative 2: 99.4% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \tan \left(\frac{x}{2}\right) \cdot 1.3333333333333333 \end{array} \]
(FPCore (x) :precision binary64 (* (tan (/ x 2.0)) 1.3333333333333333))
double code(double x) {
	return tan((x / 2.0)) * 1.3333333333333333;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = tan((x / 2.0d0)) * 1.3333333333333333d0
end function
public static double code(double x) {
	return Math.tan((x / 2.0)) * 1.3333333333333333;
}
def code(x):
	return math.tan((x / 2.0)) * 1.3333333333333333
function code(x)
	return Float64(tan(Float64(x / 2.0)) * 1.3333333333333333)
end
function tmp = code(x)
	tmp = tan((x / 2.0)) * 1.3333333333333333;
end
code[x_] := N[(N[Tan[N[(x / 2.0), $MachinePrecision]], $MachinePrecision] * 1.3333333333333333), $MachinePrecision]
\begin{array}{l}

\\
\tan \left(\frac{x}{2}\right) \cdot 1.3333333333333333
\end{array}
Derivation
  1. Initial program 75.7%

    \[\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. Step-by-step derivation
    1. associate-/l*N/A

      \[\leadsto \left(\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)\right) \cdot \color{blue}{\frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}} \]
    2. *-commutativeN/A

      \[\leadsto \left(\sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{8}{3}\right) \cdot \frac{\color{blue}{\sin \left(x \cdot \frac{1}{2}\right)}}{\sin x} \]
    3. associate-*l*N/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \color{blue}{\left(\frac{8}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)} \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\sin \left(x \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{8}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)}\right) \]
    5. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\left(x \cdot \frac{1}{2}\right)\right), \left(\color{blue}{\frac{8}{3}} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\color{blue}{8}}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)\right) \]
    7. associate-*r/N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)}{\color{blue}{\sin x}}\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{8}{3}}{\sin \color{blue}{x}}\right)\right) \]
    9. associate-/l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\sin \left(x \cdot \frac{1}{2}\right) \cdot \color{blue}{\frac{\frac{8}{3}}{\sin x}}\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\sin \left(x \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{\frac{8}{3}}{\sin x}\right)}\right)\right) \]
    11. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\left(x \cdot \frac{1}{2}\right)\right), \left(\frac{\color{blue}{\frac{8}{3}}}{\sin x}\right)\right)\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\frac{\color{blue}{8}}{3}}{\sin x}\right)\right)\right) \]
    13. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\left(\frac{8}{3}\right), \color{blue}{\sin x}\right)\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\frac{8}{3}, \sin \color{blue}{x}\right)\right)\right) \]
    15. sin-lowering-sin.f6499.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\frac{8}{3}, \mathsf{sin.f64}\left(x\right)\right)\right)\right) \]
  3. Simplified99.2%

    \[\leadsto \color{blue}{\sin \left(x \cdot 0.5\right) \cdot \left(\sin \left(x \cdot 0.5\right) \cdot \frac{2.6666666666666665}{\sin x}\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. clear-numN/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \left(\sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{1}{\color{blue}{\frac{\sin x}{\frac{8}{3}}}}\right) \]
    2. un-div-invN/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\color{blue}{\frac{\sin x}{\frac{8}{3}}}} \]
    3. associate-*r/N/A

      \[\leadsto \frac{\sin \left(x \cdot \frac{1}{2}\right) \cdot \sin \left(x \cdot \frac{1}{2}\right)}{\color{blue}{\frac{\sin x}{\frac{8}{3}}}} \]
    4. sin-multN/A

      \[\leadsto \frac{\frac{\cos \left(x \cdot \frac{1}{2} - x \cdot \frac{1}{2}\right) - \cos \left(x \cdot \frac{1}{2} + x \cdot \frac{1}{2}\right)}{2}}{\frac{\color{blue}{\sin x}}{\frac{8}{3}}} \]
    5. div-invN/A

      \[\leadsto \frac{\left(\cos \left(x \cdot \frac{1}{2} - x \cdot \frac{1}{2}\right) - \cos \left(x \cdot \frac{1}{2} + x \cdot \frac{1}{2}\right)\right) \cdot \frac{1}{2}}{\frac{\color{blue}{\sin x}}{\frac{8}{3}}} \]
    6. metadata-evalN/A

      \[\leadsto \frac{\left(\cos \left(x \cdot \frac{1}{2} - x \cdot \frac{1}{2}\right) - \cos \left(x \cdot \frac{1}{2} + x \cdot \frac{1}{2}\right)\right) \cdot \frac{1}{2}}{\frac{\sin x}{\frac{8}{3}}} \]
    7. associate-/l*N/A

      \[\leadsto \left(\cos \left(x \cdot \frac{1}{2} - x \cdot \frac{1}{2}\right) - \cos \left(x \cdot \frac{1}{2} + x \cdot \frac{1}{2}\right)\right) \cdot \color{blue}{\frac{\frac{1}{2}}{\frac{\sin x}{\frac{8}{3}}}} \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\cos \left(x \cdot \frac{1}{2} - x \cdot \frac{1}{2}\right) - \cos \left(x \cdot \frac{1}{2} + x \cdot \frac{1}{2}\right)\right), \color{blue}{\left(\frac{\frac{1}{2}}{\frac{\sin x}{\frac{8}{3}}}\right)}\right) \]
  6. Applied egg-rr54.0%

    \[\leadsto \color{blue}{\left(1 - \cos x\right) \cdot \frac{1.3333333333333333}{\sin x}} \]
  7. Taylor expanded in x around inf

    \[\leadsto \color{blue}{\frac{4}{3} \cdot \frac{1 - \cos x}{\sin x}} \]
  8. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\frac{4}{3}, \color{blue}{\left(\frac{1 - \cos x}{\sin x}\right)}\right) \]
    2. hang-p0-tanN/A

      \[\leadsto \mathsf{*.f64}\left(\frac{4}{3}, \tan \left(\frac{x}{2}\right)\right) \]
    3. *-rgt-identityN/A

      \[\leadsto \mathsf{*.f64}\left(\frac{4}{3}, \tan \left(\frac{x \cdot 1}{2}\right)\right) \]
    4. associate-/l*N/A

      \[\leadsto \mathsf{*.f64}\left(\frac{4}{3}, \tan \left(x \cdot \frac{1}{2}\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\frac{4}{3}, \tan \left(x \cdot \frac{1}{2}\right)\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\frac{4}{3}, \tan \left(\frac{1}{2} \cdot x\right)\right) \]
    7. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\frac{4}{3}, \mathsf{tan.f64}\left(\left(\frac{1}{2} \cdot x\right)\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\frac{4}{3}, \mathsf{tan.f64}\left(\left(x \cdot \frac{1}{2}\right)\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\frac{4}{3}, \mathsf{tan.f64}\left(\left(x \cdot \frac{1}{2}\right)\right)\right) \]
    10. associate-/l*N/A

      \[\leadsto \mathsf{*.f64}\left(\frac{4}{3}, \mathsf{tan.f64}\left(\left(\frac{x \cdot 1}{2}\right)\right)\right) \]
    11. *-rgt-identityN/A

      \[\leadsto \mathsf{*.f64}\left(\frac{4}{3}, \mathsf{tan.f64}\left(\left(\frac{x}{2}\right)\right)\right) \]
    12. /-lowering-/.f6499.4%

      \[\leadsto \mathsf{*.f64}\left(\frac{4}{3}, \mathsf{tan.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right) \]
  9. Simplified99.4%

    \[\leadsto \color{blue}{1.3333333333333333 \cdot \tan \left(\frac{x}{2}\right)} \]
  10. Final simplification99.4%

    \[\leadsto \tan \left(\frac{x}{2}\right) \cdot 1.3333333333333333 \]
  11. Add Preprocessing

Alternative 3: 50.7% accurate, 62.6× speedup?

\[\begin{array}{l} \\ \frac{x \cdot -0.25}{-0.375} \end{array} \]
(FPCore (x) :precision binary64 (/ (* x -0.25) -0.375))
double code(double x) {
	return (x * -0.25) / -0.375;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = (x * (-0.25d0)) / (-0.375d0)
end function
public static double code(double x) {
	return (x * -0.25) / -0.375;
}
def code(x):
	return (x * -0.25) / -0.375
function code(x)
	return Float64(Float64(x * -0.25) / -0.375)
end
function tmp = code(x)
	tmp = (x * -0.25) / -0.375;
end
code[x_] := N[(N[(x * -0.25), $MachinePrecision] / -0.375), $MachinePrecision]
\begin{array}{l}

\\
\frac{x \cdot -0.25}{-0.375}
\end{array}
Derivation
  1. Initial program 75.7%

    \[\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. Step-by-step derivation
    1. associate-/l*N/A

      \[\leadsto \left(\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)\right) \cdot \color{blue}{\frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}} \]
    2. *-commutativeN/A

      \[\leadsto \left(\sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{8}{3}\right) \cdot \frac{\color{blue}{\sin \left(x \cdot \frac{1}{2}\right)}}{\sin x} \]
    3. associate-*l*N/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \color{blue}{\left(\frac{8}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)} \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\sin \left(x \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{8}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)}\right) \]
    5. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\left(x \cdot \frac{1}{2}\right)\right), \left(\color{blue}{\frac{8}{3}} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\color{blue}{8}}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)\right) \]
    7. associate-*r/N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)}{\color{blue}{\sin x}}\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{8}{3}}{\sin \color{blue}{x}}\right)\right) \]
    9. associate-/l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\sin \left(x \cdot \frac{1}{2}\right) \cdot \color{blue}{\frac{\frac{8}{3}}{\sin x}}\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\sin \left(x \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{\frac{8}{3}}{\sin x}\right)}\right)\right) \]
    11. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\left(x \cdot \frac{1}{2}\right)\right), \left(\frac{\color{blue}{\frac{8}{3}}}{\sin x}\right)\right)\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\frac{\color{blue}{8}}{3}}{\sin x}\right)\right)\right) \]
    13. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\left(\frac{8}{3}\right), \color{blue}{\sin x}\right)\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\frac{8}{3}, \sin \color{blue}{x}\right)\right)\right) \]
    15. sin-lowering-sin.f6499.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\frac{8}{3}, \mathsf{sin.f64}\left(x\right)\right)\right)\right) \]
  3. Simplified99.2%

    \[\leadsto \color{blue}{\sin \left(x \cdot 0.5\right) \cdot \left(\sin \left(x \cdot 0.5\right) \cdot \frac{2.6666666666666665}{\sin x}\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{8}{3}}{\color{blue}{\sin x}} \]
    2. *-commutativeN/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)}{\sin \color{blue}{x}} \]
    3. metadata-evalN/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)}{\sin x} \]
    4. associate-*r/N/A

      \[\leadsto \frac{\sin \left(x \cdot \frac{1}{2}\right) \cdot \left(\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)\right)}{\color{blue}{\sin x}} \]
    5. associate-*l/N/A

      \[\leadsto \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x} \cdot \color{blue}{\left(\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)\right)} \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right), \color{blue}{\left(\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)\right)}\right) \]
  6. Applied egg-rr99.5%

    \[\leadsto \color{blue}{\frac{\sin \left(\frac{x}{2}\right)}{\sin x} \cdot \frac{\sin \left(\frac{x}{2}\right)}{0.375}} \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \frac{\sin \left(\frac{x}{2}\right)}{\frac{3}{8}} \cdot \color{blue}{\frac{\sin \left(\frac{x}{2}\right)}{\sin x}} \]
    2. frac-2negN/A

      \[\leadsto \frac{\mathsf{neg}\left(\sin \left(\frac{x}{2}\right)\right)}{\mathsf{neg}\left(\frac{3}{8}\right)} \cdot \frac{\color{blue}{\sin \left(\frac{x}{2}\right)}}{\sin x} \]
    3. associate-*l/N/A

      \[\leadsto \frac{\left(\mathsf{neg}\left(\sin \left(\frac{x}{2}\right)\right)\right) \cdot \frac{\sin \left(\frac{x}{2}\right)}{\sin x}}{\color{blue}{\mathsf{neg}\left(\frac{3}{8}\right)}} \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\sin \left(\frac{x}{2}\right)\right)\right) \cdot \frac{\sin \left(\frac{x}{2}\right)}{\sin x}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{3}{8}\right)\right)}\right) \]
    5. clear-numN/A

      \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\sin \left(\frac{x}{2}\right)\right)\right) \cdot \frac{1}{\frac{\sin x}{\sin \left(\frac{x}{2}\right)}}\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    6. un-div-invN/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\mathsf{neg}\left(\sin \left(\frac{x}{2}\right)\right)}{\frac{\sin x}{\sin \left(\frac{x}{2}\right)}}\right), \left(\mathsf{neg}\left(\color{blue}{\frac{3}{8}}\right)\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\sin \left(\frac{x}{2}\right)\right)\right), \left(\frac{\sin x}{\sin \left(\frac{x}{2}\right)}\right)\right), \left(\mathsf{neg}\left(\color{blue}{\frac{3}{8}}\right)\right)\right) \]
    8. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(0 - \sin \left(\frac{x}{2}\right)\right), \left(\frac{\sin x}{\sin \left(\frac{x}{2}\right)}\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    9. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \sin \left(\frac{x}{2}\right)\right), \left(\frac{\sin x}{\sin \left(\frac{x}{2}\right)}\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    10. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(\left(\frac{x}{2}\right)\right)\right), \left(\frac{\sin x}{\sin \left(\frac{x}{2}\right)}\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    11. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right), \left(\frac{\sin x}{\sin \left(\frac{x}{2}\right)}\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    12. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right), \mathsf{/.f64}\left(\sin x, \sin \left(\frac{x}{2}\right)\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    13. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(x\right), \sin \left(\frac{x}{2}\right)\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    14. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(x\right), \mathsf{sin.f64}\left(\left(\frac{x}{2}\right)\right)\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    15. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(x\right), \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    16. metadata-eval99.5%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(x\right), \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right)\right), \frac{-3}{8}\right) \]
  8. Applied egg-rr99.5%

    \[\leadsto \color{blue}{\frac{\frac{0 - \sin \left(\frac{x}{2}\right)}{\frac{\sin x}{\sin \left(\frac{x}{2}\right)}}}{-0.375}} \]
  9. Taylor expanded in x around 0

    \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{-1}{4} \cdot x\right)}, \frac{-3}{8}\right) \]
  10. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\left(x \cdot \frac{-1}{4}\right), \frac{-3}{8}\right) \]
    2. *-lowering-*.f6449.9%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \frac{-1}{4}\right), \frac{-3}{8}\right) \]
  11. Simplified49.9%

    \[\leadsto \frac{\color{blue}{x \cdot -0.25}}{-0.375} \]
  12. Add Preprocessing

Alternative 4: 50.5% accurate, 62.6× speedup?

\[\begin{array}{l} \\ \frac{1}{\frac{1.5}{x}} \end{array} \]
(FPCore (x) :precision binary64 (/ 1.0 (/ 1.5 x)))
double code(double x) {
	return 1.0 / (1.5 / x);
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = 1.0d0 / (1.5d0 / x)
end function
public static double code(double x) {
	return 1.0 / (1.5 / x);
}
def code(x):
	return 1.0 / (1.5 / x)
function code(x)
	return Float64(1.0 / Float64(1.5 / x))
end
function tmp = code(x)
	tmp = 1.0 / (1.5 / x);
end
code[x_] := N[(1.0 / N[(1.5 / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{\frac{1.5}{x}}
\end{array}
Derivation
  1. Initial program 75.7%

    \[\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. Step-by-step derivation
    1. associate-/l*N/A

      \[\leadsto \left(\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)\right) \cdot \color{blue}{\frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}} \]
    2. *-commutativeN/A

      \[\leadsto \left(\sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{8}{3}\right) \cdot \frac{\color{blue}{\sin \left(x \cdot \frac{1}{2}\right)}}{\sin x} \]
    3. associate-*l*N/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \color{blue}{\left(\frac{8}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)} \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\sin \left(x \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{8}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)}\right) \]
    5. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\left(x \cdot \frac{1}{2}\right)\right), \left(\color{blue}{\frac{8}{3}} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\color{blue}{8}}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)\right) \]
    7. associate-*r/N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)}{\color{blue}{\sin x}}\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{8}{3}}{\sin \color{blue}{x}}\right)\right) \]
    9. associate-/l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\sin \left(x \cdot \frac{1}{2}\right) \cdot \color{blue}{\frac{\frac{8}{3}}{\sin x}}\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\sin \left(x \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{\frac{8}{3}}{\sin x}\right)}\right)\right) \]
    11. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\left(x \cdot \frac{1}{2}\right)\right), \left(\frac{\color{blue}{\frac{8}{3}}}{\sin x}\right)\right)\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\frac{\color{blue}{8}}{3}}{\sin x}\right)\right)\right) \]
    13. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\left(\frac{8}{3}\right), \color{blue}{\sin x}\right)\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\frac{8}{3}, \sin \color{blue}{x}\right)\right)\right) \]
    15. sin-lowering-sin.f6499.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\frac{8}{3}, \mathsf{sin.f64}\left(x\right)\right)\right)\right) \]
  3. Simplified99.2%

    \[\leadsto \color{blue}{\sin \left(x \cdot 0.5\right) \cdot \left(\sin \left(x \cdot 0.5\right) \cdot \frac{2.6666666666666665}{\sin x}\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. associate-*r/N/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{8}{3}}{\color{blue}{\sin x}} \]
    2. *-commutativeN/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)}{\sin \color{blue}{x}} \]
    3. metadata-evalN/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)}{\sin x} \]
    4. associate-*r/N/A

      \[\leadsto \frac{\sin \left(x \cdot \frac{1}{2}\right) \cdot \left(\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)\right)}{\color{blue}{\sin x}} \]
    5. associate-*l/N/A

      \[\leadsto \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x} \cdot \color{blue}{\left(\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)\right)} \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right), \color{blue}{\left(\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)\right)}\right) \]
  6. Applied egg-rr99.5%

    \[\leadsto \color{blue}{\frac{\sin \left(\frac{x}{2}\right)}{\sin x} \cdot \frac{\sin \left(\frac{x}{2}\right)}{0.375}} \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \frac{\sin \left(\frac{x}{2}\right)}{\frac{3}{8}} \cdot \color{blue}{\frac{\sin \left(\frac{x}{2}\right)}{\sin x}} \]
    2. frac-2negN/A

      \[\leadsto \frac{\mathsf{neg}\left(\sin \left(\frac{x}{2}\right)\right)}{\mathsf{neg}\left(\frac{3}{8}\right)} \cdot \frac{\color{blue}{\sin \left(\frac{x}{2}\right)}}{\sin x} \]
    3. associate-*l/N/A

      \[\leadsto \frac{\left(\mathsf{neg}\left(\sin \left(\frac{x}{2}\right)\right)\right) \cdot \frac{\sin \left(\frac{x}{2}\right)}{\sin x}}{\color{blue}{\mathsf{neg}\left(\frac{3}{8}\right)}} \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\sin \left(\frac{x}{2}\right)\right)\right) \cdot \frac{\sin \left(\frac{x}{2}\right)}{\sin x}\right), \color{blue}{\left(\mathsf{neg}\left(\frac{3}{8}\right)\right)}\right) \]
    5. clear-numN/A

      \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\sin \left(\frac{x}{2}\right)\right)\right) \cdot \frac{1}{\frac{\sin x}{\sin \left(\frac{x}{2}\right)}}\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    6. un-div-invN/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{\mathsf{neg}\left(\sin \left(\frac{x}{2}\right)\right)}{\frac{\sin x}{\sin \left(\frac{x}{2}\right)}}\right), \left(\mathsf{neg}\left(\color{blue}{\frac{3}{8}}\right)\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(\sin \left(\frac{x}{2}\right)\right)\right), \left(\frac{\sin x}{\sin \left(\frac{x}{2}\right)}\right)\right), \left(\mathsf{neg}\left(\color{blue}{\frac{3}{8}}\right)\right)\right) \]
    8. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(0 - \sin \left(\frac{x}{2}\right)\right), \left(\frac{\sin x}{\sin \left(\frac{x}{2}\right)}\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    9. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \sin \left(\frac{x}{2}\right)\right), \left(\frac{\sin x}{\sin \left(\frac{x}{2}\right)}\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    10. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(\left(\frac{x}{2}\right)\right)\right), \left(\frac{\sin x}{\sin \left(\frac{x}{2}\right)}\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    11. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right), \left(\frac{\sin x}{\sin \left(\frac{x}{2}\right)}\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    12. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right), \mathsf{/.f64}\left(\sin x, \sin \left(\frac{x}{2}\right)\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    13. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(x\right), \sin \left(\frac{x}{2}\right)\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    14. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(x\right), \mathsf{sin.f64}\left(\left(\frac{x}{2}\right)\right)\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    15. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(x\right), \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right)\right), \left(\mathsf{neg}\left(\frac{3}{8}\right)\right)\right) \]
    16. metadata-eval99.5%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(x\right), \mathsf{sin.f64}\left(\mathsf{/.f64}\left(x, 2\right)\right)\right)\right), \frac{-3}{8}\right) \]
  8. Applied egg-rr99.5%

    \[\leadsto \color{blue}{\frac{\frac{0 - \sin \left(\frac{x}{2}\right)}{\frac{\sin x}{\sin \left(\frac{x}{2}\right)}}}{-0.375}} \]
  9. Taylor expanded in x around 0

    \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(\frac{-1}{4} \cdot x\right)}, \frac{-3}{8}\right) \]
  10. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\left(x \cdot \frac{-1}{4}\right), \frac{-3}{8}\right) \]
    2. *-lowering-*.f6449.9%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \frac{-1}{4}\right), \frac{-3}{8}\right) \]
  11. Simplified49.9%

    \[\leadsto \frac{\color{blue}{x \cdot -0.25}}{-0.375} \]
  12. Step-by-step derivation
    1. clear-numN/A

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{-3}{8}}{x \cdot \frac{-1}{4}}}} \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\frac{-3}{8}}{x \cdot \frac{-1}{4}}\right)}\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\frac{-3}{8}}{\frac{-1}{4} \cdot \color{blue}{x}}\right)\right) \]
    4. associate-/r*N/A

      \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\frac{\frac{-3}{8}}{\frac{-1}{4}}}{\color{blue}{x}}\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\frac{3}{2}}{x}\right)\right) \]
    6. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\frac{3}{2}}{x}\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{3}{2}\right), \color{blue}{x}\right)\right) \]
    8. metadata-eval49.7%

      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\frac{3}{2}, x\right)\right) \]
  13. Applied egg-rr49.7%

    \[\leadsto \color{blue}{\frac{1}{\frac{1.5}{x}}} \]
  14. Add Preprocessing

Alternative 5: 50.4% accurate, 104.3× speedup?

\[\begin{array}{l} \\ x \cdot 0.6666666666666666 \end{array} \]
(FPCore (x) :precision binary64 (* x 0.6666666666666666))
double code(double x) {
	return x * 0.6666666666666666;
}
real(8) function code(x)
    real(8), intent (in) :: x
    code = x * 0.6666666666666666d0
end function
public static double code(double x) {
	return x * 0.6666666666666666;
}
def code(x):
	return x * 0.6666666666666666
function code(x)
	return Float64(x * 0.6666666666666666)
end
function tmp = code(x)
	tmp = x * 0.6666666666666666;
end
code[x_] := N[(x * 0.6666666666666666), $MachinePrecision]
\begin{array}{l}

\\
x \cdot 0.6666666666666666
\end{array}
Derivation
  1. Initial program 75.7%

    \[\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. Step-by-step derivation
    1. associate-/l*N/A

      \[\leadsto \left(\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)\right) \cdot \color{blue}{\frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}} \]
    2. *-commutativeN/A

      \[\leadsto \left(\sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{8}{3}\right) \cdot \frac{\color{blue}{\sin \left(x \cdot \frac{1}{2}\right)}}{\sin x} \]
    3. associate-*l*N/A

      \[\leadsto \sin \left(x \cdot \frac{1}{2}\right) \cdot \color{blue}{\left(\frac{8}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)} \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\sin \left(x \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{8}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)}\right) \]
    5. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\left(x \cdot \frac{1}{2}\right)\right), \left(\color{blue}{\frac{8}{3}} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\color{blue}{8}}{3} \cdot \frac{\sin \left(x \cdot \frac{1}{2}\right)}{\sin x}\right)\right) \]
    7. associate-*r/N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\frac{8}{3} \cdot \sin \left(x \cdot \frac{1}{2}\right)}{\color{blue}{\sin x}}\right)\right) \]
    8. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\sin \left(x \cdot \frac{1}{2}\right) \cdot \frac{8}{3}}{\sin \color{blue}{x}}\right)\right) \]
    9. associate-/l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\sin \left(x \cdot \frac{1}{2}\right) \cdot \color{blue}{\frac{\frac{8}{3}}{\sin x}}\right)\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\sin \left(x \cdot \frac{1}{2}\right), \color{blue}{\left(\frac{\frac{8}{3}}{\sin x}\right)}\right)\right) \]
    11. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\left(x \cdot \frac{1}{2}\right)\right), \left(\frac{\color{blue}{\frac{8}{3}}}{\sin x}\right)\right)\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \left(\frac{\frac{\color{blue}{8}}{3}}{\sin x}\right)\right)\right) \]
    13. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\left(\frac{8}{3}\right), \color{blue}{\sin x}\right)\right)\right) \]
    14. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\frac{8}{3}, \sin \color{blue}{x}\right)\right)\right) \]
    15. sin-lowering-sin.f6499.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{*.f64}\left(\mathsf{sin.f64}\left(\mathsf{*.f64}\left(x, \frac{1}{2}\right)\right), \mathsf{/.f64}\left(\frac{8}{3}, \mathsf{sin.f64}\left(x\right)\right)\right)\right) \]
  3. Simplified99.2%

    \[\leadsto \color{blue}{\sin \left(x \cdot 0.5\right) \cdot \left(\sin \left(x \cdot 0.5\right) \cdot \frac{2.6666666666666665}{\sin x}\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around 0

    \[\leadsto \color{blue}{\frac{2}{3} \cdot x} \]
  6. Step-by-step derivation
    1. *-lowering-*.f6449.6%

      \[\leadsto \mathsf{*.f64}\left(\frac{2}{3}, \color{blue}{x}\right) \]
  7. Simplified49.6%

    \[\leadsto \color{blue}{0.6666666666666666 \cdot x} \]
  8. Final simplification49.6%

    \[\leadsto x \cdot 0.6666666666666666 \]
  9. Add Preprocessing

Developer Target 1: 99.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(x \cdot 0.5\right)\\ \frac{\frac{8 \cdot t\_0}{3}}{\frac{\sin x}{t\_0}} \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (sin (* x 0.5)))) (/ (/ (* 8.0 t_0) 3.0) (/ (sin x) t_0))))
double code(double x) {
	double t_0 = sin((x * 0.5));
	return ((8.0 * t_0) / 3.0) / (sin(x) / t_0);
}
real(8) function code(x)
    real(8), intent (in) :: x
    real(8) :: t_0
    t_0 = sin((x * 0.5d0))
    code = ((8.0d0 * t_0) / 3.0d0) / (sin(x) / t_0)
end function
public static double code(double x) {
	double t_0 = Math.sin((x * 0.5));
	return ((8.0 * t_0) / 3.0) / (Math.sin(x) / t_0);
}
def code(x):
	t_0 = math.sin((x * 0.5))
	return ((8.0 * t_0) / 3.0) / (math.sin(x) / t_0)
function code(x)
	t_0 = sin(Float64(x * 0.5))
	return Float64(Float64(Float64(8.0 * t_0) / 3.0) / Float64(sin(x) / t_0))
end
function tmp = code(x)
	t_0 = sin((x * 0.5));
	tmp = ((8.0 * t_0) / 3.0) / (sin(x) / t_0);
end
code[x_] := Block[{t$95$0 = N[Sin[N[(x * 0.5), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[(8.0 * t$95$0), $MachinePrecision] / 3.0), $MachinePrecision] / N[(N[Sin[x], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin \left(x \cdot 0.5\right)\\
\frac{\frac{8 \cdot t\_0}{3}}{\frac{\sin x}{t\_0}}
\end{array}
\end{array}

Reproduce

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

  :alt
  (! :herbie-platform default (/ (/ (* 8 (sin (* x 1/2))) 3) (/ (sin x) (sin (* x 1/2)))))

  (/ (* (* (/ 8.0 3.0) (sin (* x 0.5))) (sin (* x 0.5))) (sin x)))