VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.4% → 99.4%
Time: 6.5s
Alternatives: 23
Speedup: 1.5×

Specification

?
\[\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)} \]
(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]
\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)}

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 23 alternatives:

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

Initial Program: 77.4% accurate, 1.0× speedup?

\[\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)} \]
(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]
\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)}

Alternative 1: 99.4% accurate, 1.0× speedup?

\[\begin{array}{l} t_0 := \cos B \cdot x\\ \mathbf{if}\;F \leq -1.65 \cdot 10^{+31}:\\ \;\;\;\;\frac{\frac{-1}{F} \cdot F - t\_0}{\sin B}\\ \mathbf{elif}\;F \leq 1.32 \cdot 10^{+54}:\\ \;\;\;\;{\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{\frac{1}{F} \cdot F - t\_0}{\sin B}\\ \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (* (cos B) x)))
   (if (<= F -1.65e+31)
     (/ (- (* (/ -1.0 F) F) t_0) (sin B))
     (if (<= F 1.32e+54)
       (- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B))) (/ x (tan B)))
       (/ (- (* (/ 1.0 F) F) t_0) (sin B))))))
double code(double F, double B, double x) {
	double t_0 = cos(B) * x;
	double tmp;
	if (F <= -1.65e+31) {
		tmp = (((-1.0 / F) * F) - t_0) / sin(B);
	} else if (F <= 1.32e+54) {
		tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / sin(B))) - (x / tan(B));
	} else {
		tmp = (((1.0 / F) * F) - t_0) / sin(B);
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(cos(B) * x)
	tmp = 0.0
	if (F <= -1.65e+31)
		tmp = Float64(Float64(Float64(Float64(-1.0 / F) * F) - t_0) / sin(B));
	elseif (F <= 1.32e+54)
		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(Float64(Float64(1.0 / F) * F) - t_0) / sin(B));
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -1.65e+31], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.32e+54], 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[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -1.65 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - t\_0}{\sin B}\\

\mathbf{elif}\;F \leq 1.32 \cdot 10^{+54}:\\
\;\;\;\;{\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{\frac{1}{F} \cdot F - t\_0}{\sin B}\\


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

    1. Initial program 77.4%

      \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{-1}{F}} \cdot F - \cos B \cdot x}{\sin B} \]
    7. Step-by-step derivation
      1. lower-/.f6455.4%

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

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

    if -1.65e31 < F < 1.3200000000000001e54

    1. Initial program 77.4%

      \[\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--.f6477.4%

        \[\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 rewrites77.5%

      \[\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 1.3200000000000001e54 < F

    1. Initial program 77.4%

      \[\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 \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
    3. Step-by-step derivation
      1. lower-/.f6447.4%

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

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

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

Alternative 2: 98.9% accurate, 1.1× speedup?

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

\mathbf{elif}\;F \leq 39000:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - t\_0}{\sin B}\\


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

    1. Initial program 77.4%

      \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{-1}{F}} \cdot F - \cos B \cdot x}{\sin B} \]
    7. Step-by-step derivation
      1. lower-/.f6455.4%

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

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

    if -0.022499999999999999 < F < 39000

    1. Initial program 77.4%

      \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}}}}{\sin B} + \frac{-x}{\tan B} \]
      7. associate-/l*N/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} \]
      8. 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}} \]
      9. mult-flipN/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(-x\right) \cdot \frac{1}{\tan B}} \]
      10. 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(-x\right) \cdot \color{blue}{\frac{1}{\tan B}} \]
      11. 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} + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \frac{1}{\tan B} \]
      12. distribute-lft-neg-inN/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(x \cdot \frac{1}{\tan B}\right)\right)} \]
      13. 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) \]
      14. 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} + \color{blue}{\left(-x \cdot \frac{1}{\tan B}\right)} \]
      15. lower-fma.f64N/A

        \[\leadsto \color{blue}{\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}, -x \cdot \frac{1}{\tan B}\right)} \]
    5. Applied rewrites85.7%

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

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

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

      if 39000 < F

      1. Initial program 77.4%

        \[\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 \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
      3. Step-by-step derivation
        1. lower-/.f6447.4%

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

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

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

    Alternative 3: 98.7% accurate, 1.1× speedup?

    \[\begin{array}{l} t_0 := \cos B \cdot x\\ \mathbf{if}\;F \leq -0.0225:\\ \;\;\;\;\frac{\frac{-1}{F} \cdot F - t\_0}{\sin B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\ \;\;\;\;\frac{{\left(2 + 2 \cdot x\right)}^{-0.5} \cdot F - t\_0}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{F} \cdot F - t\_0}{\sin B}\\ \end{array} \]
    (FPCore (F B x)
     :precision binary64
     (let* ((t_0 (* (cos B) x)))
       (if (<= F -0.0225)
         (/ (- (* (/ -1.0 F) F) t_0) (sin B))
         (if (<= F 2e-9)
           (/ (- (* (pow (+ 2.0 (* 2.0 x)) -0.5) F) t_0) (sin B))
           (/ (- (* (/ 1.0 F) F) t_0) (sin B))))))
    double code(double F, double B, double x) {
    	double t_0 = cos(B) * x;
    	double tmp;
    	if (F <= -0.0225) {
    		tmp = (((-1.0 / F) * F) - t_0) / sin(B);
    	} else if (F <= 2e-9) {
    		tmp = ((pow((2.0 + (2.0 * x)), -0.5) * F) - t_0) / sin(B);
    	} else {
    		tmp = (((1.0 / F) * F) - t_0) / 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) :: t_0
        real(8) :: tmp
        t_0 = cos(b) * x
        if (f <= (-0.0225d0)) then
            tmp = ((((-1.0d0) / f) * f) - t_0) / sin(b)
        else if (f <= 2d-9) then
            tmp = ((((2.0d0 + (2.0d0 * x)) ** (-0.5d0)) * f) - t_0) / sin(b)
        else
            tmp = (((1.0d0 / f) * f) - t_0) / sin(b)
        end if
        code = tmp
    end function
    
    public static double code(double F, double B, double x) {
    	double t_0 = Math.cos(B) * x;
    	double tmp;
    	if (F <= -0.0225) {
    		tmp = (((-1.0 / F) * F) - t_0) / Math.sin(B);
    	} else if (F <= 2e-9) {
    		tmp = ((Math.pow((2.0 + (2.0 * x)), -0.5) * F) - t_0) / Math.sin(B);
    	} else {
    		tmp = (((1.0 / F) * F) - t_0) / Math.sin(B);
    	}
    	return tmp;
    }
    
    def code(F, B, x):
    	t_0 = math.cos(B) * x
    	tmp = 0
    	if F <= -0.0225:
    		tmp = (((-1.0 / F) * F) - t_0) / math.sin(B)
    	elif F <= 2e-9:
    		tmp = ((math.pow((2.0 + (2.0 * x)), -0.5) * F) - t_0) / math.sin(B)
    	else:
    		tmp = (((1.0 / F) * F) - t_0) / math.sin(B)
    	return tmp
    
    function code(F, B, x)
    	t_0 = Float64(cos(B) * x)
    	tmp = 0.0
    	if (F <= -0.0225)
    		tmp = Float64(Float64(Float64(Float64(-1.0 / F) * F) - t_0) / sin(B));
    	elseif (F <= 2e-9)
    		tmp = Float64(Float64(Float64((Float64(2.0 + Float64(2.0 * x)) ^ -0.5) * F) - t_0) / sin(B));
    	else
    		tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - t_0) / sin(B));
    	end
    	return tmp
    end
    
    function tmp_2 = code(F, B, x)
    	t_0 = cos(B) * x;
    	tmp = 0.0;
    	if (F <= -0.0225)
    		tmp = (((-1.0 / F) * F) - t_0) / sin(B);
    	elseif (F <= 2e-9)
    		tmp = ((((2.0 + (2.0 * x)) ^ -0.5) * F) - t_0) / sin(B);
    	else
    		tmp = (((1.0 / F) * F) - t_0) / sin(B);
    	end
    	tmp_2 = tmp;
    end
    
    code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -0.0225], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e-9], N[(N[(N[(N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    t_0 := \cos B \cdot x\\
    \mathbf{if}\;F \leq -0.0225:\\
    \;\;\;\;\frac{\frac{-1}{F} \cdot F - t\_0}{\sin B}\\
    
    \mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
    \;\;\;\;\frac{{\left(2 + 2 \cdot x\right)}^{-0.5} \cdot F - t\_0}{\sin B}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\frac{1}{F} \cdot F - t\_0}{\sin B}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if F < -0.022499999999999999

      1. Initial program 77.4%

        \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{-1}{F}} \cdot F - \cos B \cdot x}{\sin B} \]
      7. Step-by-step derivation
        1. lower-/.f6455.4%

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

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

      if -0.022499999999999999 < F < 2.0000000000000001e-9

      1. Initial program 77.4%

        \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{{\left(2 + \color{blue}{2 \cdot x}\right)}^{\frac{-1}{2}} \cdot F - \cos B \cdot x}{\sin B} \]
        2. lower-*.f6455.7%

          \[\leadsto \frac{{\left(2 + 2 \cdot \color{blue}{x}\right)}^{-0.5} \cdot F - \cos B \cdot x}{\sin B} \]
      8. Applied rewrites55.7%

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

      if 2.0000000000000001e-9 < F

      1. Initial program 77.4%

        \[\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 \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
      3. Step-by-step derivation
        1. lower-/.f6447.4%

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

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

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

    Alternative 4: 92.1% accurate, 1.3× speedup?

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

      1. Initial program 77.4%

        \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{-1}{F}} \cdot F - \cos B \cdot x}{\sin B} \]
      7. Step-by-step derivation
        1. lower-/.f6455.4%

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

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

      if -4.1999999999999998e-13 < F < 1.8000000000000001e-95

      1. Initial program 77.4%

        \[\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. lift-neg.f64N/A

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-1}{\tan B}, x, \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}}\right) \]
        13. lower-*.f6477.4%

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

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

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

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

        if 1.8000000000000001e-95 < F < 2.0000000000000001e-9

        1. Initial program 77.4%

          \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 2.0000000000000001e-9 < F

          1. Initial program 77.4%

            \[\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 \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
          3. Step-by-step derivation
            1. lower-/.f6447.4%

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

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

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

        Alternative 5: 92.1% accurate, 1.3× speedup?

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

          1. Initial program 77.4%

            \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\color{blue}{\frac{-1}{F}} \cdot F - \cos B \cdot x}{\sin B} \]
          7. Step-by-step derivation
            1. lower-/.f6455.4%

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

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

          if -4.1999999999999998e-13 < F < 1.8000000000000001e-95

          1. Initial program 77.4%

            \[\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-/.f6462.2%

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

            \[\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 1.8000000000000001e-95 < F < 2.0000000000000001e-9

          1. Initial program 77.4%

            \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 2.0000000000000001e-9 < F

            1. Initial program 77.4%

              \[\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 \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
            3. Step-by-step derivation
              1. lower-/.f6447.4%

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

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

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

          Alternative 6: 86.1% accurate, 1.4× speedup?

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

            1. Initial program 77.4%

              \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\color{blue}{\frac{-1}{F}} \cdot F - \cos B \cdot x}{\sin B} \]
            7. Step-by-step derivation
              1. lower-/.f6455.4%

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

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

            if -4.1999999999999998e-13 < F < 1.8000000000000001e-95

            1. Initial program 77.4%

              \[\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. lift-neg.f64N/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\frac{-1}{\tan B}, x, \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}}\right) \]
              13. lower-*.f6477.4%

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

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

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

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

              if 1.8000000000000001e-95 < F < 9.4999999999999996e157

              1. Initial program 77.4%

                \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 9.4999999999999996e157 < F

                1. Initial program 77.4%

                  \[\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 \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
                3. Step-by-step derivation
                  1. lower-/.f6447.4%

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{\frac{1}{F}} \]
                5. Step-by-step derivation
                  1. metadata-eval47.4%

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \frac{1}{F} \]
                  2. metadata-eval47.4%

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

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

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

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

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

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

                    \[\leadsto \color{blue}{F \cdot \frac{\frac{1}{F}}{\sin B}} + \left(-x \cdot \frac{1}{\tan B}\right) \]
                6. Applied rewrites51.9%

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

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

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

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

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

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

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

              Alternative 7: 77.7% accurate, 1.5× speedup?

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

                1. Initial program 77.4%

                  \[\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.9%

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

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

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

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

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

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

                    \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                  6. div-flip-revN/A

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

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

                    \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right) \]
                  9. tan-quotN/A

                    \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                  10. lift-tan.f64N/A

                    \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                  11. mult-flip-revN/A

                    \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
                  12. distribute-frac-negN/A

                    \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\color{blue}{\tan B}} \]
                  13. lift-neg.f64N/A

                    \[\leadsto \frac{-x}{\tan \color{blue}{B}} \]
                  14. lift-/.f6456.0%

                    \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
                6. Applied rewrites56.0%

                  \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                7. Step-by-step derivation
                  1. lift-tan.f64N/A

                    \[\leadsto \frac{-x}{\tan B} \]
                  2. tan-quotN/A

                    \[\leadsto \frac{-x}{\frac{\sin B}{\color{blue}{\cos B}}} \]
                  3. lift-sin.f64N/A

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

                    \[\leadsto \frac{-x}{\frac{\sin B}{\cos B}} \]
                  5. div-flipN/A

                    \[\leadsto \frac{-x}{\frac{1}{\color{blue}{\frac{\cos B}{\sin B}}}} \]
                  6. lower-unsound-/.f32N/A

                    \[\leadsto \frac{-x}{\frac{1}{\frac{\cos B}{\color{blue}{\sin B}}}} \]
                  7. lower-/.f32N/A

                    \[\leadsto \frac{-x}{\frac{1}{\frac{\cos B}{\color{blue}{\sin B}}}} \]
                  8. div-flip-revN/A

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

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

                    \[\leadsto \frac{-x}{\frac{1}{\frac{1}{\frac{\sin B}{\cos B}}}} \]
                  11. tan-quotN/A

                    \[\leadsto \frac{-x}{\frac{1}{\frac{1}{\tan B}}} \]
                  12. lower-unsound-/.f64N/A

                    \[\leadsto \frac{-x}{\frac{1}{\color{blue}{\frac{1}{\tan B}}}} \]
                  13. lower-/.f64N/A

                    \[\leadsto \frac{-x}{\frac{1}{\frac{1}{\color{blue}{\tan B}}}} \]
                  14. lift-tan.f6455.9%

                    \[\leadsto \frac{-x}{\frac{1}{\frac{1}{\tan B}}} \]
                8. Applied rewrites55.9%

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

                if -8.2000000000000003e-48 < x < 0.0135

                1. Initial program 77.4%

                  \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 0.0135 < x

                  1. Initial program 77.4%

                    \[\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.9%

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

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

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

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

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

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

                      \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                    6. div-flip-revN/A

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

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

                      \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right) \]
                    9. tan-quotN/A

                      \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                    10. lift-tan.f64N/A

                      \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                    11. mult-flip-revN/A

                      \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
                    12. distribute-frac-negN/A

                      \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\color{blue}{\tan B}} \]
                    13. lift-neg.f64N/A

                      \[\leadsto \frac{-x}{\tan \color{blue}{B}} \]
                    14. lift-/.f6456.0%

                      \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
                  6. Applied rewrites56.0%

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

                Alternative 8: 73.5% accurate, 1.5× speedup?

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

                  1. Initial program 77.4%

                    \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

                    if -2.1999999999999999e-15 < F < 2.9000000000000001e-152

                    1. Initial program 77.4%

                      \[\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.9%

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

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

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

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

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

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

                        \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                      6. div-flip-revN/A

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

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

                        \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right) \]
                      9. tan-quotN/A

                        \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                      10. lift-tan.f64N/A

                        \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                      11. mult-flip-revN/A

                        \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
                      12. distribute-frac-negN/A

                        \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\color{blue}{\tan B}} \]
                      13. lift-neg.f64N/A

                        \[\leadsto \frac{-x}{\tan \color{blue}{B}} \]
                      14. lift-/.f6456.0%

                        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
                    6. Applied rewrites56.0%

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

                    if 2.9000000000000001e-152 < F < 2.0000000000000001e-9

                    1. Initial program 77.4%

                      \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, {\left(\mathsf{fma}\left(2, x, \color{blue}{2}\right)\right)}^{-0.5} \cdot F, -1 \cdot \frac{x}{B}\right) \]
                    8. Step-by-step derivation
                      1. Applied rewrites36.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 2.0000000000000001e-9 < F

                      1. Initial program 77.4%

                        \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{1}, -1 \cdot \frac{x}{B}\right) \]
                      8. Step-by-step derivation
                        1. Applied rewrites35.9%

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

                      Alternative 9: 71.7% accurate, 1.9× speedup?

                      \[\begin{array}{l} t_0 := \frac{1}{\sin B}\\ t_1 := -1 \cdot \frac{x}{B}\\ \mathbf{if}\;F \leq -2.2 \cdot 10^{-15}:\\ \;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\ \mathbf{elif}\;F \leq 1.82 \cdot 10^{-90}:\\ \;\;\;\;\frac{-x}{\tan B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\ \;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\ \end{array} \]
                      (FPCore (F B x)
                       :precision binary64
                       (let* ((t_0 (/ 1.0 (sin B))) (t_1 (* -1.0 (/ x B))))
                         (if (<= F -2.2e-15)
                           (fma t_0 -1.0 t_1)
                           (if (<= F 1.82e-90)
                             (/ (- x) (tan B))
                             (if (<= F 2e-9)
                               (/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
                               (fma t_0 1.0 t_1))))))
                      double code(double F, double B, double x) {
                      	double t_0 = 1.0 / sin(B);
                      	double t_1 = -1.0 * (x / B);
                      	double tmp;
                      	if (F <= -2.2e-15) {
                      		tmp = fma(t_0, -1.0, t_1);
                      	} else if (F <= 1.82e-90) {
                      		tmp = -x / tan(B);
                      	} else if (F <= 2e-9) {
                      		tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
                      	} else {
                      		tmp = fma(t_0, 1.0, t_1);
                      	}
                      	return tmp;
                      }
                      
                      function code(F, B, x)
                      	t_0 = Float64(1.0 / sin(B))
                      	t_1 = Float64(-1.0 * Float64(x / B))
                      	tmp = 0.0
                      	if (F <= -2.2e-15)
                      		tmp = fma(t_0, -1.0, t_1);
                      	elseif (F <= 1.82e-90)
                      		tmp = Float64(Float64(-x) / tan(B));
                      	elseif (F <= 2e-9)
                      		tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B);
                      	else
                      		tmp = fma(t_0, 1.0, t_1);
                      	end
                      	return tmp
                      end
                      
                      code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.2e-15], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 1.82e-90], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e-9], 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[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]]
                      
                      \begin{array}{l}
                      t_0 := \frac{1}{\sin B}\\
                      t_1 := -1 \cdot \frac{x}{B}\\
                      \mathbf{if}\;F \leq -2.2 \cdot 10^{-15}:\\
                      \;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
                      
                      \mathbf{elif}\;F \leq 1.82 \cdot 10^{-90}:\\
                      \;\;\;\;\frac{-x}{\tan B}\\
                      
                      \mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
                      \;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
                      
                      
                      \end{array}
                      
                      Derivation
                      1. Split input into 4 regimes
                      2. if F < -2.1999999999999999e-15

                        1. Initial program 77.4%

                          \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

                          if -2.1999999999999999e-15 < F < 1.8199999999999999e-90

                          1. Initial program 77.4%

                            \[\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.9%

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

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

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

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

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

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

                              \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                            6. div-flip-revN/A

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

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

                              \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right) \]
                            9. tan-quotN/A

                              \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                            10. lift-tan.f64N/A

                              \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                            11. mult-flip-revN/A

                              \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
                            12. distribute-frac-negN/A

                              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\color{blue}{\tan B}} \]
                            13. lift-neg.f64N/A

                              \[\leadsto \frac{-x}{\tan \color{blue}{B}} \]
                            14. lift-/.f6456.0%

                              \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
                          6. Applied rewrites56.0%

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

                          if 1.8199999999999999e-90 < F < 2.0000000000000001e-9

                          1. Initial program 77.4%

                            \[\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.6%

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

                          if 2.0000000000000001e-9 < F

                          1. Initial program 77.4%

                            \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{1}, -1 \cdot \frac{x}{B}\right) \]
                          8. Step-by-step derivation
                            1. Applied rewrites35.9%

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

                          Alternative 10: 71.7% accurate, 2.0× speedup?

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

                            1. Initial program 77.4%

                              \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

                              if -2.1999999999999999e-15 < F < 1.8199999999999999e-90

                              1. Initial program 77.4%

                                \[\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.9%

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

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

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

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

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

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

                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                                6. div-flip-revN/A

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

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

                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right) \]
                                9. tan-quotN/A

                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                10. lift-tan.f64N/A

                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                11. mult-flip-revN/A

                                  \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
                                12. distribute-frac-negN/A

                                  \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\color{blue}{\tan B}} \]
                                13. lift-neg.f64N/A

                                  \[\leadsto \frac{-x}{\tan \color{blue}{B}} \]
                                14. lift-/.f6456.0%

                                  \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
                              6. Applied rewrites56.0%

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

                              if 1.8199999999999999e-90 < F < 2.0000000000000001e-9

                              1. Initial program 77.4%

                                \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, {\left(\mathsf{fma}\left(2, x, \color{blue}{2}\right)\right)}^{-0.5} \cdot F, -1 \cdot \frac{x}{B}\right) \]
                              8. Step-by-step derivation
                                1. Applied rewrites36.6%

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

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

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

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

                                if 2.0000000000000001e-9 < F

                                1. Initial program 77.4%

                                  \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, \color{blue}{1}, -1 \cdot \frac{x}{B}\right) \]
                                8. Step-by-step derivation
                                  1. Applied rewrites35.9%

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

                                Alternative 11: 64.8% accurate, 2.1× speedup?

                                \[\begin{array}{l} t_0 := \frac{-x}{\tan B}\\ t_1 := \frac{1}{\sin B}\\ t_2 := -1 \cdot \frac{x}{B}\\ \mathbf{if}\;F \leq -2.2 \cdot 10^{-15}:\\ \;\;\;\;\mathsf{fma}\left(t\_1, -1, t\_2\right)\\ \mathbf{elif}\;F \leq 1.82 \cdot 10^{-90}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 480000000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{B}, {\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F, t\_2\right)\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{+186}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                                (FPCore (F B x)
                                 :precision binary64
                                 (let* ((t_0 (/ (- x) (tan B))) (t_1 (/ 1.0 (sin B))) (t_2 (* -1.0 (/ x B))))
                                   (if (<= F -2.2e-15)
                                     (fma t_1 -1.0 t_2)
                                     (if (<= F 1.82e-90)
                                       t_0
                                       (if (<= F 480000000000.0)
                                         (fma (/ 1.0 B) (* (pow (fma 2.0 x 2.0) -0.5) F) t_2)
                                         (if (<= F 6.2e+186) t_1 t_0))))))
                                double code(double F, double B, double x) {
                                	double t_0 = -x / tan(B);
                                	double t_1 = 1.0 / sin(B);
                                	double t_2 = -1.0 * (x / B);
                                	double tmp;
                                	if (F <= -2.2e-15) {
                                		tmp = fma(t_1, -1.0, t_2);
                                	} else if (F <= 1.82e-90) {
                                		tmp = t_0;
                                	} else if (F <= 480000000000.0) {
                                		tmp = fma((1.0 / B), (pow(fma(2.0, x, 2.0), -0.5) * F), t_2);
                                	} else if (F <= 6.2e+186) {
                                		tmp = t_1;
                                	} else {
                                		tmp = t_0;
                                	}
                                	return tmp;
                                }
                                
                                function code(F, B, x)
                                	t_0 = Float64(Float64(-x) / tan(B))
                                	t_1 = Float64(1.0 / sin(B))
                                	t_2 = Float64(-1.0 * Float64(x / B))
                                	tmp = 0.0
                                	if (F <= -2.2e-15)
                                		tmp = fma(t_1, -1.0, t_2);
                                	elseif (F <= 1.82e-90)
                                		tmp = t_0;
                                	elseif (F <= 480000000000.0)
                                		tmp = fma(Float64(1.0 / B), Float64((fma(2.0, x, 2.0) ^ -0.5) * F), t_2);
                                	elseif (F <= 6.2e+186)
                                		tmp = t_1;
                                	else
                                		tmp = t_0;
                                	end
                                	return tmp
                                end
                                
                                code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.2e-15], N[(t$95$1 * -1.0 + t$95$2), $MachinePrecision], If[LessEqual[F, 1.82e-90], t$95$0, If[LessEqual[F, 480000000000.0], N[(N[(1.0 / B), $MachinePrecision] * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[F, 6.2e+186], t$95$1, t$95$0]]]]]]]
                                
                                \begin{array}{l}
                                t_0 := \frac{-x}{\tan B}\\
                                t_1 := \frac{1}{\sin B}\\
                                t_2 := -1 \cdot \frac{x}{B}\\
                                \mathbf{if}\;F \leq -2.2 \cdot 10^{-15}:\\
                                \;\;\;\;\mathsf{fma}\left(t\_1, -1, t\_2\right)\\
                                
                                \mathbf{elif}\;F \leq 1.82 \cdot 10^{-90}:\\
                                \;\;\;\;t\_0\\
                                
                                \mathbf{elif}\;F \leq 480000000000:\\
                                \;\;\;\;\mathsf{fma}\left(\frac{1}{B}, {\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F, t\_2\right)\\
                                
                                \mathbf{elif}\;F \leq 6.2 \cdot 10^{+186}:\\
                                \;\;\;\;t\_1\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;t\_0\\
                                
                                
                                \end{array}
                                
                                Derivation
                                1. Split input into 4 regimes
                                2. if F < -2.1999999999999999e-15

                                  1. Initial program 77.4%

                                    \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

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

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

                                    if -2.1999999999999999e-15 < F < 1.8199999999999999e-90 or 6.2000000000000002e186 < F

                                    1. Initial program 77.4%

                                      \[\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.9%

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

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

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

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

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

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

                                        \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                                      6. div-flip-revN/A

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

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

                                        \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right) \]
                                      9. tan-quotN/A

                                        \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                      10. lift-tan.f64N/A

                                        \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                      11. mult-flip-revN/A

                                        \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
                                      12. distribute-frac-negN/A

                                        \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\color{blue}{\tan B}} \]
                                      13. lift-neg.f64N/A

                                        \[\leadsto \frac{-x}{\tan \color{blue}{B}} \]
                                      14. lift-/.f6456.0%

                                        \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
                                    6. Applied rewrites56.0%

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

                                    if 1.8199999999999999e-90 < F < 4.8e11

                                    1. Initial program 77.4%

                                      \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

                                      \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, {\left(\mathsf{fma}\left(2, x, \color{blue}{2}\right)\right)}^{-0.5} \cdot F, -1 \cdot \frac{x}{B}\right) \]
                                    8. Step-by-step derivation
                                      1. Applied rewrites36.6%

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

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

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

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

                                      if 4.8e11 < F < 6.2000000000000002e186

                                      1. Initial program 77.4%

                                        \[\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.8%

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

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

                                    Alternative 12: 59.1% accurate, 1.9× speedup?

                                    \[\begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;F \leq -3.4 \cdot 10^{+202}:\\ \;\;\;\;\frac{1}{\frac{\tan B}{-x}}\\ \mathbf{elif}\;F \leq -1.35 \cdot 10^{+18}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.82 \cdot 10^{-90}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 480000000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{B}, {\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F, -1 \cdot \frac{x}{B}\right)\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{+186}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                                    (FPCore (F B x)
                                     :precision binary64
                                     (let* ((t_0 (/ (- x) (tan B))))
                                       (if (<= F -3.4e+202)
                                         (/ 1.0 (/ (tan B) (- x)))
                                         (if (<= F -1.35e+18)
                                           (/ -1.0 (sin B))
                                           (if (<= F 1.82e-90)
                                             t_0
                                             (if (<= F 480000000000.0)
                                               (fma (/ 1.0 B) (* (pow (fma 2.0 x 2.0) -0.5) F) (* -1.0 (/ x B)))
                                               (if (<= F 6.2e+186) (/ 1.0 (sin B)) t_0)))))))
                                    double code(double F, double B, double x) {
                                    	double t_0 = -x / tan(B);
                                    	double tmp;
                                    	if (F <= -3.4e+202) {
                                    		tmp = 1.0 / (tan(B) / -x);
                                    	} else if (F <= -1.35e+18) {
                                    		tmp = -1.0 / sin(B);
                                    	} else if (F <= 1.82e-90) {
                                    		tmp = t_0;
                                    	} else if (F <= 480000000000.0) {
                                    		tmp = fma((1.0 / B), (pow(fma(2.0, x, 2.0), -0.5) * F), (-1.0 * (x / B)));
                                    	} else if (F <= 6.2e+186) {
                                    		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 (F <= -3.4e+202)
                                    		tmp = Float64(1.0 / Float64(tan(B) / Float64(-x)));
                                    	elseif (F <= -1.35e+18)
                                    		tmp = Float64(-1.0 / sin(B));
                                    	elseif (F <= 1.82e-90)
                                    		tmp = t_0;
                                    	elseif (F <= 480000000000.0)
                                    		tmp = fma(Float64(1.0 / B), Float64((fma(2.0, x, 2.0) ^ -0.5) * F), Float64(-1.0 * Float64(x / B)));
                                    	elseif (F <= 6.2e+186)
                                    		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[F, -3.4e+202], N[(1.0 / N[(N[Tan[B], $MachinePrecision] / (-x)), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.35e+18], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.82e-90], t$95$0, If[LessEqual[F, 480000000000.0], N[(N[(1.0 / B), $MachinePrecision] * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.2e+186], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
                                    
                                    \begin{array}{l}
                                    t_0 := \frac{-x}{\tan B}\\
                                    \mathbf{if}\;F \leq -3.4 \cdot 10^{+202}:\\
                                    \;\;\;\;\frac{1}{\frac{\tan B}{-x}}\\
                                    
                                    \mathbf{elif}\;F \leq -1.35 \cdot 10^{+18}:\\
                                    \;\;\;\;\frac{-1}{\sin B}\\
                                    
                                    \mathbf{elif}\;F \leq 1.82 \cdot 10^{-90}:\\
                                    \;\;\;\;t\_0\\
                                    
                                    \mathbf{elif}\;F \leq 480000000000:\\
                                    \;\;\;\;\mathsf{fma}\left(\frac{1}{B}, {\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F, -1 \cdot \frac{x}{B}\right)\\
                                    
                                    \mathbf{elif}\;F \leq 6.2 \cdot 10^{+186}:\\
                                    \;\;\;\;\frac{1}{\sin B}\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;t\_0\\
                                    
                                    
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 5 regimes
                                    2. if F < -3.4000000000000001e202

                                      1. Initial program 77.4%

                                        \[\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.9%

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

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

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

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

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

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

                                          \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                                        6. div-flip-revN/A

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

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

                                          \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right) \]
                                        9. tan-quotN/A

                                          \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                        10. lift-tan.f64N/A

                                          \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                        11. mult-flip-revN/A

                                          \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
                                        12. distribute-frac-negN/A

                                          \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\color{blue}{\tan B}} \]
                                        13. lift-neg.f64N/A

                                          \[\leadsto \frac{-x}{\tan \color{blue}{B}} \]
                                        14. lift-/.f6456.0%

                                          \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
                                      6. Applied rewrites56.0%

                                        \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                      7. Step-by-step derivation
                                        1. lift-tan.f64N/A

                                          \[\leadsto \frac{-x}{\tan B} \]
                                        2. lift-/.f64N/A

                                          \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
                                        3. div-flipN/A

                                          \[\leadsto \frac{1}{\color{blue}{\frac{\tan B}{-x}}} \]
                                        4. lower-unsound-/.f64N/A

                                          \[\leadsto \frac{1}{\color{blue}{\frac{\tan B}{-x}}} \]
                                        5. lower-unsound-/.f64N/A

                                          \[\leadsto \frac{1}{\frac{\tan B}{\color{blue}{-x}}} \]
                                        6. lift-tan.f6455.9%

                                          \[\leadsto \frac{1}{\frac{\tan B}{-\color{blue}{x}}} \]
                                      8. Applied rewrites55.9%

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

                                      if -3.4000000000000001e202 < F < -1.35e18

                                      1. Initial program 77.4%

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

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

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

                                      if -1.35e18 < F < 1.8199999999999999e-90 or 6.2000000000000002e186 < F

                                      1. Initial program 77.4%

                                        \[\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.9%

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

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

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

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

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

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

                                          \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                                        6. div-flip-revN/A

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

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

                                          \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right) \]
                                        9. tan-quotN/A

                                          \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                        10. lift-tan.f64N/A

                                          \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                        11. mult-flip-revN/A

                                          \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
                                        12. distribute-frac-negN/A

                                          \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\color{blue}{\tan B}} \]
                                        13. lift-neg.f64N/A

                                          \[\leadsto \frac{-x}{\tan \color{blue}{B}} \]
                                        14. lift-/.f6456.0%

                                          \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
                                      6. Applied rewrites56.0%

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

                                      if 1.8199999999999999e-90 < F < 4.8e11

                                      1. Initial program 77.4%

                                        \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

                                        \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, {\left(\mathsf{fma}\left(2, x, \color{blue}{2}\right)\right)}^{-0.5} \cdot F, -1 \cdot \frac{x}{B}\right) \]
                                      8. Step-by-step derivation
                                        1. Applied rewrites36.6%

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

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

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

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

                                        if 4.8e11 < F < 6.2000000000000002e186

                                        1. Initial program 77.4%

                                          \[\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.8%

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

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

                                      Alternative 13: 59.1% accurate, 1.9× speedup?

                                      \[\begin{array}{l} t_0 := \frac{-x}{\tan B}\\ \mathbf{if}\;F \leq -3.4 \cdot 10^{+202}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq -1.35 \cdot 10^{+18}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.82 \cdot 10^{-90}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;F \leq 480000000000:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{B}, {\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F, -1 \cdot \frac{x}{B}\right)\\ \mathbf{elif}\;F \leq 6.2 \cdot 10^{+186}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                                      (FPCore (F B x)
                                       :precision binary64
                                       (let* ((t_0 (/ (- x) (tan B))))
                                         (if (<= F -3.4e+202)
                                           t_0
                                           (if (<= F -1.35e+18)
                                             (/ -1.0 (sin B))
                                             (if (<= F 1.82e-90)
                                               t_0
                                               (if (<= F 480000000000.0)
                                                 (fma (/ 1.0 B) (* (pow (fma 2.0 x 2.0) -0.5) F) (* -1.0 (/ x B)))
                                                 (if (<= F 6.2e+186) (/ 1.0 (sin B)) t_0)))))))
                                      double code(double F, double B, double x) {
                                      	double t_0 = -x / tan(B);
                                      	double tmp;
                                      	if (F <= -3.4e+202) {
                                      		tmp = t_0;
                                      	} else if (F <= -1.35e+18) {
                                      		tmp = -1.0 / sin(B);
                                      	} else if (F <= 1.82e-90) {
                                      		tmp = t_0;
                                      	} else if (F <= 480000000000.0) {
                                      		tmp = fma((1.0 / B), (pow(fma(2.0, x, 2.0), -0.5) * F), (-1.0 * (x / B)));
                                      	} else if (F <= 6.2e+186) {
                                      		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 (F <= -3.4e+202)
                                      		tmp = t_0;
                                      	elseif (F <= -1.35e+18)
                                      		tmp = Float64(-1.0 / sin(B));
                                      	elseif (F <= 1.82e-90)
                                      		tmp = t_0;
                                      	elseif (F <= 480000000000.0)
                                      		tmp = fma(Float64(1.0 / B), Float64((fma(2.0, x, 2.0) ^ -0.5) * F), Float64(-1.0 * Float64(x / B)));
                                      	elseif (F <= 6.2e+186)
                                      		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[F, -3.4e+202], t$95$0, If[LessEqual[F, -1.35e+18], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.82e-90], t$95$0, If[LessEqual[F, 480000000000.0], N[(N[(1.0 / B), $MachinePrecision] * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.2e+186], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
                                      
                                      \begin{array}{l}
                                      t_0 := \frac{-x}{\tan B}\\
                                      \mathbf{if}\;F \leq -3.4 \cdot 10^{+202}:\\
                                      \;\;\;\;t\_0\\
                                      
                                      \mathbf{elif}\;F \leq -1.35 \cdot 10^{+18}:\\
                                      \;\;\;\;\frac{-1}{\sin B}\\
                                      
                                      \mathbf{elif}\;F \leq 1.82 \cdot 10^{-90}:\\
                                      \;\;\;\;t\_0\\
                                      
                                      \mathbf{elif}\;F \leq 480000000000:\\
                                      \;\;\;\;\mathsf{fma}\left(\frac{1}{B}, {\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F, -1 \cdot \frac{x}{B}\right)\\
                                      
                                      \mathbf{elif}\;F \leq 6.2 \cdot 10^{+186}:\\
                                      \;\;\;\;\frac{1}{\sin B}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;t\_0\\
                                      
                                      
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 4 regimes
                                      2. if F < -3.4000000000000001e202 or -1.35e18 < F < 1.8199999999999999e-90 or 6.2000000000000002e186 < F

                                        1. Initial program 77.4%

                                          \[\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.9%

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

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

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

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

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

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

                                            \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                                          6. div-flip-revN/A

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

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

                                            \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right) \]
                                          9. tan-quotN/A

                                            \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                          10. lift-tan.f64N/A

                                            \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                          11. mult-flip-revN/A

                                            \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
                                          12. distribute-frac-negN/A

                                            \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\color{blue}{\tan B}} \]
                                          13. lift-neg.f64N/A

                                            \[\leadsto \frac{-x}{\tan \color{blue}{B}} \]
                                          14. lift-/.f6456.0%

                                            \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
                                        6. Applied rewrites56.0%

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

                                        if -3.4000000000000001e202 < F < -1.35e18

                                        1. Initial program 77.4%

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

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

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

                                        if 1.8199999999999999e-90 < F < 4.8e11

                                        1. Initial program 77.4%

                                          \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

                                          \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, {\left(\mathsf{fma}\left(2, x, \color{blue}{2}\right)\right)}^{-0.5} \cdot F, -1 \cdot \frac{x}{B}\right) \]
                                        8. Step-by-step derivation
                                          1. Applied rewrites36.6%

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

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

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

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

                                          if 4.8e11 < F < 6.2000000000000002e186

                                          1. Initial program 77.4%

                                            \[\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.8%

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

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

                                        Alternative 14: 51.9% accurate, 2.5× speedup?

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

                                          1. Initial program 77.4%

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

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

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

                                          if -2.1499999999999999 < F < 4.8e11

                                          1. Initial program 77.4%

                                            \[\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. mult-flipN/A

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

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

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

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

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

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

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

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

                                            \[\leadsto \mathsf{fma}\left(\frac{1}{\sin B}, {\left(\mathsf{fma}\left(2, x, \color{blue}{2}\right)\right)}^{-0.5} \cdot F, -1 \cdot \frac{x}{B}\right) \]
                                          8. Step-by-step derivation
                                            1. Applied rewrites36.6%

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

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

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

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

                                            if 4.8e11 < F

                                            1. Initial program 77.4%

                                              \[\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.8%

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

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

                                          Alternative 15: 45.3% accurate, 2.5× speedup?

                                          \[\begin{array}{l} \mathbf{if}\;F \leq -1.06 \cdot 10^{+15}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 480000000000:\\ \;\;\;\;-1 \cdot \frac{x}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
                                          (FPCore (F B x)
                                           :precision binary64
                                           (if (<= F -1.06e+15)
                                             (/ -1.0 (sin B))
                                             (if (<= F 480000000000.0) (* -1.0 (/ x (sin B))) (/ 1.0 (sin B)))))
                                          double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= -1.06e+15) {
                                          		tmp = -1.0 / sin(B);
                                          	} else if (F <= 480000000000.0) {
                                          		tmp = -1.0 * (x / sin(B));
                                          	} else {
                                          		tmp = 1.0 / 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.06d+15)) then
                                                  tmp = (-1.0d0) / sin(b)
                                              else if (f <= 480000000000.0d0) then
                                                  tmp = (-1.0d0) * (x / sin(b))
                                              else
                                                  tmp = 1.0d0 / sin(b)
                                              end if
                                              code = tmp
                                          end function
                                          
                                          public static double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= -1.06e+15) {
                                          		tmp = -1.0 / Math.sin(B);
                                          	} else if (F <= 480000000000.0) {
                                          		tmp = -1.0 * (x / Math.sin(B));
                                          	} else {
                                          		tmp = 1.0 / Math.sin(B);
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(F, B, x):
                                          	tmp = 0
                                          	if F <= -1.06e+15:
                                          		tmp = -1.0 / math.sin(B)
                                          	elif F <= 480000000000.0:
                                          		tmp = -1.0 * (x / math.sin(B))
                                          	else:
                                          		tmp = 1.0 / math.sin(B)
                                          	return tmp
                                          
                                          function code(F, B, x)
                                          	tmp = 0.0
                                          	if (F <= -1.06e+15)
                                          		tmp = Float64(-1.0 / sin(B));
                                          	elseif (F <= 480000000000.0)
                                          		tmp = Float64(-1.0 * Float64(x / sin(B)));
                                          	else
                                          		tmp = Float64(1.0 / sin(B));
                                          	end
                                          	return tmp
                                          end
                                          
                                          function tmp_2 = code(F, B, x)
                                          	tmp = 0.0;
                                          	if (F <= -1.06e+15)
                                          		tmp = -1.0 / sin(B);
                                          	elseif (F <= 480000000000.0)
                                          		tmp = -1.0 * (x / sin(B));
                                          	else
                                          		tmp = 1.0 / sin(B);
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[F_, B_, x_] := If[LessEqual[F, -1.06e+15], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 480000000000.0], N[(-1.0 * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
                                          
                                          \begin{array}{l}
                                          \mathbf{if}\;F \leq -1.06 \cdot 10^{+15}:\\
                                          \;\;\;\;\frac{-1}{\sin B}\\
                                          
                                          \mathbf{elif}\;F \leq 480000000000:\\
                                          \;\;\;\;-1 \cdot \frac{x}{\sin B}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\frac{1}{\sin B}\\
                                          
                                          
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if F < -1.06e15

                                            1. Initial program 77.4%

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

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

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

                                            if -1.06e15 < F < 4.8e11

                                            1. Initial program 77.4%

                                              \[\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.9%

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

                                              \[\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.4%

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

                                              if 4.8e11 < F

                                              1. Initial program 77.4%

                                                \[\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.8%

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

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

                                            Alternative 16: 44.2% accurate, 2.6× speedup?

                                            \[\begin{array}{l} \mathbf{if}\;F \leq -40000000000000:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 480000000000:\\ \;\;\;\;-\frac{x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= F -40000000000000.0)
                                               (/ -1.0 (sin B))
                                               (if (<= F 480000000000.0) (- (/ x B)) (/ 1.0 (sin B)))))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -40000000000000.0) {
                                            		tmp = -1.0 / sin(B);
                                            	} else if (F <= 480000000000.0) {
                                            		tmp = -(x / B);
                                            	} else {
                                            		tmp = 1.0 / 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 <= (-40000000000000.0d0)) then
                                                    tmp = (-1.0d0) / sin(b)
                                                else if (f <= 480000000000.0d0) then
                                                    tmp = -(x / b)
                                                else
                                                    tmp = 1.0d0 / sin(b)
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -40000000000000.0) {
                                            		tmp = -1.0 / Math.sin(B);
                                            	} else if (F <= 480000000000.0) {
                                            		tmp = -(x / B);
                                            	} else {
                                            		tmp = 1.0 / Math.sin(B);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(F, B, x):
                                            	tmp = 0
                                            	if F <= -40000000000000.0:
                                            		tmp = -1.0 / math.sin(B)
                                            	elif F <= 480000000000.0:
                                            		tmp = -(x / B)
                                            	else:
                                            		tmp = 1.0 / math.sin(B)
                                            	return tmp
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (F <= -40000000000000.0)
                                            		tmp = Float64(-1.0 / sin(B));
                                            	elseif (F <= 480000000000.0)
                                            		tmp = Float64(-Float64(x / B));
                                            	else
                                            		tmp = Float64(1.0 / sin(B));
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(F, B, x)
                                            	tmp = 0.0;
                                            	if (F <= -40000000000000.0)
                                            		tmp = -1.0 / sin(B);
                                            	elseif (F <= 480000000000.0)
                                            		tmp = -(x / B);
                                            	else
                                            		tmp = 1.0 / sin(B);
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[F, -40000000000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 480000000000.0], (-N[(x / B), $MachinePrecision]), N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
                                            
                                            \begin{array}{l}
                                            \mathbf{if}\;F \leq -40000000000000:\\
                                            \;\;\;\;\frac{-1}{\sin B}\\
                                            
                                            \mathbf{elif}\;F \leq 480000000000:\\
                                            \;\;\;\;-\frac{x}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{1}{\sin B}\\
                                            
                                            
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if F < -4e13

                                              1. Initial program 77.4%

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

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

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

                                              if -4e13 < F < 4.8e11

                                              1. Initial program 77.4%

                                                \[\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.9%

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

                                                \[\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-/.f6429.1%

                                                  \[\leadsto -1 \cdot \frac{x}{B} \]
                                              7. Applied rewrites29.1%

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

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

                                                  \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
                                                3. lower-neg.f6429.1%

                                                  \[\leadsto -\frac{x}{B} \]
                                              9. Applied rewrites29.1%

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

                                              if 4.8e11 < F

                                              1. Initial program 77.4%

                                                \[\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.8%

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

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

                                            Alternative 17: 36.8% accurate, 2.9× speedup?

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

                                              1. Initial program 77.4%

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

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

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

                                              if -4e13 < F

                                              1. Initial program 77.4%

                                                \[\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.9%

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

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

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

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

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

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

                                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                                                6. div-flip-revN/A

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

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

                                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right) \]
                                                9. tan-quotN/A

                                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                                10. lift-tan.f64N/A

                                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                                11. mult-flip-revN/A

                                                  \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
                                                12. distribute-frac-negN/A

                                                  \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\color{blue}{\tan B}} \]
                                                13. lift-neg.f64N/A

                                                  \[\leadsto \frac{-x}{\tan \color{blue}{B}} \]
                                                14. lift-/.f6456.0%

                                                  \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
                                              6. Applied rewrites56.0%

                                                \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                              7. Taylor expanded in B around 0

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

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

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

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

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x, \frac{1}{3} \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                                                5. lower-pow.f6429.1%

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

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

                                            Alternative 18: 29.9% accurate, 3.3× speedup?

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

                                              1. Initial program 77.4%

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

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

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

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

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

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

                                                  \[\leadsto \frac{-1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{\color{blue}{2}}\right)} \]
                                                4. lower-pow.f6410.0%

                                                  \[\leadsto \frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)} \]
                                              7. Applied rewrites10.0%

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

                                              if -1.26e18 < F

                                              1. Initial program 77.4%

                                                \[\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.9%

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

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

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

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

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

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

                                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                                                6. div-flip-revN/A

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

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

                                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right) \]
                                                9. tan-quotN/A

                                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                                10. lift-tan.f64N/A

                                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                                11. mult-flip-revN/A

                                                  \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
                                                12. distribute-frac-negN/A

                                                  \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\color{blue}{\tan B}} \]
                                                13. lift-neg.f64N/A

                                                  \[\leadsto \frac{-x}{\tan \color{blue}{B}} \]
                                                14. lift-/.f6456.0%

                                                  \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
                                              6. Applied rewrites56.0%

                                                \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                              7. Taylor expanded in B around 0

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

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

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

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

                                                  \[\leadsto \frac{\mathsf{fma}\left(-1, x, \frac{1}{3} \cdot \left({B}^{2} \cdot x\right)\right)}{B} \]
                                                5. lower-pow.f6429.1%

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

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

                                            Alternative 19: 29.8% accurate, 3.4× speedup?

                                            \[\begin{array}{l} \mathbf{if}\;F \leq -1.26 \cdot 10^{+18}:\\ \;\;\;\;\frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B \cdot \left(1 + 0.3333333333333333 \cdot {B}^{2}\right)}\\ \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= F -1.26e+18)
                                               (/ -1.0 (* B (+ 1.0 (* -0.16666666666666666 (pow B 2.0)))))
                                               (/ (- x) (* B (+ 1.0 (* 0.3333333333333333 (pow B 2.0)))))))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -1.26e+18) {
                                            		tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * pow(B, 2.0))));
                                            	} else {
                                            		tmp = -x / (B * (1.0 + (0.3333333333333333 * pow(B, 2.0))));
                                            	}
                                            	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.26d+18)) then
                                                    tmp = (-1.0d0) / (b * (1.0d0 + ((-0.16666666666666666d0) * (b ** 2.0d0))))
                                                else
                                                    tmp = -x / (b * (1.0d0 + (0.3333333333333333d0 * (b ** 2.0d0))))
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -1.26e+18) {
                                            		tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * Math.pow(B, 2.0))));
                                            	} else {
                                            		tmp = -x / (B * (1.0 + (0.3333333333333333 * Math.pow(B, 2.0))));
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(F, B, x):
                                            	tmp = 0
                                            	if F <= -1.26e+18:
                                            		tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * math.pow(B, 2.0))))
                                            	else:
                                            		tmp = -x / (B * (1.0 + (0.3333333333333333 * math.pow(B, 2.0))))
                                            	return tmp
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (F <= -1.26e+18)
                                            		tmp = Float64(-1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * (B ^ 2.0)))));
                                            	else
                                            		tmp = Float64(Float64(-x) / Float64(B * Float64(1.0 + Float64(0.3333333333333333 * (B ^ 2.0)))));
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(F, B, x)
                                            	tmp = 0.0;
                                            	if (F <= -1.26e+18)
                                            		tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * (B ^ 2.0))));
                                            	else
                                            		tmp = -x / (B * (1.0 + (0.3333333333333333 * (B ^ 2.0))));
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[F, -1.26e+18], N[(-1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-x) / N[(B * N[(1.0 + N[(0.3333333333333333 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                            
                                            \begin{array}{l}
                                            \mathbf{if}\;F \leq -1.26 \cdot 10^{+18}:\\
                                            \;\;\;\;\frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{-x}{B \cdot \left(1 + 0.3333333333333333 \cdot {B}^{2}\right)}\\
                                            
                                            
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if F < -1.26e18

                                              1. Initial program 77.4%

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

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

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

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

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

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

                                                  \[\leadsto \frac{-1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{\color{blue}{2}}\right)} \]
                                                4. lower-pow.f6410.0%

                                                  \[\leadsto \frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)} \]
                                              7. Applied rewrites10.0%

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

                                              if -1.26e18 < F

                                              1. Initial program 77.4%

                                                \[\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.9%

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

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

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

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

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

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

                                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{\cos B}{\sin B}\right) \]
                                                6. div-flip-revN/A

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

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

                                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\frac{\sin B}{\cos B}}\right) \]
                                                9. tan-quotN/A

                                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                                10. lift-tan.f64N/A

                                                  \[\leadsto \mathsf{neg}\left(x \cdot \frac{1}{\tan B}\right) \]
                                                11. mult-flip-revN/A

                                                  \[\leadsto \mathsf{neg}\left(\frac{x}{\tan B}\right) \]
                                                12. distribute-frac-negN/A

                                                  \[\leadsto \frac{\mathsf{neg}\left(x\right)}{\color{blue}{\tan B}} \]
                                                13. lift-neg.f64N/A

                                                  \[\leadsto \frac{-x}{\tan \color{blue}{B}} \]
                                                14. lift-/.f6456.0%

                                                  \[\leadsto \frac{-x}{\color{blue}{\tan B}} \]
                                              6. Applied rewrites56.0%

                                                \[\leadsto \color{blue}{\frac{-x}{\tan B}} \]
                                              7. Taylor expanded in B around 0

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

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

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

                                                  \[\leadsto \frac{-x}{B \cdot \left(1 + \frac{1}{3} \cdot {B}^{\color{blue}{2}}\right)} \]
                                                4. lower-pow.f6429.0%

                                                  \[\leadsto \frac{-x}{B \cdot \left(1 + 0.3333333333333333 \cdot {B}^{2}\right)} \]
                                              9. Applied rewrites29.0%

                                                \[\leadsto \frac{-x}{B \cdot \color{blue}{\left(1 + 0.3333333333333333 \cdot {B}^{2}\right)}} \]
                                            3. Recombined 2 regimes into one program.
                                            4. Add Preprocessing

                                            Alternative 20: 29.8% accurate, 3.5× speedup?

                                            \[\begin{array}{l} \mathbf{if}\;F \leq -1.26 \cdot 10^{+18}:\\ \;\;\;\;\frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{x}{B}\\ \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= F -1.26e+18)
                                               (/ -1.0 (* B (+ 1.0 (* -0.16666666666666666 (pow B 2.0)))))
                                               (- (/ x B))))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -1.26e+18) {
                                            		tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * pow(B, 2.0))));
                                            	} else {
                                            		tmp = -(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.26d+18)) then
                                                    tmp = (-1.0d0) / (b * (1.0d0 + ((-0.16666666666666666d0) * (b ** 2.0d0))))
                                                else
                                                    tmp = -(x / b)
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -1.26e+18) {
                                            		tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * Math.pow(B, 2.0))));
                                            	} else {
                                            		tmp = -(x / B);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(F, B, x):
                                            	tmp = 0
                                            	if F <= -1.26e+18:
                                            		tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * math.pow(B, 2.0))))
                                            	else:
                                            		tmp = -(x / B)
                                            	return tmp
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (F <= -1.26e+18)
                                            		tmp = Float64(-1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * (B ^ 2.0)))));
                                            	else
                                            		tmp = Float64(-Float64(x / B));
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(F, B, x)
                                            	tmp = 0.0;
                                            	if (F <= -1.26e+18)
                                            		tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * (B ^ 2.0))));
                                            	else
                                            		tmp = -(x / B);
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[F, -1.26e+18], N[(-1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(x / B), $MachinePrecision])]
                                            
                                            \begin{array}{l}
                                            \mathbf{if}\;F \leq -1.26 \cdot 10^{+18}:\\
                                            \;\;\;\;\frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;-\frac{x}{B}\\
                                            
                                            
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if F < -1.26e18

                                              1. Initial program 77.4%

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

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

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

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

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

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

                                                  \[\leadsto \frac{-1}{B \cdot \left(1 + \frac{-1}{6} \cdot {B}^{\color{blue}{2}}\right)} \]
                                                4. lower-pow.f6410.0%

                                                  \[\leadsto \frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)} \]
                                              7. Applied rewrites10.0%

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

                                              if -1.26e18 < F

                                              1. Initial program 77.4%

                                                \[\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.9%

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

                                                \[\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-/.f6429.1%

                                                  \[\leadsto -1 \cdot \frac{x}{B} \]
                                              7. Applied rewrites29.1%

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

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

                                                  \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
                                                3. lower-neg.f6429.1%

                                                  \[\leadsto -\frac{x}{B} \]
                                              9. Applied rewrites29.1%

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

                                            Alternative 21: 29.8% accurate, 3.9× speedup?

                                            \[\begin{array}{l} \mathbf{if}\;F \leq -1.26 \cdot 10^{+18}:\\ \;\;\;\;\frac{-0.16666666666666666 \cdot {B}^{2} - 1}{B}\\ \mathbf{else}:\\ \;\;\;\;-\frac{x}{B}\\ \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= F -1.26e+18)
                                               (/ (- (* -0.16666666666666666 (pow B 2.0)) 1.0) B)
                                               (- (/ x B))))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -1.26e+18) {
                                            		tmp = ((-0.16666666666666666 * pow(B, 2.0)) - 1.0) / B;
                                            	} else {
                                            		tmp = -(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.26d+18)) then
                                                    tmp = (((-0.16666666666666666d0) * (b ** 2.0d0)) - 1.0d0) / b
                                                else
                                                    tmp = -(x / b)
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -1.26e+18) {
                                            		tmp = ((-0.16666666666666666 * Math.pow(B, 2.0)) - 1.0) / B;
                                            	} else {
                                            		tmp = -(x / B);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(F, B, x):
                                            	tmp = 0
                                            	if F <= -1.26e+18:
                                            		tmp = ((-0.16666666666666666 * math.pow(B, 2.0)) - 1.0) / B
                                            	else:
                                            		tmp = -(x / B)
                                            	return tmp
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (F <= -1.26e+18)
                                            		tmp = Float64(Float64(Float64(-0.16666666666666666 * (B ^ 2.0)) - 1.0) / B);
                                            	else
                                            		tmp = Float64(-Float64(x / B));
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(F, B, x)
                                            	tmp = 0.0;
                                            	if (F <= -1.26e+18)
                                            		tmp = ((-0.16666666666666666 * (B ^ 2.0)) - 1.0) / B;
                                            	else
                                            		tmp = -(x / B);
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[F, -1.26e+18], N[(N[(N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision], (-N[(x / B), $MachinePrecision])]
                                            
                                            \begin{array}{l}
                                            \mathbf{if}\;F \leq -1.26 \cdot 10^{+18}:\\
                                            \;\;\;\;\frac{-0.16666666666666666 \cdot {B}^{2} - 1}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;-\frac{x}{B}\\
                                            
                                            
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if F < -1.26e18

                                              1. Initial program 77.4%

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

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

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

                                                \[\leadsto \frac{\frac{-1}{6} \cdot {B}^{2} - 1}{\color{blue}{B}} \]
                                              6. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{\frac{-1}{6} \cdot {B}^{2} - 1}{B} \]
                                                2. lower--.f64N/A

                                                  \[\leadsto \frac{\frac{-1}{6} \cdot {B}^{2} - 1}{B} \]
                                                3. lower-*.f64N/A

                                                  \[\leadsto \frac{\frac{-1}{6} \cdot {B}^{2} - 1}{B} \]
                                                4. lower-pow.f649.8%

                                                  \[\leadsto \frac{-0.16666666666666666 \cdot {B}^{2} - 1}{B} \]
                                              7. Applied rewrites9.8%

                                                \[\leadsto \frac{-0.16666666666666666 \cdot {B}^{2} - 1}{\color{blue}{B}} \]

                                              if -1.26e18 < F

                                              1. Initial program 77.4%

                                                \[\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.9%

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

                                                \[\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-/.f6429.1%

                                                  \[\leadsto -1 \cdot \frac{x}{B} \]
                                              7. Applied rewrites29.1%

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

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

                                                  \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
                                                3. lower-neg.f6429.1%

                                                  \[\leadsto -\frac{x}{B} \]
                                              9. Applied rewrites29.1%

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

                                            Alternative 22: 29.8% accurate, 12.7× speedup?

                                            \[\begin{array}{l} \mathbf{if}\;F \leq -1.26 \cdot 10^{+18}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;-\frac{x}{B}\\ \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= F -1.26e+18) (/ -1.0 B) (- (/ x B))))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -1.26e+18) {
                                            		tmp = -1.0 / B;
                                            	} else {
                                            		tmp = -(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.26d+18)) then
                                                    tmp = (-1.0d0) / b
                                                else
                                                    tmp = -(x / b)
                                                end if
                                                code = tmp
                                            end function
                                            
                                            public static double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= -1.26e+18) {
                                            		tmp = -1.0 / B;
                                            	} else {
                                            		tmp = -(x / B);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(F, B, x):
                                            	tmp = 0
                                            	if F <= -1.26e+18:
                                            		tmp = -1.0 / B
                                            	else:
                                            		tmp = -(x / B)
                                            	return tmp
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (F <= -1.26e+18)
                                            		tmp = Float64(-1.0 / B);
                                            	else
                                            		tmp = Float64(-Float64(x / B));
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(F, B, x)
                                            	tmp = 0.0;
                                            	if (F <= -1.26e+18)
                                            		tmp = -1.0 / B;
                                            	else
                                            		tmp = -(x / B);
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[F, -1.26e+18], N[(-1.0 / B), $MachinePrecision], (-N[(x / B), $MachinePrecision])]
                                            
                                            \begin{array}{l}
                                            \mathbf{if}\;F \leq -1.26 \cdot 10^{+18}:\\
                                            \;\;\;\;\frac{-1}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;-\frac{x}{B}\\
                                            
                                            
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if F < -1.26e18

                                              1. Initial program 77.4%

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

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

                                                \[\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.1%

                                                  \[\leadsto \frac{-1}{B} \]

                                                if -1.26e18 < F

                                                1. Initial program 77.4%

                                                  \[\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.9%

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

                                                  \[\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-/.f6429.1%

                                                    \[\leadsto -1 \cdot \frac{x}{B} \]
                                                7. Applied rewrites29.1%

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

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

                                                    \[\leadsto \mathsf{neg}\left(\frac{x}{B}\right) \]
                                                  3. lower-neg.f6429.1%

                                                    \[\leadsto -\frac{x}{B} \]
                                                9. Applied rewrites29.1%

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

                                              Alternative 23: 10.1% accurate, 26.5× speedup?

                                              \[\frac{-1}{B} \]
                                              (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]
                                              
                                              \frac{-1}{B}
                                              
                                              Derivation
                                              1. Initial program 77.4%

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

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

                                                \[\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.1%

                                                  \[\leadsto \frac{-1}{B} \]
                                                2. Add Preprocessing

                                                Reproduce

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