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

Percentage Accurate: 77.2% → 99.8%
Time: 4.4s
Alternatives: 9
Speedup: 2.7×

Specification

?
\[\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} \]
(FPCore (x)
  :precision binary64
  :pre TRUE
  (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)
use fmin_fmax_functions
    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]]
f(x):
	x in [-inf, +inf]
code: THEORY
BEGIN
f(x: real): real =
	LET t_0 = (sin((x * (5e-1)))) IN
	((((8) / (3)) * t_0) * t_0) / (sin(x))
END code
\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}

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 9 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} 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} \]
(FPCore (x)
  :precision binary64
  :pre TRUE
  (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)
use fmin_fmax_functions
    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]]
f(x):
	x in [-inf, +inf]
code: THEORY
BEGIN
f(x: real): real =
	LET t_0 = (sin((x * (5e-1)))) IN
	((((8) / (3)) * t_0) * t_0) / (sin(x))
END code
\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}

Alternative 1: 99.8% accurate, 2.7× speedup?

\[\frac{\tan \left(-0.5 \cdot x\right)}{-0.75} \]
(FPCore (x)
  :precision binary64
  :pre TRUE
  (/ (tan (* -0.5 x)) -0.75))
double code(double x) {
	return tan((-0.5 * x)) / -0.75;
}
real(8) function code(x)
use fmin_fmax_functions
    real(8), intent (in) :: x
    code = tan(((-0.5d0) * x)) / (-0.75d0)
end function
public static double code(double x) {
	return Math.tan((-0.5 * x)) / -0.75;
}
def code(x):
	return math.tan((-0.5 * x)) / -0.75
function code(x)
	return Float64(tan(Float64(-0.5 * x)) / -0.75)
end
function tmp = code(x)
	tmp = tan((-0.5 * x)) / -0.75;
end
code[x_] := N[(N[Tan[N[(-0.5 * x), $MachinePrecision]], $MachinePrecision] / -0.75), $MachinePrecision]
f(x):
	x in [-inf, +inf]
code: THEORY
BEGIN
f(x: real): real =
	(tan(((-5e-1) * x))) / (-75e-2)
END code
\frac{\tan \left(-0.5 \cdot x\right)}{-0.75}
Derivation
  1. Initial program 77.2%

    \[\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. Applied rewrites53.2%

      \[\leadsto \frac{1}{\frac{\sin x}{\left(1 - \cos x\right) \cdot 1.3333333333333333}} \]
    2. Step-by-step derivation
      1. Applied rewrites53.3%

        \[\leadsto \frac{1}{\sin x \cdot \frac{0.75}{1 - \cos x}} \]
      2. Applied rewrites99.3%

        \[\leadsto \frac{1.3333333333333333}{\frac{1}{\tan \left(0.5 \cdot x\right)}} \]
      3. Step-by-step derivation
        1. Applied rewrites99.8%

          \[\leadsto \frac{\tan \left(-0.5 \cdot x\right)}{-0.75} \]
        2. Add Preprocessing

        Alternative 2: 99.4% accurate, 2.7× speedup?

        \[\tan \left(0.5 \cdot x\right) \cdot 1.3333333333333333 \]
        (FPCore (x)
          :precision binary64
          :pre TRUE
          (* (tan (* 0.5 x)) 1.3333333333333333))
        double code(double x) {
        	return tan((0.5 * x)) * 1.3333333333333333;
        }
        
        real(8) function code(x)
        use fmin_fmax_functions
            real(8), intent (in) :: x
            code = tan((0.5d0 * x)) * 1.3333333333333333d0
        end function
        
        public static double code(double x) {
        	return Math.tan((0.5 * x)) * 1.3333333333333333;
        }
        
        def code(x):
        	return math.tan((0.5 * x)) * 1.3333333333333333
        
        function code(x)
        	return Float64(tan(Float64(0.5 * x)) * 1.3333333333333333)
        end
        
        function tmp = code(x)
        	tmp = tan((0.5 * x)) * 1.3333333333333333;
        end
        
        code[x_] := N[(N[Tan[N[(0.5 * x), $MachinePrecision]], $MachinePrecision] * 1.3333333333333333), $MachinePrecision]
        
        f(x):
        	x in [-inf, +inf]
        code: THEORY
        BEGIN
        f(x: real): real =
        	(tan(((5e-1) * x))) * (13333333333333332593184650249895639717578887939453125e-52)
        END code
        \tan \left(0.5 \cdot x\right) \cdot 1.3333333333333333
        
        Derivation
        1. Initial program 77.2%

          \[\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. Applied rewrites53.3%

            \[\leadsto \frac{\left(1 - \cos x\right) \cdot 1.3333333333333333}{\sin x} \]
          2. Step-by-step derivation
            1. Applied rewrites53.2%

              \[\leadsto \frac{1}{\frac{\sin x}{1 - \cos x}} \cdot 1.3333333333333333 \]
            2. Step-by-step derivation
              1. Applied rewrites99.4%

                \[\leadsto \tan \left(0.5 \cdot x\right) \cdot 1.3333333333333333 \]
              2. Add Preprocessing

              Alternative 3: 58.7% accurate, 2.9× speedup?

              \[\frac{\sin x}{2} \cdot 1.3333333333333333 \]
              (FPCore (x)
                :precision binary64
                :pre TRUE
                (* (/ (sin x) 2.0) 1.3333333333333333))
              double code(double x) {
              	return (sin(x) / 2.0) * 1.3333333333333333;
              }
              
              real(8) function code(x)
              use fmin_fmax_functions
                  real(8), intent (in) :: x
                  code = (sin(x) / 2.0d0) * 1.3333333333333333d0
              end function
              
              public static double code(double x) {
              	return (Math.sin(x) / 2.0) * 1.3333333333333333;
              }
              
              def code(x):
              	return (math.sin(x) / 2.0) * 1.3333333333333333
              
              function code(x)
              	return Float64(Float64(sin(x) / 2.0) * 1.3333333333333333)
              end
              
              function tmp = code(x)
              	tmp = (sin(x) / 2.0) * 1.3333333333333333;
              end
              
              code[x_] := N[(N[(N[Sin[x], $MachinePrecision] / 2.0), $MachinePrecision] * 1.3333333333333333), $MachinePrecision]
              
              f(x):
              	x in [-inf, +inf]
              code: THEORY
              BEGIN
              f(x: real): real =
              	((sin(x)) / (2)) * (13333333333333332593184650249895639717578887939453125e-52)
              END code
              \frac{\sin x}{2} \cdot 1.3333333333333333
              
              Derivation
              1. Initial program 77.2%

                \[\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. Applied rewrites53.3%

                  \[\leadsto \frac{\left(1 - \cos x\right) \cdot 1.3333333333333333}{\sin x} \]
                2. Step-by-step derivation
                  1. Applied rewrites53.2%

                    \[\leadsto \frac{1}{\frac{\sin x}{1 - \cos x}} \cdot 1.3333333333333333 \]
                  2. Step-by-step derivation
                    1. Applied rewrites99.0%

                      \[\leadsto \frac{\sin x}{1 + \cos x} \cdot 1.3333333333333333 \]
                    2. Taylor expanded in x around 0

                      \[\leadsto \frac{\sin x}{2} \cdot 1.3333333333333333 \]
                    3. Step-by-step derivation
                      1. Applied rewrites58.7%

                        \[\leadsto \frac{\sin x}{2} \cdot 1.3333333333333333 \]
                      2. Add Preprocessing

                      Alternative 4: 51.0% accurate, 3.3× speedup?

                      \[\frac{1}{\frac{1}{\frac{x}{\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -4.96031746031746 \cdot 10^{-5}, -0.0020833333333333333\right), -0.125\right), 1.5\right)}}} \]
                      (FPCore (x)
                        :precision binary64
                        :pre TRUE
                        (/
                       1.0
                       (/
                        1.0
                        (/
                         x
                         (fma
                          (* x x)
                          (fma
                           (* x x)
                           (fma (* x x) -4.96031746031746e-5 -0.0020833333333333333)
                           -0.125)
                          1.5)))))
                      double code(double x) {
                      	return 1.0 / (1.0 / (x / fma((x * x), fma((x * x), fma((x * x), -4.96031746031746e-5, -0.0020833333333333333), -0.125), 1.5)));
                      }
                      
                      function code(x)
                      	return Float64(1.0 / Float64(1.0 / Float64(x / fma(Float64(x * x), fma(Float64(x * x), fma(Float64(x * x), -4.96031746031746e-5, -0.0020833333333333333), -0.125), 1.5))))
                      end
                      
                      code[x_] := N[(1.0 / N[(1.0 / N[(x / N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -4.96031746031746e-5 + -0.0020833333333333333), $MachinePrecision] + -0.125), $MachinePrecision] + 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                      
                      f(x):
                      	x in [-inf, +inf]
                      code: THEORY
                      BEGIN
                      f(x: real): real =
                      	(1) / ((1) / (x / (((x * x) * (((x * x) * (((x * x) * (-49603174603174603131579278869622839920339174568653106689453125e-66)) + (-20833333333333333044212754003865484264679253101348876953125e-61))) + (-125e-3))) + (15e-1))))
                      END code
                      \frac{1}{\frac{1}{\frac{x}{\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -4.96031746031746 \cdot 10^{-5}, -0.0020833333333333333\right), -0.125\right), 1.5\right)}}}
                      
                      Derivation
                      1. Initial program 77.2%

                        \[\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. Applied rewrites53.2%

                          \[\leadsto \frac{1}{\frac{\sin x}{\left(1 - \cos x\right) \cdot 1.3333333333333333}} \]
                        2. Taylor expanded in x around 0

                          \[\leadsto \frac{1}{\frac{\frac{3}{2} + {x}^{2} \cdot \left({x}^{2} \cdot \left(\frac{-1}{20160} \cdot {x}^{2} - \frac{1}{480}\right) - \frac{1}{8}\right)}{x}} \]
                        3. Step-by-step derivation
                          1. Applied rewrites50.8%

                            \[\leadsto \frac{1}{\frac{1.5 + {x}^{2} \cdot \left({x}^{2} \cdot \left(-4.96031746031746 \cdot 10^{-5} \cdot {x}^{2} - 0.0020833333333333333\right) - 0.125\right)}{x}} \]
                          2. Step-by-step derivation
                            1. Applied rewrites50.9%

                              \[\leadsto \frac{1}{\frac{1}{\frac{x}{\mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, \mathsf{fma}\left(x \cdot x, -4.96031746031746 \cdot 10^{-5}, -0.0020833333333333333\right), -0.125\right), 1.5\right)}}} \]
                            2. Add Preprocessing

                            Alternative 5: 50.9% accurate, 8.9× speedup?

                            \[\frac{1}{\mathsf{fma}\left(-0.125, x, \frac{1.5}{x}\right)} \]
                            (FPCore (x)
                              :precision binary64
                              :pre TRUE
                              (/ 1.0 (fma -0.125 x (/ 1.5 x))))
                            double code(double x) {
                            	return 1.0 / fma(-0.125, x, (1.5 / x));
                            }
                            
                            function code(x)
                            	return Float64(1.0 / fma(-0.125, x, Float64(1.5 / x)))
                            end
                            
                            code[x_] := N[(1.0 / N[(-0.125 * x + N[(1.5 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                            
                            f(x):
                            	x in [-inf, +inf]
                            code: THEORY
                            BEGIN
                            f(x: real): real =
                            	(1) / (((-125e-3) * x) + ((15e-1) / x))
                            END code
                            \frac{1}{\mathsf{fma}\left(-0.125, x, \frac{1.5}{x}\right)}
                            
                            Derivation
                            1. Initial program 77.2%

                              \[\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. Applied rewrites53.2%

                                \[\leadsto \frac{1}{\frac{\sin x}{\left(1 - \cos x\right) \cdot 1.3333333333333333}} \]
                              2. Taylor expanded in x around 0

                                \[\leadsto \frac{1}{\frac{\frac{3}{2} + \frac{-1}{8} \cdot {x}^{2}}{x}} \]
                              3. Step-by-step derivation
                                1. Applied rewrites51.0%

                                  \[\leadsto \frac{1}{\frac{1.5 + -0.125 \cdot {x}^{2}}{x}} \]
                                2. Step-by-step derivation
                                  1. Applied rewrites51.0%

                                    \[\leadsto \frac{1}{\frac{\mathsf{fma}\left(x \cdot x, -0.125, 1.5\right)}{x}} \]
                                  2. Step-by-step derivation
                                    1. Applied rewrites51.0%

                                      \[\leadsto \frac{1}{\mathsf{fma}\left(-0.125, x, \frac{1.5}{x}\right)} \]
                                    2. Add Preprocessing

                                    Alternative 6: 50.5% accurate, 9.8× speedup?

                                    \[\frac{\frac{1}{\frac{2}{x}}}{0.75} \]
                                    (FPCore (x)
                                      :precision binary64
                                      :pre TRUE
                                      (/ (/ 1.0 (/ 2.0 x)) 0.75))
                                    double code(double x) {
                                    	return (1.0 / (2.0 / x)) / 0.75;
                                    }
                                    
                                    real(8) function code(x)
                                    use fmin_fmax_functions
                                        real(8), intent (in) :: x
                                        code = (1.0d0 / (2.0d0 / x)) / 0.75d0
                                    end function
                                    
                                    public static double code(double x) {
                                    	return (1.0 / (2.0 / x)) / 0.75;
                                    }
                                    
                                    def code(x):
                                    	return (1.0 / (2.0 / x)) / 0.75
                                    
                                    function code(x)
                                    	return Float64(Float64(1.0 / Float64(2.0 / x)) / 0.75)
                                    end
                                    
                                    function tmp = code(x)
                                    	tmp = (1.0 / (2.0 / x)) / 0.75;
                                    end
                                    
                                    code[x_] := N[(N[(1.0 / N[(2.0 / x), $MachinePrecision]), $MachinePrecision] / 0.75), $MachinePrecision]
                                    
                                    f(x):
                                    	x in [-inf, +inf]
                                    code: THEORY
                                    BEGIN
                                    f(x: real): real =
                                    	((1) / ((2) / x)) / (75e-2)
                                    END code
                                    \frac{\frac{1}{\frac{2}{x}}}{0.75}
                                    
                                    Derivation
                                    1. Initial program 77.2%

                                      \[\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. Applied rewrites53.3%

                                        \[\leadsto \frac{\left(1 - \cos x\right) \cdot 1.3333333333333333}{\sin x} \]
                                      2. Step-by-step derivation
                                        1. Applied rewrites53.2%

                                          \[\leadsto \frac{1.3333333333333333}{\frac{\sin x}{1 - \cos x}} \]
                                        2. Taylor expanded in x around 0

                                          \[\leadsto \frac{1.3333333333333333}{\frac{2}{x}} \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites50.3%

                                            \[\leadsto \frac{1.3333333333333333}{\frac{2}{x}} \]
                                          2. Step-by-step derivation
                                            1. Applied rewrites50.5%

                                              \[\leadsto \frac{\frac{1}{\frac{2}{x}}}{0.75} \]
                                            2. Add Preprocessing

                                            Alternative 7: 50.5% accurate, 9.8× speedup?

                                            \[\frac{1}{\frac{1}{\frac{x}{1.5}}} \]
                                            (FPCore (x)
                                              :precision binary64
                                              :pre TRUE
                                              (/ 1.0 (/ 1.0 (/ x 1.5))))
                                            double code(double x) {
                                            	return 1.0 / (1.0 / (x / 1.5));
                                            }
                                            
                                            real(8) function code(x)
                                            use fmin_fmax_functions
                                                real(8), intent (in) :: x
                                                code = 1.0d0 / (1.0d0 / (x / 1.5d0))
                                            end function
                                            
                                            public static double code(double x) {
                                            	return 1.0 / (1.0 / (x / 1.5));
                                            }
                                            
                                            def code(x):
                                            	return 1.0 / (1.0 / (x / 1.5))
                                            
                                            function code(x)
                                            	return Float64(1.0 / Float64(1.0 / Float64(x / 1.5)))
                                            end
                                            
                                            function tmp = code(x)
                                            	tmp = 1.0 / (1.0 / (x / 1.5));
                                            end
                                            
                                            code[x_] := N[(1.0 / N[(1.0 / N[(x / 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                            
                                            f(x):
                                            	x in [-inf, +inf]
                                            code: THEORY
                                            BEGIN
                                            f(x: real): real =
                                            	(1) / ((1) / (x / (15e-1)))
                                            END code
                                            \frac{1}{\frac{1}{\frac{x}{1.5}}}
                                            
                                            Derivation
                                            1. Initial program 77.2%

                                              \[\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. Applied rewrites53.2%

                                                \[\leadsto \frac{1}{\frac{\sin x}{\left(1 - \cos x\right) \cdot 1.3333333333333333}} \]
                                              2. Taylor expanded in x around 0

                                                \[\leadsto \frac{1}{\frac{\frac{3}{2}}{x}} \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites50.4%

                                                  \[\leadsto \frac{1}{\frac{1.5}{x}} \]
                                                2. Step-by-step derivation
                                                  1. Applied rewrites50.5%

                                                    \[\leadsto \frac{1}{\frac{1}{\frac{x}{1.5}}} \]
                                                  2. Add Preprocessing

                                                  Alternative 8: 50.4% accurate, 14.1× speedup?

                                                  \[\frac{1}{\frac{1.5}{x}} \]
                                                  (FPCore (x)
                                                    :precision binary64
                                                    :pre TRUE
                                                    (/ 1.0 (/ 1.5 x)))
                                                  double code(double x) {
                                                  	return 1.0 / (1.5 / x);
                                                  }
                                                  
                                                  real(8) function code(x)
                                                  use fmin_fmax_functions
                                                      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]
                                                  
                                                  f(x):
                                                  	x in [-inf, +inf]
                                                  code: THEORY
                                                  BEGIN
                                                  f(x: real): real =
                                                  	(1) / ((15e-1) / x)
                                                  END code
                                                  \frac{1}{\frac{1.5}{x}}
                                                  
                                                  Derivation
                                                  1. Initial program 77.2%

                                                    \[\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. Applied rewrites53.2%

                                                      \[\leadsto \frac{1}{\frac{\sin x}{\left(1 - \cos x\right) \cdot 1.3333333333333333}} \]
                                                    2. Taylor expanded in x around 0

                                                      \[\leadsto \frac{1}{\frac{\frac{3}{2}}{x}} \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites50.4%

                                                        \[\leadsto \frac{1}{\frac{1.5}{x}} \]
                                                      2. Add Preprocessing

                                                      Alternative 9: 50.4% accurate, 30.3× speedup?

                                                      \[0.6666666666666666 \cdot x \]
                                                      (FPCore (x)
                                                        :precision binary64
                                                        :pre TRUE
                                                        (* 0.6666666666666666 x))
                                                      double code(double x) {
                                                      	return 0.6666666666666666 * x;
                                                      }
                                                      
                                                      real(8) function code(x)
                                                      use fmin_fmax_functions
                                                          real(8), intent (in) :: x
                                                          code = 0.6666666666666666d0 * x
                                                      end function
                                                      
                                                      public static double code(double x) {
                                                      	return 0.6666666666666666 * x;
                                                      }
                                                      
                                                      def code(x):
                                                      	return 0.6666666666666666 * x
                                                      
                                                      function code(x)
                                                      	return Float64(0.6666666666666666 * x)
                                                      end
                                                      
                                                      function tmp = code(x)
                                                      	tmp = 0.6666666666666666 * x;
                                                      end
                                                      
                                                      code[x_] := N[(0.6666666666666666 * x), $MachinePrecision]
                                                      
                                                      f(x):
                                                      	x in [-inf, +inf]
                                                      code: THEORY
                                                      BEGIN
                                                      f(x: real): real =
                                                      	(66666666666666662965923251249478198587894439697265625e-53) * x
                                                      END code
                                                      0.6666666666666666 \cdot x
                                                      
                                                      Derivation
                                                      1. Initial program 77.2%

                                                        \[\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. Taylor expanded in x around 0

                                                        \[\leadsto \frac{2}{3} \cdot x \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites50.4%

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

                                                        Reproduce

                                                        ?
                                                        herbie shell --seed 2026092 
                                                        (FPCore (x)
                                                          :name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, A"
                                                          :precision binary64
                                                          (/ (* (* (/ 8.0 3.0) (sin (* x 0.5))) (sin (* x 0.5))) (sin x)))