VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.2% → 99.7%
Time: 6.9s
Alternatives: 21
Speedup: 1.5×

Specification

?
\[\begin{array}{l} \\ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
	return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x):
	return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
end
function tmp = code(F, B, x)
	tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\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 21 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: 76.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (+
  (- (* x (/ 1.0 (tan B))))
  (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
	return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
	return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x):
	return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x)
	return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
end
function tmp = code(F, B, x)
	tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}

Alternative 1: 99.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;F \leq -2 \cdot 10^{+19}:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{1}{\sin B}, t\_0\right)\\ \mathbf{elif}\;F \leq 3.8 \cdot 10^{+23}:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (/ (- x) (tan B))))
   (if (<= F -2e+19)
     (fma -1.0 (/ 1.0 (sin B)) t_0)
     (if (<= F 3.8e+23)
       (fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) t_0)
       (/ (- 1.0 (* (cos B) x)) (sin B))))))
double code(double F, double B, double x) {
	double t_0 = -x / tan(B);
	double tmp;
	if (F <= -2e+19) {
		tmp = fma(-1.0, (1.0 / sin(B)), t_0);
	} else if (F <= 3.8e+23) {
		tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), t_0);
	} else {
		tmp = (1.0 - (cos(B) * x)) / sin(B);
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(Float64(-x) / tan(B))
	tmp = 0.0
	if (F <= -2e+19)
		tmp = fma(-1.0, Float64(1.0 / sin(B)), t_0);
	elseif (F <= 3.8e+23)
		tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), t_0);
	else
		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+19], N[(-1.0 * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 3.8e+23], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{1}{\sin B}, t\_0\right)\\

\mathbf{elif}\;F \leq 3.8 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2e19

    1. Initial program 76.2%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
      2. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
      3. lift-*.f64N/A

        \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      4. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      5. associate-*l/N/A

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      6. associate-/l*N/A

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
      7. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
    3. Applied rewrites84.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)} \]
    4. Step-by-step derivation
      1. lift-fma.f64N/A

        \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{-x}{\tan B}} \]
      2. lift-/.f64N/A

        \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\frac{-x}{\tan B}} \]
      3. lift-neg.f64N/A

        \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{\tan B} \]
      4. distribute-frac-negN/A

        \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
      5. mult-flip-revN/A

        \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
      6. lift-/.f64N/A

        \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
      7. lift-*.f64N/A

        \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
      8. lift-/.f64N/A

        \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
      10. mult-flipN/A

        \[\leadsto \color{blue}{\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
      11. lift-neg.f64N/A

        \[\leadsto \left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B} + \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      12. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{1}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
    5. Applied rewrites84.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, \frac{-x}{\tan B}\right)} \]
    6. Taylor expanded in F around -inf

      \[\leadsto \mathsf{fma}\left(\color{blue}{-1}, \frac{1}{\sin B}, \frac{-x}{\tan B}\right) \]
    7. Step-by-step derivation
      1. Applied rewrites56.6%

        \[\leadsto \mathsf{fma}\left(\color{blue}{-1}, \frac{1}{\sin B}, \frac{-x}{\tan B}\right) \]

      if -2e19 < F < 3.79999999999999975e23

      1. Initial program 76.2%

        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        5. associate-*l/N/A

          \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        6. associate-/l*N/A

          \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        7. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. Applied rewrites84.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)} \]

      if 3.79999999999999975e23 < F

      1. Initial program 76.2%

        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. Taylor expanded in F around inf

        \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
      3. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
        2. lower-fma.f64N/A

          \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
        3. lower-/.f64N/A

          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
        4. lower-*.f64N/A

          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
        5. lower-cos.f64N/A

          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
        6. lower-*.f64N/A

          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
        7. lower-sin.f64N/A

          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
        8. lower-/.f64N/A

          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
        9. lower-*.f64N/A

          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
        10. lower-sin.f6447.8

          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
      4. Applied rewrites47.8%

        \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
      5. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
        2. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
        3. lower-*.f6447.8

          \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
      6. Applied rewrites50.5%

        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
      7. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
        2. lift-/.f64N/A

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot F \]
        3. mult-flipN/A

          \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{\sin B \cdot F}\right) \cdot F \]
        4. lift-*.f64N/A

          \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{\sin B \cdot F}\right) \cdot F \]
        5. *-commutativeN/A

          \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{F \cdot \sin B}\right) \cdot F \]
        6. lift-*.f64N/A

          \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{F \cdot \sin B}\right) \cdot F \]
        7. lift-/.f64N/A

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

          \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \color{blue}{\left(\frac{1}{F \cdot \sin B} \cdot F\right)} \]
        9. lift-/.f64N/A

          \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{1}{F \cdot \sin B} \cdot F\right) \]
        10. lift-*.f64N/A

          \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{1}{F \cdot \sin B} \cdot F\right) \]
        11. associate-/r*N/A

          \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{\frac{1}{F}}{\sin B} \cdot F\right) \]
        12. associate-*l/N/A

          \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \frac{\frac{1}{F} \cdot F}{\color{blue}{\sin B}} \]
      8. Applied rewrites56.3%

        \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
    8. Recombined 3 regimes into one program.
    9. Add Preprocessing

    Alternative 2: 99.6% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -200000000:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{1}{\sin B}, \frac{-x}{\tan B}\right)\\ \mathbf{elif}\;F \leq 3.8 \cdot 10^{+23}:\\ \;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (if (<= F -200000000.0)
       (fma -1.0 (/ 1.0 (sin B)) (/ (- x) (tan B)))
       (if (<= F 3.8e+23)
         (- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B))) (/ x (tan B)))
         (/ (- 1.0 (* (cos B) x)) (sin B)))))
    double code(double F, double B, double x) {
    	double tmp;
    	if (F <= -200000000.0) {
    		tmp = fma(-1.0, (1.0 / sin(B)), (-x / tan(B)));
    	} else if (F <= 3.8e+23) {
    		tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / sin(B))) - (x / tan(B));
    	} else {
    		tmp = (1.0 - (cos(B) * x)) / sin(B);
    	}
    	return tmp;
    }
    
    function code(F, B, x)
    	tmp = 0.0
    	if (F <= -200000000.0)
    		tmp = fma(-1.0, Float64(1.0 / sin(B)), Float64(Float64(-x) / tan(B)));
    	elseif (F <= 3.8e+23)
    		tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / sin(B))) - Float64(x / tan(B)));
    	else
    		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
    	end
    	return tmp
    end
    
    code[F_, B_, x_] := If[LessEqual[F, -200000000.0], N[(-1.0 * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.8e+23], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;F \leq -200000000:\\
    \;\;\;\;\mathsf{fma}\left(-1, \frac{1}{\sin B}, \frac{-x}{\tan B}\right)\\
    
    \mathbf{elif}\;F \leq 3.8 \cdot 10^{+23}:\\
    \;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if F < -2e8

      1. Initial program 76.2%

        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        4. lift-/.f64N/A

          \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        5. associate-*l/N/A

          \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        6. associate-/l*N/A

          \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
        7. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
      3. Applied rewrites84.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)} \]
      4. Step-by-step derivation
        1. lift-fma.f64N/A

          \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{-x}{\tan B}} \]
        2. lift-/.f64N/A

          \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\frac{-x}{\tan B}} \]
        3. lift-neg.f64N/A

          \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{\tan B} \]
        4. distribute-frac-negN/A

          \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
        5. mult-flip-revN/A

          \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
        6. lift-/.f64N/A

          \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
        7. lift-*.f64N/A

          \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
        8. lift-/.f64N/A

          \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        9. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        10. mult-flipN/A

          \[\leadsto \color{blue}{\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
        11. lift-neg.f64N/A

          \[\leadsto \left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B} + \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
        12. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{1}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
      5. Applied rewrites84.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, \frac{-x}{\tan B}\right)} \]
      6. Taylor expanded in F around -inf

        \[\leadsto \mathsf{fma}\left(\color{blue}{-1}, \frac{1}{\sin B}, \frac{-x}{\tan B}\right) \]
      7. Step-by-step derivation
        1. Applied rewrites56.6%

          \[\leadsto \mathsf{fma}\left(\color{blue}{-1}, \frac{1}{\sin B}, \frac{-x}{\tan B}\right) \]

        if -2e8 < F < 3.79999999999999975e23

        1. Initial program 76.2%

          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        2. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
          2. +-commutativeN/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
          3. lift-neg.f64N/A

            \[\leadsto \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \color{blue}{\left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right)} \]
          4. sub-flip-reverseN/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
          5. lower--.f6476.2

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} - x \cdot \frac{1}{\tan B}} \]
        3. Applied rewrites76.3%

          \[\leadsto \color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}} \]

        if 3.79999999999999975e23 < F

        1. Initial program 76.2%

          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        2. Taylor expanded in F around inf

          \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
        3. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
          2. lower-fma.f64N/A

            \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
          3. lower-/.f64N/A

            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
          4. lower-*.f64N/A

            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
          5. lower-cos.f64N/A

            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
          6. lower-*.f64N/A

            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
          7. lower-sin.f64N/A

            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
          8. lower-/.f64N/A

            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
          9. lower-*.f64N/A

            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
          10. lower-sin.f6447.8

            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
        4. Applied rewrites47.8%

          \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
          2. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
          3. lower-*.f6447.8

            \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
        6. Applied rewrites50.5%

          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
        7. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
          2. lift-/.f64N/A

            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot F \]
          3. mult-flipN/A

            \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{\sin B \cdot F}\right) \cdot F \]
          4. lift-*.f64N/A

            \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{\sin B \cdot F}\right) \cdot F \]
          5. *-commutativeN/A

            \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{F \cdot \sin B}\right) \cdot F \]
          6. lift-*.f64N/A

            \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{F \cdot \sin B}\right) \cdot F \]
          7. lift-/.f64N/A

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

            \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \color{blue}{\left(\frac{1}{F \cdot \sin B} \cdot F\right)} \]
          9. lift-/.f64N/A

            \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{1}{F \cdot \sin B} \cdot F\right) \]
          10. lift-*.f64N/A

            \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{1}{F \cdot \sin B} \cdot F\right) \]
          11. associate-/r*N/A

            \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{\frac{1}{F}}{\sin B} \cdot F\right) \]
          12. associate-*l/N/A

            \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \frac{\frac{1}{F} \cdot F}{\color{blue}{\sin B}} \]
        8. Applied rewrites56.3%

          \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
      8. Recombined 3 regimes into one program.
      9. Add Preprocessing

      Alternative 3: 99.2% accurate, 1.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;F \leq -1.52:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{1}{\sin B}, t\_0\right)\\ \mathbf{elif}\;F \leq 1.65:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}}{\sin B}, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
      (FPCore (F B x)
       :precision binary64
       (let* ((t_0 (/ (- x) (tan B))))
         (if (<= F -1.52)
           (fma -1.0 (/ 1.0 (sin B)) t_0)
           (if (<= F 1.65)
             (fma F (/ (pow (fma 2.0 x 2.0) -0.5) (sin B)) t_0)
             (/ (- 1.0 (* (cos B) x)) (sin B))))))
      double code(double F, double B, double x) {
      	double t_0 = -x / tan(B);
      	double tmp;
      	if (F <= -1.52) {
      		tmp = fma(-1.0, (1.0 / sin(B)), t_0);
      	} else if (F <= 1.65) {
      		tmp = fma(F, (pow(fma(2.0, x, 2.0), -0.5) / sin(B)), t_0);
      	} else {
      		tmp = (1.0 - (cos(B) * x)) / sin(B);
      	}
      	return tmp;
      }
      
      function code(F, B, x)
      	t_0 = Float64(Float64(-x) / tan(B))
      	tmp = 0.0
      	if (F <= -1.52)
      		tmp = fma(-1.0, Float64(1.0 / sin(B)), t_0);
      	elseif (F <= 1.65)
      		tmp = fma(F, Float64((fma(2.0, x, 2.0) ^ -0.5) / sin(B)), t_0);
      	else
      		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
      	end
      	return tmp
      end
      
      code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.52], N[(-1.0 * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 1.65], N[(F * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{-x}{\tan B}\\
      \mathbf{if}\;F \leq -1.52:\\
      \;\;\;\;\mathsf{fma}\left(-1, \frac{1}{\sin B}, t\_0\right)\\
      
      \mathbf{elif}\;F \leq 1.65:\\
      \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}}{\sin B}, t\_0\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if F < -1.52

        1. Initial program 76.2%

          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        2. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
          2. +-commutativeN/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
          4. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
          5. associate-*l/N/A

            \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
          6. associate-/l*N/A

            \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
          7. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
        3. Applied rewrites84.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)} \]
        4. Step-by-step derivation
          1. lift-fma.f64N/A

            \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{-x}{\tan B}} \]
          2. lift-/.f64N/A

            \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\frac{-x}{\tan B}} \]
          3. lift-neg.f64N/A

            \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{\tan B} \]
          4. distribute-frac-negN/A

            \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
          5. mult-flip-revN/A

            \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
          6. lift-/.f64N/A

            \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
          7. lift-*.f64N/A

            \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
          8. lift-/.f64N/A

            \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          9. associate-*r/N/A

            \[\leadsto \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          10. mult-flipN/A

            \[\leadsto \color{blue}{\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
          11. lift-neg.f64N/A

            \[\leadsto \left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B} + \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
          12. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{1}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
        5. Applied rewrites84.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, \frac{-x}{\tan B}\right)} \]
        6. Taylor expanded in F around -inf

          \[\leadsto \mathsf{fma}\left(\color{blue}{-1}, \frac{1}{\sin B}, \frac{-x}{\tan B}\right) \]
        7. Step-by-step derivation
          1. Applied rewrites56.6%

            \[\leadsto \mathsf{fma}\left(\color{blue}{-1}, \frac{1}{\sin B}, \frac{-x}{\tan B}\right) \]

          if -1.52 < F < 1.6499999999999999

          1. Initial program 76.2%

            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
          2. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
            2. +-commutativeN/A

              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
            3. lift-*.f64N/A

              \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
            4. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
            5. associate-*l/N/A

              \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
            6. associate-/l*N/A

              \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
            7. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
          3. Applied rewrites84.8%

            \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)} \]
          4. Taylor expanded in F around 0

            \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{2}\right)\right)}^{\frac{-1}{2}}}{\sin B}, \frac{-x}{\tan B}\right) \]
          5. Step-by-step derivation
            1. Applied rewrites55.5%

              \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \color{blue}{2}\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right) \]

            if 1.6499999999999999 < F

            1. Initial program 76.2%

              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
            2. Taylor expanded in F around inf

              \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
              2. lower-fma.f64N/A

                \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
              3. lower-/.f64N/A

                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
              4. lower-*.f64N/A

                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
              5. lower-cos.f64N/A

                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
              6. lower-*.f64N/A

                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
              7. lower-sin.f64N/A

                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
              8. lower-/.f64N/A

                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
              9. lower-*.f64N/A

                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
              10. lower-sin.f6447.8

                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
            4. Applied rewrites47.8%

              \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
            5. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
              2. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
              3. lower-*.f6447.8

                \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
            6. Applied rewrites50.5%

              \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
            7. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
              2. lift-/.f64N/A

                \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot F \]
              3. mult-flipN/A

                \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{\sin B \cdot F}\right) \cdot F \]
              4. lift-*.f64N/A

                \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{\sin B \cdot F}\right) \cdot F \]
              5. *-commutativeN/A

                \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{F \cdot \sin B}\right) \cdot F \]
              6. lift-*.f64N/A

                \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{F \cdot \sin B}\right) \cdot F \]
              7. lift-/.f64N/A

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

                \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \color{blue}{\left(\frac{1}{F \cdot \sin B} \cdot F\right)} \]
              9. lift-/.f64N/A

                \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{1}{F \cdot \sin B} \cdot F\right) \]
              10. lift-*.f64N/A

                \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{1}{F \cdot \sin B} \cdot F\right) \]
              11. associate-/r*N/A

                \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{\frac{1}{F}}{\sin B} \cdot F\right) \]
              12. associate-*l/N/A

                \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \frac{\frac{1}{F} \cdot F}{\color{blue}{\sin B}} \]
            8. Applied rewrites56.3%

              \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
          6. Recombined 3 regimes into one program.
          7. Add Preprocessing

          Alternative 4: 92.2% accurate, 1.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.182:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{1}{\sin B}, \frac{-x}{\tan B}\right)\\ \mathbf{elif}\;F \leq 1700:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
          (FPCore (F B x)
           :precision binary64
           (if (<= F -0.182)
             (fma -1.0 (/ 1.0 (sin B)) (/ (- x) (tan B)))
             (if (<= F 1700.0)
               (+
                (- (* x (/ 1.0 (tan B))))
                (* (/ F B) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
               (/ (- 1.0 (* (cos B) x)) (sin B)))))
          double code(double F, double B, double x) {
          	double tmp;
          	if (F <= -0.182) {
          		tmp = fma(-1.0, (1.0 / sin(B)), (-x / tan(B)));
          	} else if (F <= 1700.0) {
          		tmp = -(x * (1.0 / tan(B))) + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
          	} else {
          		tmp = (1.0 - (cos(B) * x)) / sin(B);
          	}
          	return tmp;
          }
          
          function code(F, B, x)
          	tmp = 0.0
          	if (F <= -0.182)
          		tmp = fma(-1.0, Float64(1.0 / sin(B)), Float64(Float64(-x) / tan(B)));
          	elseif (F <= 1700.0)
          		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))));
          	else
          		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
          	end
          	return tmp
          end
          
          code[F_, B_, x_] := If[LessEqual[F, -0.182], N[(-1.0 * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1700.0], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;F \leq -0.182:\\
          \;\;\;\;\mathsf{fma}\left(-1, \frac{1}{\sin B}, \frac{-x}{\tan B}\right)\\
          
          \mathbf{elif}\;F \leq 1700:\\
          \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if F < -0.182

            1. Initial program 76.2%

              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
            2. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
              2. +-commutativeN/A

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
              3. lift-*.f64N/A

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
              4. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
              5. associate-*l/N/A

                \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
              6. associate-/l*N/A

                \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
              7. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
            3. Applied rewrites84.8%

              \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)} \]
            4. Step-by-step derivation
              1. lift-fma.f64N/A

                \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{-x}{\tan B}} \]
              2. lift-/.f64N/A

                \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\frac{-x}{\tan B}} \]
              3. lift-neg.f64N/A

                \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{\tan B} \]
              4. distribute-frac-negN/A

                \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
              5. mult-flip-revN/A

                \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
              6. lift-/.f64N/A

                \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
              7. lift-*.f64N/A

                \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
              8. lift-/.f64N/A

                \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              9. associate-*r/N/A

                \[\leadsto \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              10. mult-flipN/A

                \[\leadsto \color{blue}{\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
              11. lift-neg.f64N/A

                \[\leadsto \left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B} + \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
              12. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{1}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
            5. Applied rewrites84.8%

              \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, \frac{-x}{\tan B}\right)} \]
            6. Taylor expanded in F around -inf

              \[\leadsto \mathsf{fma}\left(\color{blue}{-1}, \frac{1}{\sin B}, \frac{-x}{\tan B}\right) \]
            7. Step-by-step derivation
              1. Applied rewrites56.6%

                \[\leadsto \mathsf{fma}\left(\color{blue}{-1}, \frac{1}{\sin B}, \frac{-x}{\tan B}\right) \]

              if -0.182 < F < 1700

              1. Initial program 76.2%

                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              2. Taylor expanded in B around 0

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              3. Step-by-step derivation
                1. lower-/.f6461.4

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              4. Applied rewrites61.4%

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]

              if 1700 < F

              1. Initial program 76.2%

                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              2. Taylor expanded in F around inf

                \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
              3. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                2. lower-fma.f64N/A

                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                3. lower-/.f64N/A

                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                4. lower-*.f64N/A

                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                5. lower-cos.f64N/A

                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                6. lower-*.f64N/A

                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                7. lower-sin.f64N/A

                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                8. lower-/.f64N/A

                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                9. lower-*.f64N/A

                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                10. lower-sin.f6447.8

                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
              4. Applied rewrites47.8%

                \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
              5. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                2. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                3. lower-*.f6447.8

                  \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
              6. Applied rewrites50.5%

                \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
              7. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
                2. lift-/.f64N/A

                  \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot F \]
                3. mult-flipN/A

                  \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{\sin B \cdot F}\right) \cdot F \]
                4. lift-*.f64N/A

                  \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{\sin B \cdot F}\right) \cdot F \]
                5. *-commutativeN/A

                  \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{F \cdot \sin B}\right) \cdot F \]
                6. lift-*.f64N/A

                  \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{F \cdot \sin B}\right) \cdot F \]
                7. lift-/.f64N/A

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

                  \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \color{blue}{\left(\frac{1}{F \cdot \sin B} \cdot F\right)} \]
                9. lift-/.f64N/A

                  \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{1}{F \cdot \sin B} \cdot F\right) \]
                10. lift-*.f64N/A

                  \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{1}{F \cdot \sin B} \cdot F\right) \]
                11. associate-/r*N/A

                  \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{\frac{1}{F}}{\sin B} \cdot F\right) \]
                12. associate-*l/N/A

                  \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \frac{\frac{1}{F} \cdot F}{\color{blue}{\sin B}} \]
              8. Applied rewrites56.3%

                \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
            8. Recombined 3 regimes into one program.
            9. Add Preprocessing

            Alternative 5: 89.7% accurate, 1.3× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{B}\right)\\ t_1 := \frac{-x}{\tan B}\\ \mathbf{if}\;F \leq -1.55 \cdot 10^{+19}:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{1}{\sin B}, t\_1\right)\\ \mathbf{elif}\;F \leq -3.7 \cdot 10^{-227}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 5 \cdot 10^{-139}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 500000:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (let* ((t_0
                     (fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) (/ (- x) B)))
                    (t_1 (/ (- x) (tan B))))
               (if (<= F -1.55e+19)
                 (fma -1.0 (/ 1.0 (sin B)) t_1)
                 (if (<= F -3.7e-227)
                   t_0
                   (if (<= F 5e-139)
                     t_1
                     (if (<= F 500000.0) t_0 (/ (- 1.0 (* (cos B) x)) (sin B))))))))
            double code(double F, double B, double x) {
            	double t_0 = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), (-x / B));
            	double t_1 = -x / tan(B);
            	double tmp;
            	if (F <= -1.55e+19) {
            		tmp = fma(-1.0, (1.0 / sin(B)), t_1);
            	} else if (F <= -3.7e-227) {
            		tmp = t_0;
            	} else if (F <= 5e-139) {
            		tmp = t_1;
            	} else if (F <= 500000.0) {
            		tmp = t_0;
            	} else {
            		tmp = (1.0 - (cos(B) * x)) / sin(B);
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	t_0 = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(Float64(-x) / B))
            	t_1 = Float64(Float64(-x) / tan(B))
            	tmp = 0.0
            	if (F <= -1.55e+19)
            		tmp = fma(-1.0, Float64(1.0 / sin(B)), t_1);
            	elseif (F <= -3.7e-227)
            		tmp = t_0;
            	elseif (F <= 5e-139)
            		tmp = t_1;
            	elseif (F <= 500000.0)
            		tmp = t_0;
            	else
            		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
            	end
            	return tmp
            end
            
            code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.55e+19], N[(-1.0 * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[F, -3.7e-227], t$95$0, If[LessEqual[F, 5e-139], t$95$1, If[LessEqual[F, 500000.0], t$95$0, N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{B}\right)\\
            t_1 := \frac{-x}{\tan B}\\
            \mathbf{if}\;F \leq -1.55 \cdot 10^{+19}:\\
            \;\;\;\;\mathsf{fma}\left(-1, \frac{1}{\sin B}, t\_1\right)\\
            
            \mathbf{elif}\;F \leq -3.7 \cdot 10^{-227}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;F \leq 5 \cdot 10^{-139}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;F \leq 500000:\\
            \;\;\;\;t\_0\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if F < -1.55e19

              1. Initial program 76.2%

                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              2. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                2. +-commutativeN/A

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
                3. lift-*.f64N/A

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                4. lift-/.f64N/A

                  \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                5. associate-*l/N/A

                  \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                6. associate-/l*N/A

                  \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                7. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
              3. Applied rewrites84.8%

                \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)} \]
              4. Step-by-step derivation
                1. lift-fma.f64N/A

                  \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{-x}{\tan B}} \]
                2. lift-/.f64N/A

                  \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\frac{-x}{\tan B}} \]
                3. lift-neg.f64N/A

                  \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{\tan B} \]
                4. distribute-frac-negN/A

                  \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
                5. mult-flip-revN/A

                  \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                6. lift-/.f64N/A

                  \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
                7. lift-*.f64N/A

                  \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                8. lift-/.f64N/A

                  \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                9. associate-*r/N/A

                  \[\leadsto \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                10. mult-flipN/A

                  \[\leadsto \color{blue}{\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                11. lift-neg.f64N/A

                  \[\leadsto \left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B} + \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
                12. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{1}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
              5. Applied rewrites84.8%

                \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, \frac{-x}{\tan B}\right)} \]
              6. Taylor expanded in F around -inf

                \[\leadsto \mathsf{fma}\left(\color{blue}{-1}, \frac{1}{\sin B}, \frac{-x}{\tan B}\right) \]
              7. Step-by-step derivation
                1. Applied rewrites56.6%

                  \[\leadsto \mathsf{fma}\left(\color{blue}{-1}, \frac{1}{\sin B}, \frac{-x}{\tan B}\right) \]

                if -1.55e19 < F < -3.69999999999999978e-227 or 5.00000000000000034e-139 < F < 5e5

                1. Initial program 76.2%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

                    \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                  2. +-commutativeN/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
                  3. lift-*.f64N/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  4. lift-/.f64N/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  5. associate-*l/N/A

                    \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  6. associate-/l*N/A

                    \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  7. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
                3. Applied rewrites84.8%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)} \]
                4. Step-by-step derivation
                  1. lift-fma.f64N/A

                    \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{-x}{\tan B}} \]
                  2. lift-/.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\frac{-x}{\tan B}} \]
                  3. lift-neg.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{\tan B} \]
                  4. distribute-frac-negN/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
                  5. mult-flip-revN/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                  6. lift-/.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
                  7. lift-*.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                  8. lift-/.f64N/A

                    \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  9. associate-*r/N/A

                    \[\leadsto \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  10. mult-flipN/A

                    \[\leadsto \color{blue}{\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  11. lift-neg.f64N/A

                    \[\leadsto \left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B} + \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
                  12. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{1}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
                5. Applied rewrites84.8%

                  \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, \frac{-x}{\tan B}\right)} \]
                6. Taylor expanded in B around 0

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F, \frac{1}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                7. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F, \frac{1}{\sin B}, -1 \cdot \color{blue}{\frac{x}{B}}\right) \]
                  2. lower-/.f6457.3

                    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, -1 \cdot \frac{x}{\color{blue}{B}}\right) \]
                8. Applied rewrites57.3%

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                9. Step-by-step derivation
                  1. lift-fma.f64N/A

                    \[\leadsto \color{blue}{\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F\right) \cdot \frac{1}{\sin B} + -1 \cdot \frac{x}{B}} \]
                  2. lift-/.f64N/A

                    \[\leadsto \left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F\right) \cdot \color{blue}{\frac{1}{\sin B}} + -1 \cdot \frac{x}{B} \]
                  3. mult-flip-revN/A

                    \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B}} + -1 \cdot \frac{x}{B} \]
                  4. lift-*.f64N/A

                    \[\leadsto \frac{\color{blue}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}}{\sin B} + -1 \cdot \frac{x}{B} \]
                  5. *-commutativeN/A

                    \[\leadsto \frac{\color{blue}{F \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}{\sin B} + -1 \cdot \frac{x}{B} \]
                  6. associate-/l*N/A

                    \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + -1 \cdot \frac{x}{B} \]
                  7. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, -1 \cdot \frac{x}{B}\right)} \]
                  8. lower-/.f6457.3

                    \[\leadsto \mathsf{fma}\left(F, \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}}, -1 \cdot \frac{x}{B}\right) \]
                  9. lift-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\color{blue}{\left(x \cdot 2 + \mathsf{fma}\left(F, F, 2\right)\right)}}^{\frac{-1}{2}}}{\sin B}, -1 \cdot \frac{x}{B}\right) \]
                  10. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\color{blue}{2 \cdot x} + \mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}}}{\sin B}, -1 \cdot \frac{x}{B}\right) \]
                  11. lower-fma.f6457.3

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\color{blue}{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}}^{-0.5}}{\sin B}, -1 \cdot \frac{x}{B}\right) \]
                  12. lift-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, -1 \cdot \color{blue}{\frac{x}{B}}\right) \]
                  13. mul-1-negN/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \mathsf{neg}\left(\frac{x}{B}\right)\right) \]
                  14. lift-/.f64N/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \mathsf{neg}\left(\frac{x}{B}\right)\right) \]
                  15. distribute-neg-fracN/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \frac{\mathsf{neg}\left(x\right)}{\color{blue}{B}}\right) \]
                  16. lift-neg.f64N/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \frac{-x}{B}\right) \]
                  17. lower-/.f6457.3

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\color{blue}{B}}\right) \]
                10. Applied rewrites57.3%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{B}\right)} \]

                if -3.69999999999999978e-227 < F < 5.00000000000000034e-139

                1. Initial program 76.2%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Taylor expanded in F around 0

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

                    \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                  2. lower-/.f64N/A

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                  3. lower-*.f64N/A

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                  4. lower-cos.f64N/A

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  5. lower-sin.f6455.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                4. Applied rewrites55.4%

                  \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                5. Step-by-step derivation
                  1. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  2. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  3. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  4. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  5. lift-*.f64N/A

                    \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                  6. mul-1-negN/A

                    \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                  7. lift-/.f64N/A

                    \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                  8. lift-*.f64N/A

                    \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                  9. associate-/l*N/A

                    \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                6. Applied rewrites55.5%

                  \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

                if 5e5 < F

                1. Initial program 76.2%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Taylor expanded in F around inf

                  \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                3. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                  2. lower-fma.f64N/A

                    \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                  3. lower-/.f64N/A

                    \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                  4. lower-*.f64N/A

                    \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                  5. lower-cos.f64N/A

                    \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                  6. lower-*.f64N/A

                    \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                  7. lower-sin.f64N/A

                    \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                  8. lower-/.f64N/A

                    \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                  9. lower-*.f64N/A

                    \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                  10. lower-sin.f6447.8

                    \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                4. Applied rewrites47.8%

                  \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                5. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                  2. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                  3. lower-*.f6447.8

                    \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                6. Applied rewrites50.5%

                  \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
                7. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
                  2. lift-/.f64N/A

                    \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot F \]
                  3. mult-flipN/A

                    \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{\sin B \cdot F}\right) \cdot F \]
                  4. lift-*.f64N/A

                    \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{\sin B \cdot F}\right) \cdot F \]
                  5. *-commutativeN/A

                    \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{F \cdot \sin B}\right) \cdot F \]
                  6. lift-*.f64N/A

                    \[\leadsto \left(\left(1 - \cos B \cdot x\right) \cdot \frac{1}{F \cdot \sin B}\right) \cdot F \]
                  7. lift-/.f64N/A

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

                    \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \color{blue}{\left(\frac{1}{F \cdot \sin B} \cdot F\right)} \]
                  9. lift-/.f64N/A

                    \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{1}{F \cdot \sin B} \cdot F\right) \]
                  10. lift-*.f64N/A

                    \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{1}{F \cdot \sin B} \cdot F\right) \]
                  11. associate-/r*N/A

                    \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \left(\frac{\frac{1}{F}}{\sin B} \cdot F\right) \]
                  12. associate-*l/N/A

                    \[\leadsto \left(1 - \cos B \cdot x\right) \cdot \frac{\frac{1}{F} \cdot F}{\color{blue}{\sin B}} \]
                8. Applied rewrites56.3%

                  \[\leadsto \color{blue}{\frac{1 - \cos B \cdot x}{\sin B}} \]
              8. Recombined 4 regimes into one program.
              9. Add Preprocessing

              Alternative 6: 76.3% accurate, 1.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;x \leq -2.1 \cdot 10^{+16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-34}:\\ \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, -1 \cdot \frac{x}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
              (FPCore (F B x)
               :precision binary64
               (let* ((t_0 (/ (- x) (tan B))))
                 (if (<= x -2.1e+16)
                   t_0
                   (if (<= x 1.8e-34)
                     (fma
                      (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F)
                      (/ 1.0 (sin B))
                      (* -1.0 (/ x B)))
                     t_0))))
              double code(double F, double B, double x) {
              	double t_0 = -x / tan(B);
              	double tmp;
              	if (x <= -2.1e+16) {
              		tmp = t_0;
              	} else if (x <= 1.8e-34) {
              		tmp = fma((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F), (1.0 / sin(B)), (-1.0 * (x / B)));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              function code(F, B, x)
              	t_0 = Float64(Float64(-x) / tan(B))
              	tmp = 0.0
              	if (x <= -2.1e+16)
              		tmp = t_0;
              	elseif (x <= 1.8e-34)
              		tmp = fma(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F), Float64(1.0 / sin(B)), Float64(-1.0 * Float64(x / B)));
              	else
              		tmp = t_0;
              	end
              	return tmp
              end
              
              code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+16], t$95$0, If[LessEqual[x, 1.8e-34], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \frac{-x}{\tan B}\\
              \mathbf{if}\;x \leq -2.1 \cdot 10^{+16}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;x \leq 1.8 \cdot 10^{-34}:\\
              \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, -1 \cdot \frac{x}{B}\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < -2.1e16 or 1.80000000000000004e-34 < x

                1. Initial program 76.2%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Taylor expanded in F around 0

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

                    \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                  2. lower-/.f64N/A

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                  3. lower-*.f64N/A

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                  4. lower-cos.f64N/A

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  5. lower-sin.f6455.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                4. Applied rewrites55.4%

                  \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                5. Step-by-step derivation
                  1. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  2. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  3. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  4. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  5. lift-*.f64N/A

                    \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                  6. mul-1-negN/A

                    \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                  7. lift-/.f64N/A

                    \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                  8. lift-*.f64N/A

                    \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                  9. associate-/l*N/A

                    \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                6. Applied rewrites55.5%

                  \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

                if -2.1e16 < x < 1.80000000000000004e-34

                1. Initial program 76.2%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

                    \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                  2. +-commutativeN/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
                  3. lift-*.f64N/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  4. lift-/.f64N/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  5. associate-*l/N/A

                    \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  6. associate-/l*N/A

                    \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  7. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
                3. Applied rewrites84.8%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)} \]
                4. Step-by-step derivation
                  1. lift-fma.f64N/A

                    \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{-x}{\tan B}} \]
                  2. lift-/.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\frac{-x}{\tan B}} \]
                  3. lift-neg.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{\tan B} \]
                  4. distribute-frac-negN/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
                  5. mult-flip-revN/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                  6. lift-/.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
                  7. lift-*.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                  8. lift-/.f64N/A

                    \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  9. associate-*r/N/A

                    \[\leadsto \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  10. mult-flipN/A

                    \[\leadsto \color{blue}{\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  11. lift-neg.f64N/A

                    \[\leadsto \left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B} + \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
                  12. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{1}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
                5. Applied rewrites84.8%

                  \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, \frac{-x}{\tan B}\right)} \]
                6. Taylor expanded in B around 0

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F, \frac{1}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                7. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F, \frac{1}{\sin B}, -1 \cdot \color{blue}{\frac{x}{B}}\right) \]
                  2. lower-/.f6457.3

                    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, -1 \cdot \frac{x}{\color{blue}{B}}\right) \]
                8. Applied rewrites57.3%

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
              3. Recombined 2 regimes into one program.
              4. Add Preprocessing

              Alternative 7: 76.3% accurate, 1.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;x \leq -2.1 \cdot 10^{+16}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.8 \cdot 10^{-34}:\\ \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
              (FPCore (F B x)
               :precision binary64
               (let* ((t_0 (/ (- x) (tan B))))
                 (if (<= x -2.1e+16)
                   t_0
                   (if (<= x 1.8e-34)
                     (fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) (/ (- x) B))
                     t_0))))
              double code(double F, double B, double x) {
              	double t_0 = -x / tan(B);
              	double tmp;
              	if (x <= -2.1e+16) {
              		tmp = t_0;
              	} else if (x <= 1.8e-34) {
              		tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), (-x / B));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              function code(F, B, x)
              	t_0 = Float64(Float64(-x) / tan(B))
              	tmp = 0.0
              	if (x <= -2.1e+16)
              		tmp = t_0;
              	elseif (x <= 1.8e-34)
              		tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(Float64(-x) / B));
              	else
              		tmp = t_0;
              	end
              	return tmp
              end
              
              code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+16], t$95$0, If[LessEqual[x, 1.8e-34], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \frac{-x}{\tan B}\\
              \mathbf{if}\;x \leq -2.1 \cdot 10^{+16}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;x \leq 1.8 \cdot 10^{-34}:\\
              \;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{B}\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < -2.1e16 or 1.80000000000000004e-34 < x

                1. Initial program 76.2%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Taylor expanded in F around 0

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

                    \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                  2. lower-/.f64N/A

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                  3. lower-*.f64N/A

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                  4. lower-cos.f64N/A

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  5. lower-sin.f6455.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                4. Applied rewrites55.4%

                  \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                5. Step-by-step derivation
                  1. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  2. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  3. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  4. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  5. lift-*.f64N/A

                    \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                  6. mul-1-negN/A

                    \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                  7. lift-/.f64N/A

                    \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                  8. lift-*.f64N/A

                    \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                  9. associate-/l*N/A

                    \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                6. Applied rewrites55.5%

                  \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

                if -2.1e16 < x < 1.80000000000000004e-34

                1. Initial program 76.2%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

                    \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                  2. +-commutativeN/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
                  3. lift-*.f64N/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  4. lift-/.f64N/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  5. associate-*l/N/A

                    \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  6. associate-/l*N/A

                    \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  7. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
                3. Applied rewrites84.8%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)} \]
                4. Step-by-step derivation
                  1. lift-fma.f64N/A

                    \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{-x}{\tan B}} \]
                  2. lift-/.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\frac{-x}{\tan B}} \]
                  3. lift-neg.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{\tan B} \]
                  4. distribute-frac-negN/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
                  5. mult-flip-revN/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                  6. lift-/.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
                  7. lift-*.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                  8. lift-/.f64N/A

                    \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  9. associate-*r/N/A

                    \[\leadsto \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  10. mult-flipN/A

                    \[\leadsto \color{blue}{\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  11. lift-neg.f64N/A

                    \[\leadsto \left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B} + \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
                  12. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{1}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
                5. Applied rewrites84.8%

                  \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, \frac{-x}{\tan B}\right)} \]
                6. Taylor expanded in B around 0

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F, \frac{1}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                7. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F, \frac{1}{\sin B}, -1 \cdot \color{blue}{\frac{x}{B}}\right) \]
                  2. lower-/.f6457.3

                    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, -1 \cdot \frac{x}{\color{blue}{B}}\right) \]
                8. Applied rewrites57.3%

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                9. Step-by-step derivation
                  1. lift-fma.f64N/A

                    \[\leadsto \color{blue}{\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F\right) \cdot \frac{1}{\sin B} + -1 \cdot \frac{x}{B}} \]
                  2. lift-/.f64N/A

                    \[\leadsto \left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F\right) \cdot \color{blue}{\frac{1}{\sin B}} + -1 \cdot \frac{x}{B} \]
                  3. mult-flip-revN/A

                    \[\leadsto \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}{\sin B}} + -1 \cdot \frac{x}{B} \]
                  4. lift-*.f64N/A

                    \[\leadsto \frac{\color{blue}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F}}{\sin B} + -1 \cdot \frac{x}{B} \]
                  5. *-commutativeN/A

                    \[\leadsto \frac{\color{blue}{F \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}{\sin B} + -1 \cdot \frac{x}{B} \]
                  6. associate-/l*N/A

                    \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + -1 \cdot \frac{x}{B} \]
                  7. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, -1 \cdot \frac{x}{B}\right)} \]
                  8. lower-/.f6457.3

                    \[\leadsto \mathsf{fma}\left(F, \color{blue}{\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}}, -1 \cdot \frac{x}{B}\right) \]
                  9. lift-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\color{blue}{\left(x \cdot 2 + \mathsf{fma}\left(F, F, 2\right)\right)}}^{\frac{-1}{2}}}{\sin B}, -1 \cdot \frac{x}{B}\right) \]
                  10. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\color{blue}{2 \cdot x} + \mathsf{fma}\left(F, F, 2\right)\right)}^{\frac{-1}{2}}}{\sin B}, -1 \cdot \frac{x}{B}\right) \]
                  11. lower-fma.f6457.3

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\color{blue}{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}}^{-0.5}}{\sin B}, -1 \cdot \frac{x}{B}\right) \]
                  12. lift-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, -1 \cdot \color{blue}{\frac{x}{B}}\right) \]
                  13. mul-1-negN/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \mathsf{neg}\left(\frac{x}{B}\right)\right) \]
                  14. lift-/.f64N/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \mathsf{neg}\left(\frac{x}{B}\right)\right) \]
                  15. distribute-neg-fracN/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \frac{\mathsf{neg}\left(x\right)}{\color{blue}{B}}\right) \]
                  16. lift-neg.f64N/A

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}, \frac{-x}{B}\right) \]
                  17. lower-/.f6457.3

                    \[\leadsto \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\color{blue}{B}}\right) \]
                10. Applied rewrites57.3%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{B}\right)} \]
              3. Recombined 2 regimes into one program.
              4. Add Preprocessing

              Alternative 8: 56.8% accurate, 2.2× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 6.5 \cdot 10^{-6}:\\ \;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \end{array} \end{array} \]
              (FPCore (F B x)
               :precision binary64
               (if (<= B 6.5e-6)
                 (/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
                 (/ (- x) (tan B))))
              double code(double F, double B, double x) {
              	double tmp;
              	if (B <= 6.5e-6) {
              		tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
              	} else {
              		tmp = -x / tan(B);
              	}
              	return tmp;
              }
              
              function code(F, B, x)
              	tmp = 0.0
              	if (B <= 6.5e-6)
              		tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B);
              	else
              		tmp = Float64(Float64(-x) / tan(B));
              	end
              	return tmp
              end
              
              code[F_, B_, x_] := If[LessEqual[B, 6.5e-6], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;B \leq 6.5 \cdot 10^{-6}:\\
              \;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{-x}{\tan B}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if B < 6.4999999999999996e-6

                1. Initial program 76.2%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Taylor expanded in B around 0

                  \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\frac{-1}{2}} - x}{B}} \]
                3. Step-by-step derivation
                  1. metadata-evalN/A

                    \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{B} \]
                  2. metadata-evalN/A

                    \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{B} \]
                  3. lower-/.f64N/A

                    \[\leadsto \frac{F \cdot {\left(2 + \left(2 \cdot x + {F}^{2}\right)\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} - x}{\color{blue}{B}} \]
                4. Applied rewrites43.3%

                  \[\leadsto \color{blue}{\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}} \]

                if 6.4999999999999996e-6 < B

                1. Initial program 76.2%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Taylor expanded in F around 0

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

                    \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                  2. lower-/.f64N/A

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                  3. lower-*.f64N/A

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                  4. lower-cos.f64N/A

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  5. lower-sin.f6455.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                4. Applied rewrites55.4%

                  \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                5. Step-by-step derivation
                  1. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  2. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  3. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  4. metadata-eval55.4

                    \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  5. lift-*.f64N/A

                    \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                  6. mul-1-negN/A

                    \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                  7. lift-/.f64N/A

                    \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                  8. lift-*.f64N/A

                    \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                  9. associate-/l*N/A

                    \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                6. Applied rewrites55.5%

                  \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
              3. Recombined 2 regimes into one program.
              4. Add Preprocessing

              Alternative 9: 56.7% accurate, 2.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 6.5 \cdot 10^{-6}:\\ \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{B}, -1 \cdot \frac{x}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \end{array} \end{array} \]
              (FPCore (F B x)
               :precision binary64
               (if (<= B 6.5e-6)
                 (fma (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) (/ 1.0 B) (* -1.0 (/ x B)))
                 (/ (- x) (tan B))))
              double code(double F, double B, double x) {
              	double tmp;
              	if (B <= 6.5e-6) {
              		tmp = fma((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F), (1.0 / B), (-1.0 * (x / B)));
              	} else {
              		tmp = -x / tan(B);
              	}
              	return tmp;
              }
              
              function code(F, B, x)
              	tmp = 0.0
              	if (B <= 6.5e-6)
              		tmp = fma(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F), Float64(1.0 / B), Float64(-1.0 * Float64(x / B)));
              	else
              		tmp = Float64(Float64(-x) / tan(B));
              	end
              	return tmp
              end
              
              code[F_, B_, x_] := If[LessEqual[B, 6.5e-6], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] * N[(1.0 / B), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;B \leq 6.5 \cdot 10^{-6}:\\
              \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{B}, -1 \cdot \frac{x}{B}\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{-x}{\tan B}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if B < 6.4999999999999996e-6

                1. Initial program 76.2%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

                    \[\leadsto \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                  2. +-commutativeN/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right)} \]
                  3. lift-*.f64N/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  4. lift-/.f64N/A

                    \[\leadsto \color{blue}{\frac{F}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  5. associate-*l/N/A

                    \[\leadsto \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  6. associate-/l*N/A

                    \[\leadsto \color{blue}{F \cdot \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                  7. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
                3. Applied rewrites84.8%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)} \]
                4. Step-by-step derivation
                  1. lift-fma.f64N/A

                    \[\leadsto \color{blue}{F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{-x}{\tan B}} \]
                  2. lift-/.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\frac{-x}{\tan B}} \]
                  3. lift-neg.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \frac{\color{blue}{\mathsf{neg}\left(x\right)}}{\tan B} \]
                  4. distribute-frac-negN/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \color{blue}{\left(\mathsf{neg}\left(\frac{x}{\tan B}\right)\right)} \]
                  5. mult-flip-revN/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                  6. lift-/.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(x \cdot \color{blue}{\frac{1}{\tan B}}\right)\right) \]
                  7. lift-*.f64N/A

                    \[\leadsto F \cdot \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B} + \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1}{\tan B}}\right)\right) \]
                  8. lift-/.f64N/A

                    \[\leadsto F \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  9. associate-*r/N/A

                    \[\leadsto \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  10. mult-flipN/A

                    \[\leadsto \color{blue}{\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B}} + \left(\mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right)\right) \]
                  11. lift-neg.f64N/A

                    \[\leadsto \left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}\right) \cdot \frac{1}{\sin B} + \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
                  12. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}, \frac{1}{\sin B}, -x \cdot \frac{1}{\tan B}\right)} \]
                5. Applied rewrites84.8%

                  \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, \frac{-x}{\tan B}\right)} \]
                6. Taylor expanded in B around 0

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F, \frac{1}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                7. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F, \frac{1}{\sin B}, -1 \cdot \color{blue}{\frac{x}{B}}\right) \]
                  2. lower-/.f6457.3

                    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, -1 \cdot \frac{x}{\color{blue}{B}}\right) \]
                8. Applied rewrites57.3%

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\sin B}, \color{blue}{-1 \cdot \frac{x}{B}}\right) \]
                9. Taylor expanded in B around 0

                  \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot F, \frac{1}{\color{blue}{B}}, -1 \cdot \frac{x}{B}\right) \]
                10. Step-by-step derivation
                  1. Applied rewrites43.3%

                    \[\leadsto \mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{1}{\color{blue}{B}}, -1 \cdot \frac{x}{B}\right) \]

                  if 6.4999999999999996e-6 < B

                  1. Initial program 76.2%

                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  2. Taylor expanded in F around 0

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

                      \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                    2. lower-/.f64N/A

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                    3. lower-*.f64N/A

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                    4. lower-cos.f64N/A

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    5. lower-sin.f6455.4

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  4. Applied rewrites55.4%

                    \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                  5. Step-by-step derivation
                    1. metadata-eval55.4

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    2. metadata-eval55.4

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    3. metadata-eval55.4

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    4. metadata-eval55.4

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    5. lift-*.f64N/A

                      \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                    6. mul-1-negN/A

                      \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                    7. lift-/.f64N/A

                      \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                    9. associate-/l*N/A

                      \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                  6. Applied rewrites55.5%

                    \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                11. Recombined 2 regimes into one program.
                12. Add Preprocessing

                Alternative 10: 55.1% accurate, 2.2× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;x \leq -2.3 \cdot 10^{+15}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq -2.3 \cdot 10^{-194}:\\ \;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{B \cdot F}\right|\right)\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-225}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (F B x)
                 :precision binary64
                 (let* ((t_0 (/ (- x) (tan B))))
                   (if (<= x -2.3e+15)
                     t_0
                     (if (<= x -2.3e-194)
                       (* F (fma -1.0 (/ x (* B F)) (fabs (/ 1.0 (* B F)))))
                       (if (<= x 1.4e-225) (/ -1.0 (sin B)) t_0)))))
                double code(double F, double B, double x) {
                	double t_0 = -x / tan(B);
                	double tmp;
                	if (x <= -2.3e+15) {
                		tmp = t_0;
                	} else if (x <= -2.3e-194) {
                		tmp = F * fma(-1.0, (x / (B * F)), fabs((1.0 / (B * F))));
                	} else if (x <= 1.4e-225) {
                		tmp = -1.0 / sin(B);
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                function code(F, B, x)
                	t_0 = Float64(Float64(-x) / tan(B))
                	tmp = 0.0
                	if (x <= -2.3e+15)
                		tmp = t_0;
                	elseif (x <= -2.3e-194)
                		tmp = Float64(F * fma(-1.0, Float64(x / Float64(B * F)), abs(Float64(1.0 / Float64(B * F)))));
                	elseif (x <= 1.4e-225)
                		tmp = Float64(-1.0 / sin(B));
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.3e+15], t$95$0, If[LessEqual[x, -2.3e-194], N[(F * N[(-1.0 * N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[Abs[N[(1.0 / N[(B * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4e-225], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \frac{-x}{\tan B}\\
                \mathbf{if}\;x \leq -2.3 \cdot 10^{+15}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;x \leq -2.3 \cdot 10^{-194}:\\
                \;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{B \cdot F}\right|\right)\\
                
                \mathbf{elif}\;x \leq 1.4 \cdot 10^{-225}:\\
                \;\;\;\;\frac{-1}{\sin B}\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if x < -2.3e15 or 1.4e-225 < x

                  1. Initial program 76.2%

                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  2. Taylor expanded in F around 0

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

                      \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                    2. lower-/.f64N/A

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                    3. lower-*.f64N/A

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                    4. lower-cos.f64N/A

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    5. lower-sin.f6455.4

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  4. Applied rewrites55.4%

                    \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                  5. Step-by-step derivation
                    1. metadata-eval55.4

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    2. metadata-eval55.4

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    3. metadata-eval55.4

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    4. metadata-eval55.4

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    5. lift-*.f64N/A

                      \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                    6. mul-1-negN/A

                      \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                    7. lift-/.f64N/A

                      \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                    8. lift-*.f64N/A

                      \[\leadsto \mathsf{neg}\left(\frac{x \cdot \cos B}{\sin B}\right) \]
                    9. associate-/l*N/A

                      \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                  6. Applied rewrites55.5%

                    \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]

                  if -2.3e15 < x < -2.30000000000000003e-194

                  1. Initial program 76.2%

                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  2. Taylor expanded in F around inf

                    \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                  3. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                    2. lower-fma.f64N/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                    3. lower-/.f64N/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                    4. lower-*.f64N/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                    5. lower-cos.f64N/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                    6. lower-*.f64N/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                    7. lower-sin.f64N/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                    8. lower-/.f64N/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                    9. lower-*.f64N/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                    10. lower-sin.f6447.8

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                  4. Applied rewrites47.8%

                    \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                  5. Taylor expanded in B around 0

                    \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{\color{blue}{B \cdot F}}, \frac{1}{F \cdot \sin B}\right) \]
                  6. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot \color{blue}{F}}, \frac{1}{F \cdot \sin B}\right) \]
                    2. lower-*.f6431.5

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{F \cdot \sin B}\right) \]
                  7. Applied rewrites31.5%

                    \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{\color{blue}{B \cdot F}}, \frac{1}{F \cdot \sin B}\right) \]
                  8. Taylor expanded in B around 0

                    \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{B \cdot F}\right) \]
                  9. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{B \cdot F}\right) \]
                    2. lower-*.f6424.4

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{B \cdot F}\right) \]
                  10. Applied rewrites24.4%

                    \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{B \cdot F}\right) \]
                  11. Step-by-step derivation
                    1. lift-/.f64N/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{B \cdot F}\right) \]
                    2. inv-powN/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, {\left(B \cdot F\right)}^{-1}\right) \]
                    3. pow-to-expN/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(B \cdot F\right) \cdot -1}\right) \]
                    4. exp-fabsN/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|e^{\log \left(B \cdot F\right) \cdot -1}\right|\right) \]
                    5. pow-to-expN/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|{\left(B \cdot F\right)}^{-1}\right|\right) \]
                    6. inv-powN/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{B \cdot F}\right|\right) \]
                    7. lift-/.f64N/A

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{B \cdot F}\right|\right) \]
                    8. lower-fabs.f6426.0

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{B \cdot F}\right|\right) \]
                  12. Applied rewrites26.0%

                    \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{B \cdot F}\right|\right) \]

                  if -2.30000000000000003e-194 < x < 1.4e-225

                  1. Initial program 76.2%

                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  2. Taylor expanded in F around -inf

                    \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                  3. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                    2. lower-sin.f6417.7

                      \[\leadsto \frac{-1}{\sin B} \]
                  4. Applied rewrites17.7%

                    \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                3. Recombined 3 regimes into one program.
                4. Add Preprocessing

                Alternative 11: 52.8% accurate, 2.5× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.5 \cdot 10^{-37}:\\ \;\;\;\;-1 \cdot \frac{x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{\sin B}\\ \end{array} \end{array} \]
                (FPCore (F B x)
                 :precision binary64
                 (if (<= F -1.5e-12)
                   (/ -1.0 (sin B))
                   (if (<= F 1.5e-37) (* -1.0 (/ x (sin B))) (/ (- 1.0 x) (sin B)))))
                double code(double F, double B, double x) {
                	double tmp;
                	if (F <= -1.5e-12) {
                		tmp = -1.0 / sin(B);
                	} else if (F <= 1.5e-37) {
                		tmp = -1.0 * (x / sin(B));
                	} else {
                		tmp = (1.0 - x) / sin(B);
                	}
                	return tmp;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(f, b, x)
                use fmin_fmax_functions
                    real(8), intent (in) :: f
                    real(8), intent (in) :: b
                    real(8), intent (in) :: x
                    real(8) :: tmp
                    if (f <= (-1.5d-12)) then
                        tmp = (-1.0d0) / sin(b)
                    else if (f <= 1.5d-37) then
                        tmp = (-1.0d0) * (x / sin(b))
                    else
                        tmp = (1.0d0 - x) / sin(b)
                    end if
                    code = tmp
                end function
                
                public static double code(double F, double B, double x) {
                	double tmp;
                	if (F <= -1.5e-12) {
                		tmp = -1.0 / Math.sin(B);
                	} else if (F <= 1.5e-37) {
                		tmp = -1.0 * (x / Math.sin(B));
                	} else {
                		tmp = (1.0 - x) / Math.sin(B);
                	}
                	return tmp;
                }
                
                def code(F, B, x):
                	tmp = 0
                	if F <= -1.5e-12:
                		tmp = -1.0 / math.sin(B)
                	elif F <= 1.5e-37:
                		tmp = -1.0 * (x / math.sin(B))
                	else:
                		tmp = (1.0 - x) / math.sin(B)
                	return tmp
                
                function code(F, B, x)
                	tmp = 0.0
                	if (F <= -1.5e-12)
                		tmp = Float64(-1.0 / sin(B));
                	elseif (F <= 1.5e-37)
                		tmp = Float64(-1.0 * Float64(x / sin(B)));
                	else
                		tmp = Float64(Float64(1.0 - x) / sin(B));
                	end
                	return tmp
                end
                
                function tmp_2 = code(F, B, x)
                	tmp = 0.0;
                	if (F <= -1.5e-12)
                		tmp = -1.0 / sin(B);
                	elseif (F <= 1.5e-37)
                		tmp = -1.0 * (x / sin(B));
                	else
                		tmp = (1.0 - x) / sin(B);
                	end
                	tmp_2 = tmp;
                end
                
                code[F_, B_, x_] := If[LessEqual[F, -1.5e-12], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.5e-37], N[(-1.0 * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\
                \;\;\;\;\frac{-1}{\sin B}\\
                
                \mathbf{elif}\;F \leq 1.5 \cdot 10^{-37}:\\
                \;\;\;\;-1 \cdot \frac{x}{\sin B}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{1 - x}{\sin B}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if F < -1.5000000000000001e-12

                  1. Initial program 76.2%

                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  2. Taylor expanded in F around -inf

                    \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                  3. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                    2. lower-sin.f6417.7

                      \[\leadsto \frac{-1}{\sin B} \]
                  4. Applied rewrites17.7%

                    \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

                  if -1.5000000000000001e-12 < F < 1.5e-37

                  1. Initial program 76.2%

                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  2. Taylor expanded in F around 0

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

                      \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                    2. lower-/.f64N/A

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                    3. lower-*.f64N/A

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                    4. lower-cos.f64N/A

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    5. lower-sin.f6455.4

                      \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                  4. Applied rewrites55.4%

                    \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                  5. Taylor expanded in B around 0

                    \[\leadsto -1 \cdot \frac{x}{\sin \color{blue}{B}} \]
                  6. Step-by-step derivation
                    1. Applied rewrites31.1%

                      \[\leadsto -1 \cdot \frac{x}{\sin \color{blue}{B}} \]

                    if 1.5e-37 < F

                    1. Initial program 76.2%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Taylor expanded in F around inf

                      \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                      2. lower-fma.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      3. lower-/.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      5. lower-cos.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      6. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      7. lower-sin.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      8. lower-/.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      9. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      10. lower-sin.f6447.8

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                    4. Applied rewrites47.8%

                      \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                    5. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                      3. lower-*.f6447.8

                        \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                    6. Applied rewrites50.5%

                      \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
                    7. Taylor expanded in B around 0

                      \[\leadsto \frac{1 - x}{\sin B \cdot F} \cdot F \]
                    8. Step-by-step derivation
                      1. lower--.f6435.4

                        \[\leadsto \frac{1 - x}{\sin B \cdot F} \cdot F \]
                    9. Applied rewrites35.4%

                      \[\leadsto \frac{1 - x}{\sin B \cdot F} \cdot F \]
                    10. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto \frac{1 - x}{\sin B \cdot F} \cdot \color{blue}{F} \]
                      2. lift-/.f64N/A

                        \[\leadsto \frac{1 - x}{\sin B \cdot F} \cdot F \]
                      3. associate-*l/N/A

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

                        \[\leadsto \left(1 - x\right) \cdot \color{blue}{\frac{F}{\sin B \cdot F}} \]
                      5. mult-flip-revN/A

                        \[\leadsto \left(1 - x\right) \cdot \left(F \cdot \color{blue}{\frac{1}{\sin B \cdot F}}\right) \]
                      6. lift-*.f64N/A

                        \[\leadsto \left(1 - x\right) \cdot \left(F \cdot \frac{1}{\sin B \cdot \color{blue}{F}}\right) \]
                      7. *-commutativeN/A

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

                        \[\leadsto \left(1 - x\right) \cdot \left(F \cdot \frac{\frac{1}{F}}{\color{blue}{\sin B}}\right) \]
                      9. lift-/.f64N/A

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

                        \[\leadsto \left(1 - x\right) \cdot \frac{F \cdot \frac{1}{F}}{\color{blue}{\sin B}} \]
                      11. lift-/.f64N/A

                        \[\leadsto \left(1 - x\right) \cdot \frac{F \cdot \frac{1}{F}}{\sin B} \]
                      12. rgt-mult-inverseN/A

                        \[\leadsto \left(1 - x\right) \cdot \frac{1}{\sin \color{blue}{B}} \]
                      13. mult-flipN/A

                        \[\leadsto \frac{1 - x}{\color{blue}{\sin B}} \]
                    11. Applied rewrites38.3%

                      \[\leadsto \color{blue}{\frac{1 - x}{\sin B}} \]
                  7. Recombined 3 regimes into one program.
                  8. Add Preprocessing

                  Alternative 12: 51.7% accurate, 2.5× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 4.4 \cdot 10^{-69}:\\ \;\;\;\;-1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{\sin B}\\ \end{array} \end{array} \]
                  (FPCore (F B x)
                   :precision binary64
                   (if (<= F -1.5e-12)
                     (/ -1.0 (sin B))
                     (if (<= F 4.4e-69)
                       (* -1.0 (/ (fma (* (* -0.3333333333333333 x) B) B x) B))
                       (/ (- 1.0 x) (sin B)))))
                  double code(double F, double B, double x) {
                  	double tmp;
                  	if (F <= -1.5e-12) {
                  		tmp = -1.0 / sin(B);
                  	} else if (F <= 4.4e-69) {
                  		tmp = -1.0 * (fma(((-0.3333333333333333 * x) * B), B, x) / B);
                  	} else {
                  		tmp = (1.0 - x) / sin(B);
                  	}
                  	return tmp;
                  }
                  
                  function code(F, B, x)
                  	tmp = 0.0
                  	if (F <= -1.5e-12)
                  		tmp = Float64(-1.0 / sin(B));
                  	elseif (F <= 4.4e-69)
                  		tmp = Float64(-1.0 * Float64(fma(Float64(Float64(-0.3333333333333333 * x) * B), B, x) / B));
                  	else
                  		tmp = Float64(Float64(1.0 - x) / sin(B));
                  	end
                  	return tmp
                  end
                  
                  code[F_, B_, x_] := If[LessEqual[F, -1.5e-12], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.4e-69], N[(-1.0 * N[(N[(N[(N[(-0.3333333333333333 * x), $MachinePrecision] * B), $MachinePrecision] * B + x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\
                  \;\;\;\;\frac{-1}{\sin B}\\
                  
                  \mathbf{elif}\;F \leq 4.4 \cdot 10^{-69}:\\
                  \;\;\;\;-1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{1 - x}{\sin B}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if F < -1.5000000000000001e-12

                    1. Initial program 76.2%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Taylor expanded in F around -inf

                      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                      2. lower-sin.f6417.7

                        \[\leadsto \frac{-1}{\sin B} \]
                    4. Applied rewrites17.7%

                      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

                    if -1.5000000000000001e-12 < F < 4.4e-69

                    1. Initial program 76.2%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Taylor expanded in F around 0

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

                        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                      2. lower-/.f64N/A

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                      3. lower-*.f64N/A

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                      4. lower-cos.f64N/A

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                      5. lower-sin.f6455.4

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    4. Applied rewrites55.4%

                      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                    5. Taylor expanded in B around 0

                      \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)}{\color{blue}{B}} \]
                    6. Step-by-step derivation
                      1. metadata-evalN/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                      2. metadata-evalN/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                      3. lower-/.f64N/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                    7. Applied rewrites28.7%

                      \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}{\color{blue}{B}} \]
                    8. Step-by-step derivation
                      1. lift-+.f64N/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                      2. +-commutativeN/A

                        \[\leadsto -1 \cdot \frac{{B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + x}{B} \]
                      3. lift-*.f64N/A

                        \[\leadsto -1 \cdot \frac{{B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + x}{B} \]
                      4. *-commutativeN/A

                        \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot {B}^{2} + x}{B} \]
                      5. lift-pow.f64N/A

                        \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot {B}^{2} + x}{B} \]
                      6. unpow2N/A

                        \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot \left(B \cdot B\right) + x}{B} \]
                      7. associate-*r*N/A

                        \[\leadsto -1 \cdot \frac{\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B\right) \cdot B + x}{B} \]
                      8. lower-fma.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      9. lower-*.f6428.9

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B, B, x\right)}{B} \]
                      10. lift--.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      11. lift-*.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      12. lift-*.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      13. distribute-rgt-out--N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(x \cdot \left(\frac{-1}{2} - \frac{-1}{6}\right)\right) \cdot B, B, x\right)}{B} \]
                      14. *-commutativeN/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\left(\frac{-1}{2} - \frac{-1}{6}\right) \cdot x\right) \cdot B, B, x\right)}{B} \]
                      15. lower-*.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\left(\frac{-1}{2} - \frac{-1}{6}\right) \cdot x\right) \cdot B, B, x\right)}{B} \]
                      16. metadata-eval28.9

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B} \]
                    9. Applied rewrites28.9%

                      \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B} \]

                    if 4.4e-69 < F

                    1. Initial program 76.2%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Taylor expanded in F around inf

                      \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                      2. lower-fma.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      3. lower-/.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      5. lower-cos.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      6. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      7. lower-sin.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      8. lower-/.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      9. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      10. lower-sin.f6447.8

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                    4. Applied rewrites47.8%

                      \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                    5. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                      3. lower-*.f6447.8

                        \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                    6. Applied rewrites50.5%

                      \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
                    7. Taylor expanded in B around 0

                      \[\leadsto \frac{1 - x}{\sin B \cdot F} \cdot F \]
                    8. Step-by-step derivation
                      1. lower--.f6435.4

                        \[\leadsto \frac{1 - x}{\sin B \cdot F} \cdot F \]
                    9. Applied rewrites35.4%

                      \[\leadsto \frac{1 - x}{\sin B \cdot F} \cdot F \]
                    10. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto \frac{1 - x}{\sin B \cdot F} \cdot \color{blue}{F} \]
                      2. lift-/.f64N/A

                        \[\leadsto \frac{1 - x}{\sin B \cdot F} \cdot F \]
                      3. associate-*l/N/A

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

                        \[\leadsto \left(1 - x\right) \cdot \color{blue}{\frac{F}{\sin B \cdot F}} \]
                      5. mult-flip-revN/A

                        \[\leadsto \left(1 - x\right) \cdot \left(F \cdot \color{blue}{\frac{1}{\sin B \cdot F}}\right) \]
                      6. lift-*.f64N/A

                        \[\leadsto \left(1 - x\right) \cdot \left(F \cdot \frac{1}{\sin B \cdot \color{blue}{F}}\right) \]
                      7. *-commutativeN/A

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

                        \[\leadsto \left(1 - x\right) \cdot \left(F \cdot \frac{\frac{1}{F}}{\color{blue}{\sin B}}\right) \]
                      9. lift-/.f64N/A

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

                        \[\leadsto \left(1 - x\right) \cdot \frac{F \cdot \frac{1}{F}}{\color{blue}{\sin B}} \]
                      11. lift-/.f64N/A

                        \[\leadsto \left(1 - x\right) \cdot \frac{F \cdot \frac{1}{F}}{\sin B} \]
                      12. rgt-mult-inverseN/A

                        \[\leadsto \left(1 - x\right) \cdot \frac{1}{\sin \color{blue}{B}} \]
                      13. mult-flipN/A

                        \[\leadsto \frac{1 - x}{\color{blue}{\sin B}} \]
                    11. Applied rewrites38.3%

                      \[\leadsto \color{blue}{\frac{1 - x}{\sin B}} \]
                  3. Recombined 3 regimes into one program.
                  4. Add Preprocessing

                  Alternative 13: 44.7% accurate, 2.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.32 \cdot 10^{-21}:\\ \;\;\;\;-1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
                  (FPCore (F B x)
                   :precision binary64
                   (if (<= F -1.5e-12)
                     (/ -1.0 (sin B))
                     (if (<= F 1.32e-21)
                       (* -1.0 (/ (fma (* (* -0.3333333333333333 x) B) B x) B))
                       (/ 1.0 (sin B)))))
                  double code(double F, double B, double x) {
                  	double tmp;
                  	if (F <= -1.5e-12) {
                  		tmp = -1.0 / sin(B);
                  	} else if (F <= 1.32e-21) {
                  		tmp = -1.0 * (fma(((-0.3333333333333333 * x) * B), B, x) / B);
                  	} else {
                  		tmp = 1.0 / sin(B);
                  	}
                  	return tmp;
                  }
                  
                  function code(F, B, x)
                  	tmp = 0.0
                  	if (F <= -1.5e-12)
                  		tmp = Float64(-1.0 / sin(B));
                  	elseif (F <= 1.32e-21)
                  		tmp = Float64(-1.0 * Float64(fma(Float64(Float64(-0.3333333333333333 * x) * B), B, x) / B));
                  	else
                  		tmp = Float64(1.0 / sin(B));
                  	end
                  	return tmp
                  end
                  
                  code[F_, B_, x_] := If[LessEqual[F, -1.5e-12], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.32e-21], N[(-1.0 * N[(N[(N[(N[(-0.3333333333333333 * x), $MachinePrecision] * B), $MachinePrecision] * B + x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\
                  \;\;\;\;\frac{-1}{\sin B}\\
                  
                  \mathbf{elif}\;F \leq 1.32 \cdot 10^{-21}:\\
                  \;\;\;\;-1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{1}{\sin B}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if F < -1.5000000000000001e-12

                    1. Initial program 76.2%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Taylor expanded in F around -inf

                      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                      2. lower-sin.f6417.7

                        \[\leadsto \frac{-1}{\sin B} \]
                    4. Applied rewrites17.7%

                      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

                    if -1.5000000000000001e-12 < F < 1.32e-21

                    1. Initial program 76.2%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Taylor expanded in F around 0

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

                        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                      2. lower-/.f64N/A

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                      3. lower-*.f64N/A

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                      4. lower-cos.f64N/A

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                      5. lower-sin.f6455.4

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    4. Applied rewrites55.4%

                      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                    5. Taylor expanded in B around 0

                      \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)}{\color{blue}{B}} \]
                    6. Step-by-step derivation
                      1. metadata-evalN/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                      2. metadata-evalN/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                      3. lower-/.f64N/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                    7. Applied rewrites28.7%

                      \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}{\color{blue}{B}} \]
                    8. Step-by-step derivation
                      1. lift-+.f64N/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                      2. +-commutativeN/A

                        \[\leadsto -1 \cdot \frac{{B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + x}{B} \]
                      3. lift-*.f64N/A

                        \[\leadsto -1 \cdot \frac{{B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + x}{B} \]
                      4. *-commutativeN/A

                        \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot {B}^{2} + x}{B} \]
                      5. lift-pow.f64N/A

                        \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot {B}^{2} + x}{B} \]
                      6. unpow2N/A

                        \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot \left(B \cdot B\right) + x}{B} \]
                      7. associate-*r*N/A

                        \[\leadsto -1 \cdot \frac{\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B\right) \cdot B + x}{B} \]
                      8. lower-fma.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      9. lower-*.f6428.9

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B, B, x\right)}{B} \]
                      10. lift--.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      11. lift-*.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      12. lift-*.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      13. distribute-rgt-out--N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(x \cdot \left(\frac{-1}{2} - \frac{-1}{6}\right)\right) \cdot B, B, x\right)}{B} \]
                      14. *-commutativeN/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\left(\frac{-1}{2} - \frac{-1}{6}\right) \cdot x\right) \cdot B, B, x\right)}{B} \]
                      15. lower-*.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\left(\frac{-1}{2} - \frac{-1}{6}\right) \cdot x\right) \cdot B, B, x\right)}{B} \]
                      16. metadata-eval28.9

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B} \]
                    9. Applied rewrites28.9%

                      \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B} \]

                    if 1.32e-21 < F

                    1. Initial program 76.2%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Taylor expanded in F around inf

                      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{1}{\color{blue}{\sin B}} \]
                      2. lower-sin.f6416.9

                        \[\leadsto \frac{1}{\sin B} \]
                    4. Applied rewrites16.9%

                      \[\leadsto \color{blue}{\frac{1}{\sin B}} \]
                  3. Recombined 3 regimes into one program.
                  4. Add Preprocessing

                  Alternative 14: 43.8% accurate, 2.9× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{-69}:\\ \;\;\;\;-1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \end{array} \]
                  (FPCore (F B x)
                   :precision binary64
                   (if (<= F -1.5e-12)
                     (/ -1.0 (sin B))
                     (if (<= F 9.2e-69)
                       (* -1.0 (/ (fma (* (* -0.3333333333333333 x) B) B x) B))
                       (- (/ 1.0 B) (/ x B)))))
                  double code(double F, double B, double x) {
                  	double tmp;
                  	if (F <= -1.5e-12) {
                  		tmp = -1.0 / sin(B);
                  	} else if (F <= 9.2e-69) {
                  		tmp = -1.0 * (fma(((-0.3333333333333333 * x) * B), B, x) / B);
                  	} else {
                  		tmp = (1.0 / B) - (x / B);
                  	}
                  	return tmp;
                  }
                  
                  function code(F, B, x)
                  	tmp = 0.0
                  	if (F <= -1.5e-12)
                  		tmp = Float64(-1.0 / sin(B));
                  	elseif (F <= 9.2e-69)
                  		tmp = Float64(-1.0 * Float64(fma(Float64(Float64(-0.3333333333333333 * x) * B), B, x) / B));
                  	else
                  		tmp = Float64(Float64(1.0 / B) - Float64(x / B));
                  	end
                  	return tmp
                  end
                  
                  code[F_, B_, x_] := If[LessEqual[F, -1.5e-12], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.2e-69], N[(-1.0 * N[(N[(N[(N[(-0.3333333333333333 * x), $MachinePrecision] * B), $MachinePrecision] * B + x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\
                  \;\;\;\;\frac{-1}{\sin B}\\
                  
                  \mathbf{elif}\;F \leq 9.2 \cdot 10^{-69}:\\
                  \;\;\;\;-1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{1}{B} - \frac{x}{B}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if F < -1.5000000000000001e-12

                    1. Initial program 76.2%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Taylor expanded in F around -inf

                      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                      2. lower-sin.f6417.7

                        \[\leadsto \frac{-1}{\sin B} \]
                    4. Applied rewrites17.7%

                      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]

                    if -1.5000000000000001e-12 < F < 9.2000000000000003e-69

                    1. Initial program 76.2%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Taylor expanded in F around 0

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

                        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                      2. lower-/.f64N/A

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                      3. lower-*.f64N/A

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                      4. lower-cos.f64N/A

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                      5. lower-sin.f6455.4

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    4. Applied rewrites55.4%

                      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                    5. Taylor expanded in B around 0

                      \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)}{\color{blue}{B}} \]
                    6. Step-by-step derivation
                      1. metadata-evalN/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                      2. metadata-evalN/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                      3. lower-/.f64N/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                    7. Applied rewrites28.7%

                      \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}{\color{blue}{B}} \]
                    8. Step-by-step derivation
                      1. lift-+.f64N/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                      2. +-commutativeN/A

                        \[\leadsto -1 \cdot \frac{{B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + x}{B} \]
                      3. lift-*.f64N/A

                        \[\leadsto -1 \cdot \frac{{B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + x}{B} \]
                      4. *-commutativeN/A

                        \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot {B}^{2} + x}{B} \]
                      5. lift-pow.f64N/A

                        \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot {B}^{2} + x}{B} \]
                      6. unpow2N/A

                        \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot \left(B \cdot B\right) + x}{B} \]
                      7. associate-*r*N/A

                        \[\leadsto -1 \cdot \frac{\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B\right) \cdot B + x}{B} \]
                      8. lower-fma.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      9. lower-*.f6428.9

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B, B, x\right)}{B} \]
                      10. lift--.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      11. lift-*.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      12. lift-*.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      13. distribute-rgt-out--N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(x \cdot \left(\frac{-1}{2} - \frac{-1}{6}\right)\right) \cdot B, B, x\right)}{B} \]
                      14. *-commutativeN/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\left(\frac{-1}{2} - \frac{-1}{6}\right) \cdot x\right) \cdot B, B, x\right)}{B} \]
                      15. lower-*.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\left(\frac{-1}{2} - \frac{-1}{6}\right) \cdot x\right) \cdot B, B, x\right)}{B} \]
                      16. metadata-eval28.9

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B} \]
                    9. Applied rewrites28.9%

                      \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B} \]

                    if 9.2000000000000003e-69 < F

                    1. Initial program 76.2%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Taylor expanded in F around inf

                      \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                      2. lower-fma.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      3. lower-/.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      5. lower-cos.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      6. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      7. lower-sin.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      8. lower-/.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      9. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      10. lower-sin.f6447.8

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                    4. Applied rewrites47.8%

                      \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                    5. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                      3. lower-*.f6447.8

                        \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                    6. Applied rewrites50.5%

                      \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
                    7. Taylor expanded in B around 0

                      \[\leadsto \frac{1 - x}{\color{blue}{B}} \]
                    8. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{1 - x}{B} \]
                      2. lower--.f6429.7

                        \[\leadsto \frac{1 - x}{B} \]
                    9. Applied rewrites29.7%

                      \[\leadsto \frac{1 - x}{\color{blue}{B}} \]
                    10. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \frac{1 - x}{B} \]
                      2. lift--.f64N/A

                        \[\leadsto \frac{1 - x}{B} \]
                      3. div-subN/A

                        \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                      4. lift-/.f64N/A

                        \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                      5. lower--.f64N/A

                        \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                      6. lower-/.f6429.7

                        \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                    11. Applied rewrites29.7%

                      \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                  3. Recombined 3 regimes into one program.
                  4. Add Preprocessing

                  Alternative 15: 39.2% accurate, 4.4× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.9 \cdot 10^{-61}:\\ \;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{B \cdot F}\right|\right)\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{-69}:\\ \;\;\;\;-1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \end{array} \]
                  (FPCore (F B x)
                   :precision binary64
                   (if (<= F -5.9e-61)
                     (* F (fma -1.0 (/ x (* B F)) (fabs (/ 1.0 (* B F)))))
                     (if (<= F 9.2e-69)
                       (* -1.0 (/ (fma (* (* -0.3333333333333333 x) B) B x) B))
                       (- (/ 1.0 B) (/ x B)))))
                  double code(double F, double B, double x) {
                  	double tmp;
                  	if (F <= -5.9e-61) {
                  		tmp = F * fma(-1.0, (x / (B * F)), fabs((1.0 / (B * F))));
                  	} else if (F <= 9.2e-69) {
                  		tmp = -1.0 * (fma(((-0.3333333333333333 * x) * B), B, x) / B);
                  	} else {
                  		tmp = (1.0 / B) - (x / B);
                  	}
                  	return tmp;
                  }
                  
                  function code(F, B, x)
                  	tmp = 0.0
                  	if (F <= -5.9e-61)
                  		tmp = Float64(F * fma(-1.0, Float64(x / Float64(B * F)), abs(Float64(1.0 / Float64(B * F)))));
                  	elseif (F <= 9.2e-69)
                  		tmp = Float64(-1.0 * Float64(fma(Float64(Float64(-0.3333333333333333 * x) * B), B, x) / B));
                  	else
                  		tmp = Float64(Float64(1.0 / B) - Float64(x / B));
                  	end
                  	return tmp
                  end
                  
                  code[F_, B_, x_] := If[LessEqual[F, -5.9e-61], N[(F * N[(-1.0 * N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[Abs[N[(1.0 / N[(B * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.2e-69], N[(-1.0 * N[(N[(N[(N[(-0.3333333333333333 * x), $MachinePrecision] * B), $MachinePrecision] * B + x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;F \leq -5.9 \cdot 10^{-61}:\\
                  \;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{B \cdot F}\right|\right)\\
                  
                  \mathbf{elif}\;F \leq 9.2 \cdot 10^{-69}:\\
                  \;\;\;\;-1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{1}{B} - \frac{x}{B}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if F < -5.89999999999999972e-61

                    1. Initial program 76.2%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Taylor expanded in F around inf

                      \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                      2. lower-fma.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      3. lower-/.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      5. lower-cos.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      6. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      7. lower-sin.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      8. lower-/.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      9. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      10. lower-sin.f6447.8

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                    4. Applied rewrites47.8%

                      \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                    5. Taylor expanded in B around 0

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{\color{blue}{B \cdot F}}, \frac{1}{F \cdot \sin B}\right) \]
                    6. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot \color{blue}{F}}, \frac{1}{F \cdot \sin B}\right) \]
                      2. lower-*.f6431.5

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{F \cdot \sin B}\right) \]
                    7. Applied rewrites31.5%

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{\color{blue}{B \cdot F}}, \frac{1}{F \cdot \sin B}\right) \]
                    8. Taylor expanded in B around 0

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{B \cdot F}\right) \]
                    9. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{B \cdot F}\right) \]
                      2. lower-*.f6424.4

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{B \cdot F}\right) \]
                    10. Applied rewrites24.4%

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{B \cdot F}\right) \]
                    11. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{B \cdot F}\right) \]
                      2. inv-powN/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, {\left(B \cdot F\right)}^{-1}\right) \]
                      3. pow-to-expN/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(B \cdot F\right) \cdot -1}\right) \]
                      4. exp-fabsN/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|e^{\log \left(B \cdot F\right) \cdot -1}\right|\right) \]
                      5. pow-to-expN/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|{\left(B \cdot F\right)}^{-1}\right|\right) \]
                      6. inv-powN/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{B \cdot F}\right|\right) \]
                      7. lift-/.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{B \cdot F}\right|\right) \]
                      8. lower-fabs.f6426.0

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{B \cdot F}\right|\right) \]
                    12. Applied rewrites26.0%

                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{B \cdot F}\right|\right) \]

                    if -5.89999999999999972e-61 < F < 9.2000000000000003e-69

                    1. Initial program 76.2%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Taylor expanded in F around 0

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

                        \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                      2. lower-/.f64N/A

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                      3. lower-*.f64N/A

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                      4. lower-cos.f64N/A

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                      5. lower-sin.f6455.4

                        \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                    4. Applied rewrites55.4%

                      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                    5. Taylor expanded in B around 0

                      \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)}{\color{blue}{B}} \]
                    6. Step-by-step derivation
                      1. metadata-evalN/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                      2. metadata-evalN/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                      3. lower-/.f64N/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                    7. Applied rewrites28.7%

                      \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}{\color{blue}{B}} \]
                    8. Step-by-step derivation
                      1. lift-+.f64N/A

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                      2. +-commutativeN/A

                        \[\leadsto -1 \cdot \frac{{B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + x}{B} \]
                      3. lift-*.f64N/A

                        \[\leadsto -1 \cdot \frac{{B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + x}{B} \]
                      4. *-commutativeN/A

                        \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot {B}^{2} + x}{B} \]
                      5. lift-pow.f64N/A

                        \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot {B}^{2} + x}{B} \]
                      6. unpow2N/A

                        \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot \left(B \cdot B\right) + x}{B} \]
                      7. associate-*r*N/A

                        \[\leadsto -1 \cdot \frac{\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B\right) \cdot B + x}{B} \]
                      8. lower-fma.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      9. lower-*.f6428.9

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B, B, x\right)}{B} \]
                      10. lift--.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      11. lift-*.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      12. lift-*.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                      13. distribute-rgt-out--N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(x \cdot \left(\frac{-1}{2} - \frac{-1}{6}\right)\right) \cdot B, B, x\right)}{B} \]
                      14. *-commutativeN/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\left(\frac{-1}{2} - \frac{-1}{6}\right) \cdot x\right) \cdot B, B, x\right)}{B} \]
                      15. lower-*.f64N/A

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\left(\frac{-1}{2} - \frac{-1}{6}\right) \cdot x\right) \cdot B, B, x\right)}{B} \]
                      16. metadata-eval28.9

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B} \]
                    9. Applied rewrites28.9%

                      \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B} \]

                    if 9.2000000000000003e-69 < F

                    1. Initial program 76.2%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Taylor expanded in F around inf

                      \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                      2. lower-fma.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      3. lower-/.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      4. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      5. lower-cos.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      6. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                      7. lower-sin.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      8. lower-/.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      9. lower-*.f64N/A

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      10. lower-sin.f6447.8

                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                    4. Applied rewrites47.8%

                      \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                    5. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                      3. lower-*.f6447.8

                        \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                    6. Applied rewrites50.5%

                      \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
                    7. Taylor expanded in B around 0

                      \[\leadsto \frac{1 - x}{\color{blue}{B}} \]
                    8. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{1 - x}{B} \]
                      2. lower--.f6429.7

                        \[\leadsto \frac{1 - x}{B} \]
                    9. Applied rewrites29.7%

                      \[\leadsto \frac{1 - x}{\color{blue}{B}} \]
                    10. Step-by-step derivation
                      1. lift-/.f64N/A

                        \[\leadsto \frac{1 - x}{B} \]
                      2. lift--.f64N/A

                        \[\leadsto \frac{1 - x}{B} \]
                      3. div-subN/A

                        \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                      4. lift-/.f64N/A

                        \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                      5. lower--.f64N/A

                        \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                      6. lower-/.f6429.7

                        \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                    11. Applied rewrites29.7%

                      \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                  3. Recombined 3 regimes into one program.
                  4. Add Preprocessing

                  Alternative 16: 36.9% accurate, 4.5× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{-69}:\\ \;\;\;\;-1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \end{array} \]
                  (FPCore (F B x)
                   :precision binary64
                   (if (<= F -1.5e-12)
                     (/ -1.0 B)
                     (if (<= F 9.2e-69)
                       (* -1.0 (/ (fma (* (* -0.3333333333333333 x) B) B x) B))
                       (- (/ 1.0 B) (/ x B)))))
                  double code(double F, double B, double x) {
                  	double tmp;
                  	if (F <= -1.5e-12) {
                  		tmp = -1.0 / B;
                  	} else if (F <= 9.2e-69) {
                  		tmp = -1.0 * (fma(((-0.3333333333333333 * x) * B), B, x) / B);
                  	} else {
                  		tmp = (1.0 / B) - (x / B);
                  	}
                  	return tmp;
                  }
                  
                  function code(F, B, x)
                  	tmp = 0.0
                  	if (F <= -1.5e-12)
                  		tmp = Float64(-1.0 / B);
                  	elseif (F <= 9.2e-69)
                  		tmp = Float64(-1.0 * Float64(fma(Float64(Float64(-0.3333333333333333 * x) * B), B, x) / B));
                  	else
                  		tmp = Float64(Float64(1.0 / B) - Float64(x / B));
                  	end
                  	return tmp
                  end
                  
                  code[F_, B_, x_] := If[LessEqual[F, -1.5e-12], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 9.2e-69], N[(-1.0 * N[(N[(N[(N[(-0.3333333333333333 * x), $MachinePrecision] * B), $MachinePrecision] * B + x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\
                  \;\;\;\;\frac{-1}{B}\\
                  
                  \mathbf{elif}\;F \leq 9.2 \cdot 10^{-69}:\\
                  \;\;\;\;-1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{1}{B} - \frac{x}{B}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if F < -1.5000000000000001e-12

                    1. Initial program 76.2%

                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                    2. Taylor expanded in F around -inf

                      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                    3. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                      2. lower-sin.f6417.7

                        \[\leadsto \frac{-1}{\sin B} \]
                    4. Applied rewrites17.7%

                      \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                    5. Taylor expanded in B around 0

                      \[\leadsto \frac{-1}{B} \]
                    6. Step-by-step derivation
                      1. Applied rewrites10.8%

                        \[\leadsto \frac{-1}{B} \]

                      if -1.5000000000000001e-12 < F < 9.2000000000000003e-69

                      1. Initial program 76.2%

                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                      2. Taylor expanded in F around 0

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

                          \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                        2. lower-/.f64N/A

                          \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                        3. lower-*.f64N/A

                          \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                        4. lower-cos.f64N/A

                          \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                        5. lower-sin.f6455.4

                          \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                      4. Applied rewrites55.4%

                        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                      5. Taylor expanded in B around 0

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)}{\color{blue}{B}} \]
                      6. Step-by-step derivation
                        1. metadata-evalN/A

                          \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                        2. metadata-evalN/A

                          \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                        3. lower-/.f64N/A

                          \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                      7. Applied rewrites28.7%

                        \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}{\color{blue}{B}} \]
                      8. Step-by-step derivation
                        1. lift-+.f64N/A

                          \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                        2. +-commutativeN/A

                          \[\leadsto -1 \cdot \frac{{B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + x}{B} \]
                        3. lift-*.f64N/A

                          \[\leadsto -1 \cdot \frac{{B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) + x}{B} \]
                        4. *-commutativeN/A

                          \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot {B}^{2} + x}{B} \]
                        5. lift-pow.f64N/A

                          \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot {B}^{2} + x}{B} \]
                        6. unpow2N/A

                          \[\leadsto -1 \cdot \frac{\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot \left(B \cdot B\right) + x}{B} \]
                        7. associate-*r*N/A

                          \[\leadsto -1 \cdot \frac{\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B\right) \cdot B + x}{B} \]
                        8. lower-fma.f64N/A

                          \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                        9. lower-*.f6428.9

                          \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right) \cdot B, B, x\right)}{B} \]
                        10. lift--.f64N/A

                          \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                        11. lift-*.f64N/A

                          \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                        12. lift-*.f64N/A

                          \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right) \cdot B, B, x\right)}{B} \]
                        13. distribute-rgt-out--N/A

                          \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(x \cdot \left(\frac{-1}{2} - \frac{-1}{6}\right)\right) \cdot B, B, x\right)}{B} \]
                        14. *-commutativeN/A

                          \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\left(\frac{-1}{2} - \frac{-1}{6}\right) \cdot x\right) \cdot B, B, x\right)}{B} \]
                        15. lower-*.f64N/A

                          \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(\left(\frac{-1}{2} - \frac{-1}{6}\right) \cdot x\right) \cdot B, B, x\right)}{B} \]
                        16. metadata-eval28.9

                          \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B} \]
                      9. Applied rewrites28.9%

                        \[\leadsto -1 \cdot \frac{\mathsf{fma}\left(\left(-0.3333333333333333 \cdot x\right) \cdot B, B, x\right)}{B} \]

                      if 9.2000000000000003e-69 < F

                      1. Initial program 76.2%

                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                      2. Taylor expanded in F around inf

                        \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                      3. Step-by-step derivation
                        1. lower-*.f64N/A

                          \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                        2. lower-fma.f64N/A

                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                        3. lower-/.f64N/A

                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                        4. lower-*.f64N/A

                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                        5. lower-cos.f64N/A

                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                        6. lower-*.f64N/A

                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                        7. lower-sin.f64N/A

                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                        8. lower-/.f64N/A

                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                        9. lower-*.f64N/A

                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                        10. lower-sin.f6447.8

                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                      4. Applied rewrites47.8%

                        \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                      5. Step-by-step derivation
                        1. lift-*.f64N/A

                          \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                        2. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                        3. lower-*.f6447.8

                          \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                      6. Applied rewrites50.5%

                        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
                      7. Taylor expanded in B around 0

                        \[\leadsto \frac{1 - x}{\color{blue}{B}} \]
                      8. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \frac{1 - x}{B} \]
                        2. lower--.f6429.7

                          \[\leadsto \frac{1 - x}{B} \]
                      9. Applied rewrites29.7%

                        \[\leadsto \frac{1 - x}{\color{blue}{B}} \]
                      10. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \frac{1 - x}{B} \]
                        2. lift--.f64N/A

                          \[\leadsto \frac{1 - x}{B} \]
                        3. div-subN/A

                          \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                        4. lift-/.f64N/A

                          \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                        5. lower--.f64N/A

                          \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                        6. lower-/.f6429.7

                          \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                      11. Applied rewrites29.7%

                        \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                    7. Recombined 3 regimes into one program.
                    8. Add Preprocessing

                    Alternative 17: 36.9% accurate, 4.9× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 9.2 \cdot 10^{-69}:\\ \;\;\;\;-\frac{\mathsf{fma}\left(-0.3333333333333333 \cdot x, B \cdot B, x\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \end{array} \]
                    (FPCore (F B x)
                     :precision binary64
                     (if (<= F -1.5e-12)
                       (/ -1.0 B)
                       (if (<= F 9.2e-69)
                         (- (/ (fma (* -0.3333333333333333 x) (* B B) x) B))
                         (- (/ 1.0 B) (/ x B)))))
                    double code(double F, double B, double x) {
                    	double tmp;
                    	if (F <= -1.5e-12) {
                    		tmp = -1.0 / B;
                    	} else if (F <= 9.2e-69) {
                    		tmp = -(fma((-0.3333333333333333 * x), (B * B), x) / B);
                    	} else {
                    		tmp = (1.0 / B) - (x / B);
                    	}
                    	return tmp;
                    }
                    
                    function code(F, B, x)
                    	tmp = 0.0
                    	if (F <= -1.5e-12)
                    		tmp = Float64(-1.0 / B);
                    	elseif (F <= 9.2e-69)
                    		tmp = Float64(-Float64(fma(Float64(-0.3333333333333333 * x), Float64(B * B), x) / B));
                    	else
                    		tmp = Float64(Float64(1.0 / B) - Float64(x / B));
                    	end
                    	return tmp
                    end
                    
                    code[F_, B_, x_] := If[LessEqual[F, -1.5e-12], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 9.2e-69], (-N[(N[(N[(-0.3333333333333333 * x), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] / B), $MachinePrecision]), N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\
                    \;\;\;\;\frac{-1}{B}\\
                    
                    \mathbf{elif}\;F \leq 9.2 \cdot 10^{-69}:\\
                    \;\;\;\;-\frac{\mathsf{fma}\left(-0.3333333333333333 \cdot x, B \cdot B, x\right)}{B}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{1}{B} - \frac{x}{B}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if F < -1.5000000000000001e-12

                      1. Initial program 76.2%

                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                      2. Taylor expanded in F around -inf

                        \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                      3. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                        2. lower-sin.f6417.7

                          \[\leadsto \frac{-1}{\sin B} \]
                      4. Applied rewrites17.7%

                        \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                      5. Taylor expanded in B around 0

                        \[\leadsto \frac{-1}{B} \]
                      6. Step-by-step derivation
                        1. Applied rewrites10.8%

                          \[\leadsto \frac{-1}{B} \]

                        if -1.5000000000000001e-12 < F < 9.2000000000000003e-69

                        1. Initial program 76.2%

                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                        2. Taylor expanded in F around 0

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

                            \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                          2. lower-/.f64N/A

                            \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                          3. lower-*.f64N/A

                            \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                          4. lower-cos.f64N/A

                            \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                          5. lower-sin.f6455.4

                            \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                        4. Applied rewrites55.4%

                          \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                        5. Taylor expanded in B around 0

                          \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)}{\color{blue}{B}} \]
                        6. Step-by-step derivation
                          1. metadata-evalN/A

                            \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                          2. metadata-evalN/A

                            \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                          3. lower-/.f64N/A

                            \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)}{B} \]
                        7. Applied rewrites28.7%

                          \[\leadsto -1 \cdot \frac{x + {B}^{2} \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}{\color{blue}{B}} \]
                        8. Step-by-step derivation
                          1. lift-*.f64N/A

                            \[\leadsto -1 \cdot \color{blue}{\frac{x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)}{B}} \]
                          2. mul-1-negN/A

                            \[\leadsto \mathsf{neg}\left(\frac{x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)}{B}\right) \]
                          3. lower-neg.f6428.7

                            \[\leadsto -\frac{x + {B}^{2} \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)}{B} \]
                        9. Applied rewrites28.7%

                          \[\leadsto \color{blue}{-\frac{\mathsf{fma}\left(-0.3333333333333333 \cdot x, B \cdot B, x\right)}{B}} \]

                        if 9.2000000000000003e-69 < F

                        1. Initial program 76.2%

                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                        2. Taylor expanded in F around inf

                          \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                        3. Step-by-step derivation
                          1. lower-*.f64N/A

                            \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                          2. lower-fma.f64N/A

                            \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                          3. lower-/.f64N/A

                            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                          4. lower-*.f64N/A

                            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                          5. lower-cos.f64N/A

                            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                          6. lower-*.f64N/A

                            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                          7. lower-sin.f64N/A

                            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                          8. lower-/.f64N/A

                            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                          9. lower-*.f64N/A

                            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                          10. lower-sin.f6447.8

                            \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                        4. Applied rewrites47.8%

                          \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                        5. Step-by-step derivation
                          1. lift-*.f64N/A

                            \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                          2. *-commutativeN/A

                            \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                          3. lower-*.f6447.8

                            \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                        6. Applied rewrites50.5%

                          \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
                        7. Taylor expanded in B around 0

                          \[\leadsto \frac{1 - x}{\color{blue}{B}} \]
                        8. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{1 - x}{B} \]
                          2. lower--.f6429.7

                            \[\leadsto \frac{1 - x}{B} \]
                        9. Applied rewrites29.7%

                          \[\leadsto \frac{1 - x}{\color{blue}{B}} \]
                        10. Step-by-step derivation
                          1. lift-/.f64N/A

                            \[\leadsto \frac{1 - x}{B} \]
                          2. lift--.f64N/A

                            \[\leadsto \frac{1 - x}{B} \]
                          3. div-subN/A

                            \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                          4. lift-/.f64N/A

                            \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                          5. lower--.f64N/A

                            \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                          6. lower-/.f6429.7

                            \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                        11. Applied rewrites29.7%

                          \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                      7. Recombined 3 regimes into one program.
                      8. Add Preprocessing

                      Alternative 18: 36.8% accurate, 6.4× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 3.7 \cdot 10^{-64}:\\ \;\;\;\;-1 \cdot \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \end{array} \]
                      (FPCore (F B x)
                       :precision binary64
                       (if (<= F -1.5e-12)
                         (/ -1.0 B)
                         (if (<= F 3.7e-64) (* -1.0 (/ x B)) (- (/ 1.0 B) (/ x B)))))
                      double code(double F, double B, double x) {
                      	double tmp;
                      	if (F <= -1.5e-12) {
                      		tmp = -1.0 / B;
                      	} else if (F <= 3.7e-64) {
                      		tmp = -1.0 * (x / B);
                      	} else {
                      		tmp = (1.0 / B) - (x / B);
                      	}
                      	return tmp;
                      }
                      
                      module fmin_fmax_functions
                          implicit none
                          private
                          public fmax
                          public fmin
                      
                          interface fmax
                              module procedure fmax88
                              module procedure fmax44
                              module procedure fmax84
                              module procedure fmax48
                          end interface
                          interface fmin
                              module procedure fmin88
                              module procedure fmin44
                              module procedure fmin84
                              module procedure fmin48
                          end interface
                      contains
                          real(8) function fmax88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmax44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmax84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmax48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                          end function
                          real(8) function fmin88(x, y) result (res)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(4) function fmin44(x, y) result (res)
                              real(4), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                          end function
                          real(8) function fmin84(x, y) result(res)
                              real(8), intent (in) :: x
                              real(4), intent (in) :: y
                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                          end function
                          real(8) function fmin48(x, y) result(res)
                              real(4), intent (in) :: x
                              real(8), intent (in) :: y
                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                          end function
                      end module
                      
                      real(8) function code(f, b, x)
                      use fmin_fmax_functions
                          real(8), intent (in) :: f
                          real(8), intent (in) :: b
                          real(8), intent (in) :: x
                          real(8) :: tmp
                          if (f <= (-1.5d-12)) then
                              tmp = (-1.0d0) / b
                          else if (f <= 3.7d-64) then
                              tmp = (-1.0d0) * (x / b)
                          else
                              tmp = (1.0d0 / b) - (x / b)
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double F, double B, double x) {
                      	double tmp;
                      	if (F <= -1.5e-12) {
                      		tmp = -1.0 / B;
                      	} else if (F <= 3.7e-64) {
                      		tmp = -1.0 * (x / B);
                      	} else {
                      		tmp = (1.0 / B) - (x / B);
                      	}
                      	return tmp;
                      }
                      
                      def code(F, B, x):
                      	tmp = 0
                      	if F <= -1.5e-12:
                      		tmp = -1.0 / B
                      	elif F <= 3.7e-64:
                      		tmp = -1.0 * (x / B)
                      	else:
                      		tmp = (1.0 / B) - (x / B)
                      	return tmp
                      
                      function code(F, B, x)
                      	tmp = 0.0
                      	if (F <= -1.5e-12)
                      		tmp = Float64(-1.0 / B);
                      	elseif (F <= 3.7e-64)
                      		tmp = Float64(-1.0 * Float64(x / B));
                      	else
                      		tmp = Float64(Float64(1.0 / B) - Float64(x / B));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(F, B, x)
                      	tmp = 0.0;
                      	if (F <= -1.5e-12)
                      		tmp = -1.0 / B;
                      	elseif (F <= 3.7e-64)
                      		tmp = -1.0 * (x / B);
                      	else
                      		tmp = (1.0 / B) - (x / B);
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[F_, B_, x_] := If[LessEqual[F, -1.5e-12], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 3.7e-64], N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\
                      \;\;\;\;\frac{-1}{B}\\
                      
                      \mathbf{elif}\;F \leq 3.7 \cdot 10^{-64}:\\
                      \;\;\;\;-1 \cdot \frac{x}{B}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{1}{B} - \frac{x}{B}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if F < -1.5000000000000001e-12

                        1. Initial program 76.2%

                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                        2. Taylor expanded in F around -inf

                          \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                        3. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                          2. lower-sin.f6417.7

                            \[\leadsto \frac{-1}{\sin B} \]
                        4. Applied rewrites17.7%

                          \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                        5. Taylor expanded in B around 0

                          \[\leadsto \frac{-1}{B} \]
                        6. Step-by-step derivation
                          1. Applied rewrites10.8%

                            \[\leadsto \frac{-1}{B} \]

                          if -1.5000000000000001e-12 < F < 3.69999999999999999e-64

                          1. Initial program 76.2%

                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                          2. Taylor expanded in F around 0

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

                              \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                            2. lower-/.f64N/A

                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                            3. lower-*.f64N/A

                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                            4. lower-cos.f64N/A

                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                            5. lower-sin.f6455.4

                              \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                          4. Applied rewrites55.4%

                            \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                          5. Taylor expanded in B around 0

                            \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]
                          6. Step-by-step derivation
                            1. lower-/.f6428.8

                              \[\leadsto -1 \cdot \frac{x}{B} \]
                          7. Applied rewrites28.8%

                            \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]

                          if 3.69999999999999999e-64 < F

                          1. Initial program 76.2%

                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                          2. Taylor expanded in F around inf

                            \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                          3. Step-by-step derivation
                            1. lower-*.f64N/A

                              \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                            2. lower-fma.f64N/A

                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                            3. lower-/.f64N/A

                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                            4. lower-*.f64N/A

                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                            5. lower-cos.f64N/A

                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                            6. lower-*.f64N/A

                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                            7. lower-sin.f64N/A

                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                            8. lower-/.f64N/A

                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                            9. lower-*.f64N/A

                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                            10. lower-sin.f6447.8

                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                          4. Applied rewrites47.8%

                            \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                          5. Step-by-step derivation
                            1. lift-*.f64N/A

                              \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                            2. *-commutativeN/A

                              \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                            3. lower-*.f6447.8

                              \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                          6. Applied rewrites50.5%

                            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
                          7. Taylor expanded in B around 0

                            \[\leadsto \frac{1 - x}{\color{blue}{B}} \]
                          8. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{1 - x}{B} \]
                            2. lower--.f6429.7

                              \[\leadsto \frac{1 - x}{B} \]
                          9. Applied rewrites29.7%

                            \[\leadsto \frac{1 - x}{\color{blue}{B}} \]
                          10. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \frac{1 - x}{B} \]
                            2. lift--.f64N/A

                              \[\leadsto \frac{1 - x}{B} \]
                            3. div-subN/A

                              \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                            4. lift-/.f64N/A

                              \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                            5. lower--.f64N/A

                              \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                            6. lower-/.f6429.7

                              \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                          11. Applied rewrites29.7%

                            \[\leadsto \frac{1}{B} - \frac{x}{\color{blue}{B}} \]
                        7. Recombined 3 regimes into one program.
                        8. Add Preprocessing

                        Alternative 19: 36.7% accurate, 7.8× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 3.7 \cdot 10^{-64}:\\ \;\;\;\;-1 \cdot \frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                        (FPCore (F B x)
                         :precision binary64
                         (if (<= F -1.5e-12)
                           (/ -1.0 B)
                           (if (<= F 3.7e-64) (* -1.0 (/ x B)) (/ (- 1.0 x) B))))
                        double code(double F, double B, double x) {
                        	double tmp;
                        	if (F <= -1.5e-12) {
                        		tmp = -1.0 / B;
                        	} else if (F <= 3.7e-64) {
                        		tmp = -1.0 * (x / B);
                        	} else {
                        		tmp = (1.0 - x) / B;
                        	}
                        	return tmp;
                        }
                        
                        module fmin_fmax_functions
                            implicit none
                            private
                            public fmax
                            public fmin
                        
                            interface fmax
                                module procedure fmax88
                                module procedure fmax44
                                module procedure fmax84
                                module procedure fmax48
                            end interface
                            interface fmin
                                module procedure fmin88
                                module procedure fmin44
                                module procedure fmin84
                                module procedure fmin48
                            end interface
                        contains
                            real(8) function fmax88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmax44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmax84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmax48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                            end function
                            real(8) function fmin88(x, y) result (res)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(4) function fmin44(x, y) result (res)
                                real(4), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                            end function
                            real(8) function fmin84(x, y) result(res)
                                real(8), intent (in) :: x
                                real(4), intent (in) :: y
                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                            end function
                            real(8) function fmin48(x, y) result(res)
                                real(4), intent (in) :: x
                                real(8), intent (in) :: y
                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                            end function
                        end module
                        
                        real(8) function code(f, b, x)
                        use fmin_fmax_functions
                            real(8), intent (in) :: f
                            real(8), intent (in) :: b
                            real(8), intent (in) :: x
                            real(8) :: tmp
                            if (f <= (-1.5d-12)) then
                                tmp = (-1.0d0) / b
                            else if (f <= 3.7d-64) then
                                tmp = (-1.0d0) * (x / b)
                            else
                                tmp = (1.0d0 - x) / b
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double F, double B, double x) {
                        	double tmp;
                        	if (F <= -1.5e-12) {
                        		tmp = -1.0 / B;
                        	} else if (F <= 3.7e-64) {
                        		tmp = -1.0 * (x / B);
                        	} else {
                        		tmp = (1.0 - x) / B;
                        	}
                        	return tmp;
                        }
                        
                        def code(F, B, x):
                        	tmp = 0
                        	if F <= -1.5e-12:
                        		tmp = -1.0 / B
                        	elif F <= 3.7e-64:
                        		tmp = -1.0 * (x / B)
                        	else:
                        		tmp = (1.0 - x) / B
                        	return tmp
                        
                        function code(F, B, x)
                        	tmp = 0.0
                        	if (F <= -1.5e-12)
                        		tmp = Float64(-1.0 / B);
                        	elseif (F <= 3.7e-64)
                        		tmp = Float64(-1.0 * Float64(x / B));
                        	else
                        		tmp = Float64(Float64(1.0 - x) / B);
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(F, B, x)
                        	tmp = 0.0;
                        	if (F <= -1.5e-12)
                        		tmp = -1.0 / B;
                        	elseif (F <= 3.7e-64)
                        		tmp = -1.0 * (x / B);
                        	else
                        		tmp = (1.0 - x) / B;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[F_, B_, x_] := If[LessEqual[F, -1.5e-12], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 3.7e-64], N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;F \leq -1.5 \cdot 10^{-12}:\\
                        \;\;\;\;\frac{-1}{B}\\
                        
                        \mathbf{elif}\;F \leq 3.7 \cdot 10^{-64}:\\
                        \;\;\;\;-1 \cdot \frac{x}{B}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{1 - x}{B}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if F < -1.5000000000000001e-12

                          1. Initial program 76.2%

                            \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                          2. Taylor expanded in F around -inf

                            \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                          3. Step-by-step derivation
                            1. lower-/.f64N/A

                              \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                            2. lower-sin.f6417.7

                              \[\leadsto \frac{-1}{\sin B} \]
                          4. Applied rewrites17.7%

                            \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                          5. Taylor expanded in B around 0

                            \[\leadsto \frac{-1}{B} \]
                          6. Step-by-step derivation
                            1. Applied rewrites10.8%

                              \[\leadsto \frac{-1}{B} \]

                            if -1.5000000000000001e-12 < F < 3.69999999999999999e-64

                            1. Initial program 76.2%

                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                            2. Taylor expanded in F around 0

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

                                \[\leadsto -1 \cdot \color{blue}{\frac{x \cdot \cos B}{\sin B}} \]
                              2. lower-/.f64N/A

                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\color{blue}{\sin B}} \]
                              3. lower-*.f64N/A

                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin \color{blue}{B}} \]
                              4. lower-cos.f64N/A

                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                              5. lower-sin.f6455.4

                                \[\leadsto -1 \cdot \frac{x \cdot \cos B}{\sin B} \]
                            4. Applied rewrites55.4%

                              \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot \cos B}{\sin B}} \]
                            5. Taylor expanded in B around 0

                              \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]
                            6. Step-by-step derivation
                              1. lower-/.f6428.8

                                \[\leadsto -1 \cdot \frac{x}{B} \]
                            7. Applied rewrites28.8%

                              \[\leadsto -1 \cdot \frac{x}{\color{blue}{B}} \]

                            if 3.69999999999999999e-64 < F

                            1. Initial program 76.2%

                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                            2. Taylor expanded in F around inf

                              \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                            3. Step-by-step derivation
                              1. lower-*.f64N/A

                                \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                              2. lower-fma.f64N/A

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                              3. lower-/.f64N/A

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                              4. lower-*.f64N/A

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                              5. lower-cos.f64N/A

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                              6. lower-*.f64N/A

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                              7. lower-sin.f64N/A

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                              8. lower-/.f64N/A

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                              9. lower-*.f64N/A

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                              10. lower-sin.f6447.8

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                            4. Applied rewrites47.8%

                              \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                            5. Step-by-step derivation
                              1. lift-*.f64N/A

                                \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                              2. *-commutativeN/A

                                \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                              3. lower-*.f6447.8

                                \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                            6. Applied rewrites50.5%

                              \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
                            7. Taylor expanded in B around 0

                              \[\leadsto \frac{1 - x}{\color{blue}{B}} \]
                            8. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \frac{1 - x}{B} \]
                              2. lower--.f6429.7

                                \[\leadsto \frac{1 - x}{B} \]
                            9. Applied rewrites29.7%

                              \[\leadsto \frac{1 - x}{\color{blue}{B}} \]
                          7. Recombined 3 regimes into one program.
                          8. Add Preprocessing

                          Alternative 20: 30.9% accurate, 10.7× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -46000000000:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                          (FPCore (F B x)
                           :precision binary64
                           (if (<= F -46000000000.0) (/ -1.0 B) (/ (- 1.0 x) B)))
                          double code(double F, double B, double x) {
                          	double tmp;
                          	if (F <= -46000000000.0) {
                          		tmp = -1.0 / B;
                          	} else {
                          		tmp = (1.0 - x) / B;
                          	}
                          	return tmp;
                          }
                          
                          module fmin_fmax_functions
                              implicit none
                              private
                              public fmax
                              public fmin
                          
                              interface fmax
                                  module procedure fmax88
                                  module procedure fmax44
                                  module procedure fmax84
                                  module procedure fmax48
                              end interface
                              interface fmin
                                  module procedure fmin88
                                  module procedure fmin44
                                  module procedure fmin84
                                  module procedure fmin48
                              end interface
                          contains
                              real(8) function fmax88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmax44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmax84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmax48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                              end function
                              real(8) function fmin88(x, y) result (res)
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(4) function fmin44(x, y) result (res)
                                  real(4), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                              end function
                              real(8) function fmin84(x, y) result(res)
                                  real(8), intent (in) :: x
                                  real(4), intent (in) :: y
                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                              end function
                              real(8) function fmin48(x, y) result(res)
                                  real(4), intent (in) :: x
                                  real(8), intent (in) :: y
                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                              end function
                          end module
                          
                          real(8) function code(f, b, x)
                          use fmin_fmax_functions
                              real(8), intent (in) :: f
                              real(8), intent (in) :: b
                              real(8), intent (in) :: x
                              real(8) :: tmp
                              if (f <= (-46000000000.0d0)) then
                                  tmp = (-1.0d0) / b
                              else
                                  tmp = (1.0d0 - x) / b
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double F, double B, double x) {
                          	double tmp;
                          	if (F <= -46000000000.0) {
                          		tmp = -1.0 / B;
                          	} else {
                          		tmp = (1.0 - x) / B;
                          	}
                          	return tmp;
                          }
                          
                          def code(F, B, x):
                          	tmp = 0
                          	if F <= -46000000000.0:
                          		tmp = -1.0 / B
                          	else:
                          		tmp = (1.0 - x) / B
                          	return tmp
                          
                          function code(F, B, x)
                          	tmp = 0.0
                          	if (F <= -46000000000.0)
                          		tmp = Float64(-1.0 / B);
                          	else
                          		tmp = Float64(Float64(1.0 - x) / B);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(F, B, x)
                          	tmp = 0.0;
                          	if (F <= -46000000000.0)
                          		tmp = -1.0 / B;
                          	else
                          		tmp = (1.0 - x) / B;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[F_, B_, x_] := If[LessEqual[F, -46000000000.0], N[(-1.0 / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;F \leq -46000000000:\\
                          \;\;\;\;\frac{-1}{B}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{1 - x}{B}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if F < -4.6e10

                            1. Initial program 76.2%

                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                            2. Taylor expanded in F around -inf

                              \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                            3. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                              2. lower-sin.f6417.7

                                \[\leadsto \frac{-1}{\sin B} \]
                            4. Applied rewrites17.7%

                              \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                            5. Taylor expanded in B around 0

                              \[\leadsto \frac{-1}{B} \]
                            6. Step-by-step derivation
                              1. Applied rewrites10.8%

                                \[\leadsto \frac{-1}{B} \]

                              if -4.6e10 < F

                              1. Initial program 76.2%

                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                              2. Taylor expanded in F around inf

                                \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                              3. Step-by-step derivation
                                1. lower-*.f64N/A

                                  \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                2. lower-fma.f64N/A

                                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                3. lower-/.f64N/A

                                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                4. lower-*.f64N/A

                                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                5. lower-cos.f64N/A

                                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                6. lower-*.f64N/A

                                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                7. lower-sin.f64N/A

                                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                8. lower-/.f64N/A

                                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                9. lower-*.f64N/A

                                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                10. lower-sin.f6447.8

                                  \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                              4. Applied rewrites47.8%

                                \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                              5. Step-by-step derivation
                                1. lift-*.f64N/A

                                  \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                                2. *-commutativeN/A

                                  \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                                3. lower-*.f6447.8

                                  \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \cdot \color{blue}{F} \]
                              6. Applied rewrites50.5%

                                \[\leadsto \frac{1 - \cos B \cdot x}{\sin B \cdot F} \cdot \color{blue}{F} \]
                              7. Taylor expanded in B around 0

                                \[\leadsto \frac{1 - x}{\color{blue}{B}} \]
                              8. Step-by-step derivation
                                1. lower-/.f64N/A

                                  \[\leadsto \frac{1 - x}{B} \]
                                2. lower--.f6429.7

                                  \[\leadsto \frac{1 - x}{B} \]
                              9. Applied rewrites29.7%

                                \[\leadsto \frac{1 - x}{\color{blue}{B}} \]
                            7. Recombined 2 regimes into one program.
                            8. Add Preprocessing

                            Alternative 21: 10.8% accurate, 26.5× speedup?

                            \[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
                            (FPCore (F B x) :precision binary64 (/ -1.0 B))
                            double code(double F, double B, double x) {
                            	return -1.0 / B;
                            }
                            
                            module fmin_fmax_functions
                                implicit none
                                private
                                public fmax
                                public fmin
                            
                                interface fmax
                                    module procedure fmax88
                                    module procedure fmax44
                                    module procedure fmax84
                                    module procedure fmax48
                                end interface
                                interface fmin
                                    module procedure fmin88
                                    module procedure fmin44
                                    module procedure fmin84
                                    module procedure fmin48
                                end interface
                            contains
                                real(8) function fmax88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmax44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmax84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmax48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                end function
                                real(8) function fmin88(x, y) result (res)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(4) function fmin44(x, y) result (res)
                                    real(4), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                end function
                                real(8) function fmin84(x, y) result(res)
                                    real(8), intent (in) :: x
                                    real(4), intent (in) :: y
                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                end function
                                real(8) function fmin48(x, y) result(res)
                                    real(4), intent (in) :: x
                                    real(8), intent (in) :: y
                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                end function
                            end module
                            
                            real(8) function code(f, b, x)
                            use fmin_fmax_functions
                                real(8), intent (in) :: f
                                real(8), intent (in) :: b
                                real(8), intent (in) :: x
                                code = (-1.0d0) / b
                            end function
                            
                            public static double code(double F, double B, double x) {
                            	return -1.0 / B;
                            }
                            
                            def code(F, B, x):
                            	return -1.0 / B
                            
                            function code(F, B, x)
                            	return Float64(-1.0 / B)
                            end
                            
                            function tmp = code(F, B, x)
                            	tmp = -1.0 / B;
                            end
                            
                            code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            \frac{-1}{B}
                            \end{array}
                            
                            Derivation
                            1. Initial program 76.2%

                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                            2. Taylor expanded in F around -inf

                              \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                            3. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \frac{-1}{\color{blue}{\sin B}} \]
                              2. lower-sin.f6417.7

                                \[\leadsto \frac{-1}{\sin B} \]
                            4. Applied rewrites17.7%

                              \[\leadsto \color{blue}{\frac{-1}{\sin B}} \]
                            5. Taylor expanded in B around 0

                              \[\leadsto \frac{-1}{B} \]
                            6. Step-by-step derivation
                              1. Applied rewrites10.8%

                                \[\leadsto \frac{-1}{B} \]
                              2. Add Preprocessing

                              Reproduce

                              ?
                              herbie shell --seed 2025142 
                              (FPCore (F B x)
                                :name "VandenBroeck and Keller, Equation (23)"
                                :precision binary64
                                (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))