VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.7% → 99.7%
Time: 7.9s
Alternatives: 25
Speedup: 1.3×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 25 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.7% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 5 \cdot 10^{+121}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, t\_1\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\sin B}, t\_0\right)\\


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

    1. Initial program 77.7%

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

        \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \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) \]
      6. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \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) \]
      7. associate-*l*N/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.9%

      \[\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 F around -inf

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

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

      if -9.99999999999999921e80 < F < 5.00000000000000007e121

      1. Initial program 77.7%

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

          \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \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) \]
        6. *-commutativeN/A

          \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \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) \]
        7. associate-*l*N/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.9%

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

      if 5.00000000000000007e121 < F

      1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\sin B}, \frac{1}{\sin B}\right) \]
        7. lower-sin.f6455.9

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

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

    Alternative 2: 99.6% accurate, 1.0× speedup?

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

      1. Initial program 77.7%

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

          \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \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) \]
        6. *-commutativeN/A

          \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \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) \]
        7. associate-*l*N/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.9%

        \[\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 F around -inf

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

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

        if -9.99999999999999921e80 < F < 1.79999999999999989e95

        1. Initial program 77.7%

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

            \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \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) \]
          6. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \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) \]
          7. associate-*l*N/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.9%

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

        if 1.79999999999999989e95 < F

        1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \color{blue}{\frac{1}{F \cdot \sin B}}\right) \]
          3. distribute-rgt-inN/A

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

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

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

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

            \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{\frac{1}{F} \cdot F}{\color{blue}{\sin B}} \]
          8. inv-powN/A

            \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{-1} \cdot F}{\sin B} \]
          9. pow-plusN/A

            \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{\left(-1 + 1\right)}}{\sin \color{blue}{B}} \]
          10. metadata-evalN/A

            \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{0}}{\sin B} \]
          11. metadata-evalN/A

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

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

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

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

      Alternative 3: 99.6% accurate, 1.0× speedup?

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

        1. Initial program 77.7%

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

            \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \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) \]
          6. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \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) \]
          7. associate-*l*N/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.9%

          \[\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 F around -inf

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

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

          if -7.99999999999999955e58 < F < 2.2000000000000001e100

          1. Initial program 77.7%

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

              \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \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) \]
            6. associate-*l*N/A

              \[\leadsto \color{blue}{F \cdot \left(\frac{1}{\sin B} \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) \]
            7. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(F, \frac{1}{\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}\right)} \]
          3. Applied rewrites85.8%

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

          if 2.2000000000000001e100 < F

          1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \color{blue}{\frac{1}{F \cdot \sin B}}\right) \]
            3. distribute-rgt-inN/A

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

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

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

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

              \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{\frac{1}{F} \cdot F}{\color{blue}{\sin B}} \]
            8. inv-powN/A

              \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{-1} \cdot F}{\sin B} \]
            9. pow-plusN/A

              \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{\left(-1 + 1\right)}}{\sin \color{blue}{B}} \]
            10. metadata-evalN/A

              \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{0}}{\sin B} \]
            11. metadata-evalN/A

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

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

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

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

        Alternative 4: 99.1% accurate, 1.0× speedup?

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

          1. Initial program 77.7%

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

              \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \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) \]
            6. *-commutativeN/A

              \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \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) \]
            7. associate-*l*N/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.9%

            \[\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 F around -inf

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

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

            if -3.6e52 < F < 2.1999999999999999e90

            1. Initial program 77.7%

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

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

              \[\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 2.1999999999999999e90 < F

            1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \color{blue}{\frac{1}{F \cdot \sin B}}\right) \]
              3. distribute-rgt-inN/A

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

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

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

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

                \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{\frac{1}{F} \cdot F}{\color{blue}{\sin B}} \]
              8. inv-powN/A

                \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{-1} \cdot F}{\sin B} \]
              9. pow-plusN/A

                \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{\left(-1 + 1\right)}}{\sin \color{blue}{B}} \]
              10. metadata-evalN/A

                \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{0}}{\sin B} \]
              11. metadata-evalN/A

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

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

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

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

          Alternative 5: 97.8% accurate, 1.1× speedup?

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

            1. Initial program 77.7%

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

                \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \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) \]
              6. *-commutativeN/A

                \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \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) \]
              7. associate-*l*N/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.9%

              \[\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 F around -inf

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

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

              if -2.3e30 < F < 0.0097999999999999997

              1. Initial program 77.7%

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

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

                \[\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}} \]
              4. Taylor expanded in F around 0

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

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

                if 0.0097999999999999997 < F

                1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \color{blue}{\frac{1}{F \cdot \sin B}}\right) \]
                  3. distribute-rgt-inN/A

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

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

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

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

                    \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{\frac{1}{F} \cdot F}{\color{blue}{\sin B}} \]
                  8. inv-powN/A

                    \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{-1} \cdot F}{\sin B} \]
                  9. pow-plusN/A

                    \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{\left(-1 + 1\right)}}{\sin \color{blue}{B}} \]
                  10. metadata-evalN/A

                    \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{0}}{\sin B} \]
                  11. metadata-evalN/A

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

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

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

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

              Alternative 6: 92.1% accurate, 1.2× speedup?

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

                1. Initial program 77.7%

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

                    \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \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) \]
                  6. *-commutativeN/A

                    \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \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) \]
                  7. associate-*l*N/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.9%

                  \[\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 F around -inf

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

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

                  if -14000 < F < -1.74999999999999989e-85

                  1. Initial program 77.7%

                    \[\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}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                  3. Step-by-step derivation
                    1. Applied rewrites49.7%

                      \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{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 \left(-x \cdot \frac{1}{B}\right) + \color{blue}{\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 \left(-x \cdot \frac{1}{B}\right) + \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} \]
                    3. Applied rewrites57.7%

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

                    if -1.74999999999999989e-85 < F < 2.7e5

                    1. Initial program 77.7%

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

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

                      \[\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}} \]
                    4. Taylor expanded in B around 0

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

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

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

                          \[\leadsto {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot \color{blue}{\frac{F}{B}} - \frac{x}{\tan B} \]
                        3. associate-*r/N/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}{B}} - \frac{x}{\tan B} \]
                        4. div-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 2.7e5 < F

                      1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \color{blue}{\frac{1}{F \cdot \sin B}}\right) \]
                        3. distribute-rgt-inN/A

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

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

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

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

                          \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{\frac{1}{F} \cdot F}{\color{blue}{\sin B}} \]
                        8. inv-powN/A

                          \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{-1} \cdot F}{\sin B} \]
                        9. pow-plusN/A

                          \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{\left(-1 + 1\right)}}{\sin \color{blue}{B}} \]
                        10. metadata-evalN/A

                          \[\leadsto \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \cdot F + \frac{{F}^{0}}{\sin B} \]
                        11. metadata-evalN/A

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

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

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

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

                    Alternative 7: 92.1% accurate, 1.3× speedup?

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

                      1. Initial program 77.7%

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

                          \[\leadsto \color{blue}{\left(F \cdot \frac{1}{\sin B}\right)} \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) \]
                        6. *-commutativeN/A

                          \[\leadsto \color{blue}{\left(\frac{1}{\sin B} \cdot F\right)} \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) \]
                        7. associate-*l*N/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.9%

                        \[\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 F around -inf

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

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

                        if -14000 < F < -1.74999999999999989e-85

                        1. Initial program 77.7%

                          \[\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}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                        3. Step-by-step derivation
                          1. Applied rewrites49.7%

                            \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{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 \left(-x \cdot \frac{1}{B}\right) + \color{blue}{\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 \left(-x \cdot \frac{1}{B}\right) + \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \cdot \frac{F}{\sin B}} \]
                          3. Applied rewrites57.7%

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

                          if -1.74999999999999989e-85 < F < 2.7e5

                          1. Initial program 77.7%

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

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

                            \[\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}} \]
                          4. Taylor expanded in B around 0

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

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

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

                                \[\leadsto {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot \color{blue}{\frac{F}{B}} - \frac{x}{\tan B} \]
                              3. associate-*r/N/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}{B}} - \frac{x}{\tan B} \]
                              4. div-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if 2.7e5 < F

                            1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 8: 80.8% accurate, 1.3× speedup?

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

                            1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                              5. lower-unsound-*.f64N/A

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                              6. lower-unsound-log.f6416.6

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

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                              8. *-commutativeN/A

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(\sin B \cdot F\right) \cdot -1}\right) \]
                              9. lower-*.f6416.6

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(\sin B \cdot F\right) \cdot -1}\right) \]
                            9. Applied rewrites16.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{\sin B \cdot F}\right|\right) \]
                              18. lift-*.f6432.8

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

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

                            if -2.00000000000000003e205 < F < 2.7e5

                            1. Initial program 77.7%

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

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

                              \[\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}} \]
                            4. Taylor expanded in B around 0

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

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

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

                                  \[\leadsto {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot \color{blue}{\frac{F}{B}} - \frac{x}{\tan B} \]
                                3. associate-*r/N/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}{B}} - \frac{x}{\tan B} \]
                                4. div-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if 2.7e5 < F

                              1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 9: 78.2% accurate, 0.3× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \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)}\\ t_1 := \frac{1}{\frac{B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}} - \frac{x}{\tan B}\\ \mathbf{if}\;t\_0 \leq -200000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 10:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{-x}{B}\right)\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+290}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{\sin B \cdot F}\right|\right)\\ \end{array} \end{array} \]
                            (FPCore (F B x)
                             :precision binary64
                             (let* ((t_0
                                     (+
                                      (- (* x (/ 1.0 (tan B))))
                                      (*
                                       (/ F (sin B))
                                       (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
                                    (t_1
                                     (-
                                      (/ 1.0 (/ B (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F)))
                                      (/ x (tan B)))))
                               (if (<= t_0 -200000.0)
                                 t_1
                                 (if (<= t_0 10.0)
                                   (fma
                                    (/ 1.0 (sin B))
                                    (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F)
                                    (/ (- x) B))
                                   (if (<= t_0 4e+290)
                                     t_1
                                     (* F (fma -1.0 (/ x (* B F)) (fabs (/ 1.0 (* (sin B) F))))))))))
                            double code(double F, double B, double x) {
                            	double t_0 = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
                            	double t_1 = (1.0 / (B / (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F))) - (x / tan(B));
                            	double tmp;
                            	if (t_0 <= -200000.0) {
                            		tmp = t_1;
                            	} else if (t_0 <= 10.0) {
                            		tmp = fma((1.0 / sin(B)), (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F), (-x / B));
                            	} else if (t_0 <= 4e+290) {
                            		tmp = t_1;
                            	} else {
                            		tmp = F * fma(-1.0, (x / (B * F)), fabs((1.0 / (sin(B) * F))));
                            	}
                            	return tmp;
                            }
                            
                            function code(F, B, x)
                            	t_0 = 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)))))
                            	t_1 = Float64(Float64(1.0 / Float64(B / Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F))) - Float64(x / tan(B)))
                            	tmp = 0.0
                            	if (t_0 <= -200000.0)
                            		tmp = t_1;
                            	elseif (t_0 <= 10.0)
                            		tmp = fma(Float64(1.0 / sin(B)), Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F), Float64(Float64(-x) / B));
                            	elseif (t_0 <= 4e+290)
                            		tmp = t_1;
                            	else
                            		tmp = Float64(F * fma(-1.0, Float64(x / Float64(B * F)), abs(Float64(1.0 / Float64(sin(B) * F)))));
                            	end
                            	return tmp
                            end
                            
                            code[F_, B_, x_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(N[(1.0 / N[(B / N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -200000.0], t$95$1, If[LessEqual[t$95$0, 10.0], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+290], t$95$1, N[(F * N[(-1.0 * N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[Abs[N[(1.0 / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_0 := \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)}\\
                            t_1 := \frac{1}{\frac{B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}} - \frac{x}{\tan B}\\
                            \mathbf{if}\;t\_0 \leq -200000:\\
                            \;\;\;\;t\_1\\
                            
                            \mathbf{elif}\;t\_0 \leq 10:\\
                            \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{-x}{B}\right)\\
                            
                            \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+290}:\\
                            \;\;\;\;t\_1\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{\sin B \cdot F}\right|\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -2e5 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 4.00000000000000025e290

                              1. Initial program 77.7%

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

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

                                \[\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}} \]
                              4. Taylor expanded in B around 0

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

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

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

                                    \[\leadsto {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot \color{blue}{\frac{F}{B}} - \frac{x}{\tan B} \]
                                  3. associate-*r/N/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}{B}} - \frac{x}{\tan B} \]
                                  4. div-flipN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                if -2e5 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10

                                1. Initial program 77.7%

                                  \[\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}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites49.7%

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

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

                                  if 4.00000000000000025e290 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))))))

                                  1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                    5. lower-unsound-*.f64N/A

                                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                    6. lower-unsound-log.f6416.6

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

                                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                    8. *-commutativeN/A

                                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(\sin B \cdot F\right) \cdot -1}\right) \]
                                    9. lower-*.f6416.6

                                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(\sin B \cdot F\right) \cdot -1}\right) \]
                                  9. Applied rewrites16.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{\sin B \cdot F}\right|\right) \]
                                    18. lift-*.f6432.8

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

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

                                Alternative 10: 77.0% accurate, 0.3× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \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)}\\ t_1 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;t\_0 \leq -200000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 10:\\ \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{-x}{B}\right)\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+290}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{\sin B \cdot F}\right|\right)\\ \end{array} \end{array} \]
                                (FPCore (F B x)
                                 :precision binary64
                                 (let* ((t_0
                                         (+
                                          (- (* x (/ 1.0 (tan B))))
                                          (*
                                           (/ F (sin B))
                                           (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
                                        (t_1
                                         (- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F B)) (/ x (tan B)))))
                                   (if (<= t_0 -200000.0)
                                     t_1
                                     (if (<= t_0 10.0)
                                       (fma
                                        (/ 1.0 (sin B))
                                        (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F)
                                        (/ (- x) B))
                                       (if (<= t_0 4e+290)
                                         t_1
                                         (* F (fma -1.0 (/ x (* B F)) (fabs (/ 1.0 (* (sin B) F))))))))))
                                double code(double F, double B, double x) {
                                	double t_0 = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
                                	double t_1 = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / tan(B));
                                	double tmp;
                                	if (t_0 <= -200000.0) {
                                		tmp = t_1;
                                	} else if (t_0 <= 10.0) {
                                		tmp = fma((1.0 / sin(B)), (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F), (-x / B));
                                	} else if (t_0 <= 4e+290) {
                                		tmp = t_1;
                                	} else {
                                		tmp = F * fma(-1.0, (x / (B * F)), fabs((1.0 / (sin(B) * F))));
                                	}
                                	return tmp;
                                }
                                
                                function code(F, B, x)
                                	t_0 = 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)))))
                                	t_1 = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B)))
                                	tmp = 0.0
                                	if (t_0 <= -200000.0)
                                		tmp = t_1;
                                	elseif (t_0 <= 10.0)
                                		tmp = fma(Float64(1.0 / sin(B)), Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F), Float64(Float64(-x) / B));
                                	elseif (t_0 <= 4e+290)
                                		tmp = t_1;
                                	else
                                		tmp = Float64(F * fma(-1.0, Float64(x / Float64(B * F)), abs(Float64(1.0 / Float64(sin(B) * F)))));
                                	end
                                	return tmp
                                end
                                
                                code[F_, B_, x_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -200000.0], t$95$1, If[LessEqual[t$95$0, 10.0], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+290], t$95$1, N[(F * N[(-1.0 * N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[Abs[N[(1.0 / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                t_0 := \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)}\\
                                t_1 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
                                \mathbf{if}\;t\_0 \leq -200000:\\
                                \;\;\;\;t\_1\\
                                
                                \mathbf{elif}\;t\_0 \leq 10:\\
                                \;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{-x}{B}\right)\\
                                
                                \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+290}:\\
                                \;\;\;\;t\_1\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{\sin B \cdot F}\right|\right)\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -2e5 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 4.00000000000000025e290

                                  1. Initial program 77.7%

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

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

                                    \[\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}} \]
                                  4. Taylor expanded in B around 0

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

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

                                    if -2e5 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10

                                    1. Initial program 77.7%

                                      \[\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}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites49.7%

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

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

                                      if 4.00000000000000025e290 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))))))

                                      1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                        5. lower-unsound-*.f64N/A

                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                        6. lower-unsound-log.f6416.6

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

                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                        8. *-commutativeN/A

                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(\sin B \cdot F\right) \cdot -1}\right) \]
                                        9. lower-*.f6416.6

                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(\sin B \cdot F\right) \cdot -1}\right) \]
                                      9. Applied rewrites16.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{\sin B \cdot F}\right|\right) \]
                                        18. lift-*.f6432.8

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

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

                                    Alternative 11: 77.0% accurate, 0.3× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \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)}\\ t_1 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{if}\;t\_0 \leq -200000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 10:\\ \;\;\;\;\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}{B}\right)\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+290}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{\sin B \cdot F}\right|\right)\\ \end{array} \end{array} \]
                                    (FPCore (F B x)
                                     :precision binary64
                                     (let* ((t_0
                                             (+
                                              (- (* x (/ 1.0 (tan B))))
                                              (*
                                               (/ F (sin B))
                                               (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
                                            (t_1
                                             (- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F B)) (/ x (tan B)))))
                                       (if (<= t_0 -200000.0)
                                         t_1
                                         (if (<= t_0 10.0)
                                           (fma F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B)) (/ (- x) B))
                                           (if (<= t_0 4e+290)
                                             t_1
                                             (* F (fma -1.0 (/ x (* B F)) (fabs (/ 1.0 (* (sin B) F))))))))))
                                    double code(double F, double B, double x) {
                                    	double t_0 = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
                                    	double t_1 = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / tan(B));
                                    	double tmp;
                                    	if (t_0 <= -200000.0) {
                                    		tmp = t_1;
                                    	} else if (t_0 <= 10.0) {
                                    		tmp = fma(F, (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B)), (-x / B));
                                    	} else if (t_0 <= 4e+290) {
                                    		tmp = t_1;
                                    	} else {
                                    		tmp = F * fma(-1.0, (x / (B * F)), fabs((1.0 / (sin(B) * F))));
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(F, B, x)
                                    	t_0 = 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)))))
                                    	t_1 = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B)))
                                    	tmp = 0.0
                                    	if (t_0 <= -200000.0)
                                    		tmp = t_1;
                                    	elseif (t_0 <= 10.0)
                                    		tmp = fma(F, Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(Float64(-x) / B));
                                    	elseif (t_0 <= 4e+290)
                                    		tmp = t_1;
                                    	else
                                    		tmp = Float64(F * fma(-1.0, Float64(x / Float64(B * F)), abs(Float64(1.0 / Float64(sin(B) * F)))));
                                    	end
                                    	return tmp
                                    end
                                    
                                    code[F_, B_, x_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -200000.0], t$95$1, If[LessEqual[t$95$0, 10.0], N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+290], t$95$1, N[(F * N[(-1.0 * N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[Abs[N[(1.0 / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    t_0 := \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)}\\
                                    t_1 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
                                    \mathbf{if}\;t\_0 \leq -200000:\\
                                    \;\;\;\;t\_1\\
                                    
                                    \mathbf{elif}\;t\_0 \leq 10:\\
                                    \;\;\;\;\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}{B}\right)\\
                                    
                                    \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+290}:\\
                                    \;\;\;\;t\_1\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{\sin B \cdot F}\right|\right)\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 3 regimes
                                    2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -2e5 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 4.00000000000000025e290

                                      1. Initial program 77.7%

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

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

                                        \[\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}} \]
                                      4. Taylor expanded in B around 0

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

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

                                        if -2e5 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10

                                        1. Initial program 77.7%

                                          \[\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}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites49.7%

                                            \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{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}{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}{B}\right)} \]
                                          3. Applied rewrites57.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}{B}\right)} \]

                                          if 4.00000000000000025e290 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))))))

                                          1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                            5. lower-unsound-*.f64N/A

                                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                            6. lower-unsound-log.f6416.6

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

                                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                            8. *-commutativeN/A

                                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(\sin B \cdot F\right) \cdot -1}\right) \]
                                            9. lower-*.f6416.6

                                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(\sin B \cdot F\right) \cdot -1}\right) \]
                                          9. Applied rewrites16.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{\sin B \cdot F}\right|\right) \]
                                            18. lift-*.f6432.8

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

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

                                        Alternative 12: 74.6% accurate, 1.4× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -1.75 \cdot 10^{-85}:\\ \;\;\;\;\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}{B}\right)\\ \mathbf{elif}\;F \leq 9.8 \cdot 10^{+42}:\\ \;\;\;\;{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-\frac{x}{B \cdot F}, F, \frac{1}{\sin B}\right)\\ \end{array} \end{array} \]
                                        (FPCore (F B x)
                                         :precision binary64
                                         (if (<= F -1.35e+154)
                                           (/ -1.0 (sin B))
                                           (if (<= F -1.75e-85)
                                             (fma F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B)) (/ (- x) B))
                                             (if (<= F 9.8e+42)
                                               (- (* (pow (fma 2.0 x 2.0) -0.5) (/ F B)) (/ x (tan B)))
                                               (fma (- (/ x (* B F))) F (/ 1.0 (sin B)))))))
                                        double code(double F, double B, double x) {
                                        	double tmp;
                                        	if (F <= -1.35e+154) {
                                        		tmp = -1.0 / sin(B);
                                        	} else if (F <= -1.75e-85) {
                                        		tmp = fma(F, (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B)), (-x / B));
                                        	} else if (F <= 9.8e+42) {
                                        		tmp = (pow(fma(2.0, x, 2.0), -0.5) * (F / B)) - (x / tan(B));
                                        	} else {
                                        		tmp = fma(-(x / (B * F)), F, (1.0 / sin(B)));
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(F, B, x)
                                        	tmp = 0.0
                                        	if (F <= -1.35e+154)
                                        		tmp = Float64(-1.0 / sin(B));
                                        	elseif (F <= -1.75e-85)
                                        		tmp = fma(F, Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(Float64(-x) / B));
                                        	elseif (F <= 9.8e+42)
                                        		tmp = Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B)));
                                        	else
                                        		tmp = fma(Float64(-Float64(x / Float64(B * F))), F, Float64(1.0 / sin(B)));
                                        	end
                                        	return tmp
                                        end
                                        
                                        code[F_, B_, x_] := If[LessEqual[F, -1.35e+154], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.75e-85], N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.8e+42], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision]) * F + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\
                                        \;\;\;\;\frac{-1}{\sin B}\\
                                        
                                        \mathbf{elif}\;F \leq -1.75 \cdot 10^{-85}:\\
                                        \;\;\;\;\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}{B}\right)\\
                                        
                                        \mathbf{elif}\;F \leq 9.8 \cdot 10^{+42}:\\
                                        \;\;\;\;{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\mathsf{fma}\left(-\frac{x}{B \cdot F}, F, \frac{1}{\sin B}\right)\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 4 regimes
                                        2. if F < -1.35000000000000003e154

                                          1. Initial program 77.7%

                                            \[\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.35000000000000003e154 < F < -1.74999999999999989e-85

                                          1. Initial program 77.7%

                                            \[\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}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites49.7%

                                              \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{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}{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}{B}\right)} \]
                                            3. Applied rewrites57.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}{B}\right)} \]

                                            if -1.74999999999999989e-85 < F < 9.8000000000000004e42

                                            1. Initial program 77.7%

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

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

                                              \[\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}} \]
                                            4. Taylor expanded in B around 0

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

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

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

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

                                                if 9.8000000000000004e42 < F

                                                1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    \[\leadsto F \cdot \left(-1 \cdot \frac{x}{B \cdot F} + \color{blue}{\frac{1}{F \cdot \sin B}}\right) \]
                                                  3. distribute-rgt-inN/A

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

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

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

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

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

                                                    \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{{F}^{-1} \cdot F}{\sin B} \]
                                                  9. pow-plusN/A

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

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

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

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

                                                    \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{x}{B \cdot F}, \color{blue}{F}, \frac{1}{\sin B}\right) \]
                                                9. Applied rewrites34.0%

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

                                              Alternative 13: 73.4% accurate, 1.4× speedup?

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

                                                1. Initial program 77.7%

                                                  \[\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.8000000000000001e147 < F < -1.74999999999999989e-85

                                                1. Initial program 77.7%

                                                  \[\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}{\color{blue}{B}}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites49.7%

                                                    \[\leadsto \left(-x \cdot \frac{1}{\color{blue}{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}{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}{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}{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}{B}} \]
                                                    5. lower--.f6449.7

                                                      \[\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}{B}} \]
                                                  3. Applied rewrites49.7%

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

                                                  if -1.74999999999999989e-85 < F < 9.8000000000000004e42

                                                  1. Initial program 77.7%

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

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

                                                    \[\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}} \]
                                                  4. Taylor expanded in B around 0

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

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

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

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

                                                      if 9.8000000000000004e42 < F

                                                      1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto F \cdot \left(-1 \cdot \frac{x}{B \cdot F} + \color{blue}{\frac{1}{F \cdot \sin B}}\right) \]
                                                        3. distribute-rgt-inN/A

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

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

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

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

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

                                                          \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{{F}^{-1} \cdot F}{\sin B} \]
                                                        9. pow-plusN/A

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

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

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

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

                                                          \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{x}{B \cdot F}, \color{blue}{F}, \frac{1}{\sin B}\right) \]
                                                      9. Applied rewrites34.0%

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

                                                    Alternative 14: 70.3% accurate, 1.5× speedup?

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

                                                      1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                                        5. lower-unsound-*.f64N/A

                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                                        6. lower-unsound-log.f6416.6

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

                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                                        8. *-commutativeN/A

                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(\sin B \cdot F\right) \cdot -1}\right) \]
                                                        9. lower-*.f6416.6

                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(\sin B \cdot F\right) \cdot -1}\right) \]
                                                      9. Applied rewrites16.6%

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

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

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

                                                          \[\leadsto F \cdot \left(e^{\log \left(\sin B \cdot F\right) \cdot -1} + \color{blue}{-1} \cdot \frac{x}{B \cdot F}\right) \]
                                                        4. exp-fabsN/A

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

                                                          \[\leadsto F \cdot \left(\left|e^{\log \left(\sin B \cdot F\right) \cdot -1}\right| + -1 \cdot \frac{x}{B \cdot F}\right) \]
                                                        6. lift-log.f64N/A

                                                          \[\leadsto F \cdot \left(\left|e^{\log \left(\sin B \cdot F\right) \cdot -1}\right| + -1 \cdot \frac{x}{B \cdot F}\right) \]
                                                        7. exp-to-powN/A

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

                                                          \[\leadsto F \cdot \left(\left|{\left(\sin B \cdot F\right)}^{-1}\right| + -1 \cdot \frac{x}{B \cdot F}\right) \]
                                                        9. *-commutativeN/A

                                                          \[\leadsto F \cdot \left(\left|{\left(F \cdot \sin B\right)}^{-1}\right| + -1 \cdot \frac{x}{B \cdot F}\right) \]
                                                        10. pow-prod-downN/A

                                                          \[\leadsto F \cdot \left(\left|{F}^{-1} \cdot {\sin B}^{-1}\right| + -1 \cdot \frac{x}{B \cdot F}\right) \]
                                                        11. inv-powN/A

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

                                                          \[\leadsto F \cdot \left(\left|\frac{1}{F} \cdot {\sin B}^{-1}\right| + -1 \cdot \frac{x}{B \cdot F}\right) \]
                                                        13. inv-powN/A

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

                                                          \[\leadsto F \cdot \left(\left|\frac{1}{F} \cdot \frac{1}{\sin B}\right| + -1 \cdot \frac{x}{B \cdot F}\right) \]
                                                        15. fabs-mulN/A

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

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

                                                      if -2.3e30 < F < 9.8000000000000004e42

                                                      1. Initial program 77.7%

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

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

                                                        \[\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}} \]
                                                      4. Taylor expanded in B around 0

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

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

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

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

                                                          if 9.8000000000000004e42 < F

                                                          1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                              \[\leadsto F \cdot \left(-1 \cdot \frac{x}{B \cdot F} + \color{blue}{\frac{1}{F \cdot \sin B}}\right) \]
                                                            3. distribute-rgt-inN/A

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

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

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

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

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

                                                              \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{{F}^{-1} \cdot F}{\sin B} \]
                                                            9. pow-plusN/A

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

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

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

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

                                                              \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{x}{B \cdot F}, \color{blue}{F}, \frac{1}{\sin B}\right) \]
                                                          9. Applied rewrites34.0%

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

                                                        Alternative 15: 55.7% accurate, 1.8× speedup?

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

                                                          1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                                            5. lower-unsound-*.f64N/A

                                                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                                            6. lower-unsound-log.f6416.6

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

                                                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(F \cdot \sin B\right) \cdot -1}\right) \]
                                                            8. *-commutativeN/A

                                                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(\sin B \cdot F\right) \cdot -1}\right) \]
                                                            9. lower-*.f6416.6

                                                              \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, e^{\log \left(\sin B \cdot F\right) \cdot -1}\right) \]
                                                          9. Applied rewrites16.6%

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

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

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

                                                              \[\leadsto F \cdot \left(e^{\log \left(\sin B \cdot F\right) \cdot -1} + \color{blue}{-1} \cdot \frac{x}{B \cdot F}\right) \]
                                                            4. exp-fabsN/A

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

                                                              \[\leadsto F \cdot \left(\left|e^{\log \left(\sin B \cdot F\right) \cdot -1}\right| + -1 \cdot \frac{x}{B \cdot F}\right) \]
                                                            6. lift-log.f64N/A

                                                              \[\leadsto F \cdot \left(\left|e^{\log \left(\sin B \cdot F\right) \cdot -1}\right| + -1 \cdot \frac{x}{B \cdot F}\right) \]
                                                            7. exp-to-powN/A

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

                                                              \[\leadsto F \cdot \left(\left|{\left(\sin B \cdot F\right)}^{-1}\right| + -1 \cdot \frac{x}{B \cdot F}\right) \]
                                                            9. *-commutativeN/A

                                                              \[\leadsto F \cdot \left(\left|{\left(F \cdot \sin B\right)}^{-1}\right| + -1 \cdot \frac{x}{B \cdot F}\right) \]
                                                            10. pow-prod-downN/A

                                                              \[\leadsto F \cdot \left(\left|{F}^{-1} \cdot {\sin B}^{-1}\right| + -1 \cdot \frac{x}{B \cdot F}\right) \]
                                                            11. inv-powN/A

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

                                                              \[\leadsto F \cdot \left(\left|\frac{1}{F} \cdot {\sin B}^{-1}\right| + -1 \cdot \frac{x}{B \cdot F}\right) \]
                                                            13. inv-powN/A

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

                                                              \[\leadsto F \cdot \left(\left|\frac{1}{F} \cdot \frac{1}{\sin B}\right| + -1 \cdot \frac{x}{B \cdot F}\right) \]
                                                            15. fabs-mulN/A

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

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

                                                          if 7.39999999999999957e-227 < B < 7.99999999999999999e-14

                                                          1. Initial program 77.7%

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

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

                                                          if 7.99999999999999999e-14 < B < 5.99999999999999981e35

                                                          1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                              \[\leadsto F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \]
                                                            6. lower-sin.f6446.1

                                                              \[\leadsto F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \]
                                                          7. Applied rewrites46.1%

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

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

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

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

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

                                                          if 5.99999999999999981e35 < B

                                                          1. Initial program 77.7%

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

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

                                                            \[\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}} \]
                                                          4. Taylor expanded in B around 0

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

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

                                                              \[\leadsto \color{blue}{\frac{1}{F}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
                                                            3. Step-by-step derivation
                                                              1. lower-/.f6447.0

                                                                \[\leadsto \frac{1}{\color{blue}{F}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
                                                            4. Applied rewrites47.0%

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

                                                          Alternative 16: 54.3% accurate, 2.0× speedup?

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

                                                            1. Initial program 77.7%

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

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

                                                            if 7.99999999999999999e-14 < B < 5.99999999999999981e35

                                                            1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                \[\leadsto F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \]
                                                              6. lower-sin.f6446.1

                                                                \[\leadsto F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \]
                                                            7. Applied rewrites46.1%

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

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

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

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

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

                                                            if 5.99999999999999981e35 < B

                                                            1. Initial program 77.7%

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

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

                                                              \[\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}} \]
                                                            4. Taylor expanded in B around 0

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

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

                                                                \[\leadsto \color{blue}{\frac{1}{F}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
                                                              3. Step-by-step derivation
                                                                1. lower-/.f6447.0

                                                                  \[\leadsto \frac{1}{\color{blue}{F}} \cdot \frac{F}{B} - \frac{x}{\tan B} \]
                                                              4. Applied rewrites47.0%

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

                                                            Alternative 17: 50.0% accurate, 2.2× speedup?

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

                                                              1. Initial program 77.7%

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

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

                                                              if 7.99999999999999999e-14 < B

                                                              1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  \[\leadsto F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \]
                                                                6. lower-sin.f6446.1

                                                                  \[\leadsto F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \]
                                                              7. Applied rewrites46.1%

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

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

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

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

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

                                                            Alternative 18: 49.5% accurate, 2.1× speedup?

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

                                                              1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                5. lower-/.f6428.0

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

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

                                                                \[\leadsto \frac{-1 \cdot x}{B} \]
                                                              9. Step-by-step derivation
                                                                1. lower-*.f6428.8

                                                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                                              10. Applied rewrites28.8%

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

                                                              if 9.19999999999999922e-220 < B < 7.99999999999999999e-14

                                                              1. Initial program 77.7%

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

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

                                                                \[\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}} \]
                                                              4. Taylor expanded in B around 0

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

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

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

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

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

                                                                if 7.99999999999999999e-14 < B

                                                                1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                    \[\leadsto F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \]
                                                                  6. lower-sin.f6446.1

                                                                    \[\leadsto F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B}\right) \]
                                                                7. Applied rewrites46.1%

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

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

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

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

                                                                  \[\leadsto \left(-\frac{\frac{x}{\tan B}}{F}\right) \cdot \color{blue}{F} \]
                                                              6. Recombined 3 regimes into one program.
                                                              7. Add Preprocessing

                                                              Alternative 19: 46.7% accurate, 2.0× speedup?

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

                                                                1. Initial program 77.7%

                                                                  \[\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 -8.5e43 < F < 3.99999999999999983e28

                                                                1. Initial program 77.7%

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

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

                                                                  \[\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}} \]
                                                                4. Taylor expanded in B around 0

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

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

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

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

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

                                                                  if 3.99999999999999983e28 < F < 8.0000000000000002e188

                                                                  1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      \[\leadsto F \cdot \left(-1 \cdot \frac{x}{B \cdot F} + \color{blue}{\frac{1}{F \cdot \sin B}}\right) \]
                                                                    3. distribute-rgt-inN/A

                                                                      \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \color{blue}{\frac{1}{F \cdot \sin B} \cdot F} \]
                                                                    4. lift-/.f64N/A

                                                                      \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{1}{F \cdot \sin B} \cdot F \]
                                                                    5. lift-*.f64N/A

                                                                      \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{1}{F \cdot \sin B} \cdot F \]
                                                                    6. associate-/r*N/A

                                                                      \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{\frac{1}{F}}{\sin B} \cdot F \]
                                                                    7. associate-*l/N/A

                                                                      \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{\frac{1}{F} \cdot F}{\color{blue}{\sin B}} \]
                                                                    8. inv-powN/A

                                                                      \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{{F}^{-1} \cdot F}{\sin B} \]
                                                                    9. pow-plusN/A

                                                                      \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{{F}^{\left(-1 + 1\right)}}{\sin \color{blue}{B}} \]
                                                                    10. metadata-evalN/A

                                                                      \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{{F}^{0}}{\sin B} \]
                                                                    11. metadata-evalN/A

                                                                      \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{1}{\sin \color{blue}{B}} \]
                                                                    12. lift-/.f64N/A

                                                                      \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{1}{\color{blue}{\sin B}} \]
                                                                    13. lower-fma.f64N/A

                                                                      \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{x}{B \cdot F}, \color{blue}{F}, \frac{1}{\sin B}\right) \]
                                                                  9. Applied rewrites34.0%

                                                                    \[\leadsto \mathsf{fma}\left(-\frac{x}{B \cdot F}, \color{blue}{F}, \frac{1}{\sin B}\right) \]
                                                                  10. Taylor expanded in B around 0

                                                                    \[\leadsto \frac{1 + \left(-1 \cdot x + {B}^{2} \cdot \left(\frac{1}{6} + -1 \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot x\right)\right)\right)}{\color{blue}{B}} \]
                                                                  11. Step-by-step derivation
                                                                    1. metadata-evalN/A

                                                                      \[\leadsto \frac{1 + \left(-1 \cdot x + {B}^{2} \cdot \left(\frac{1}{6} + -1 \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)\right)\right)}{B} \]
                                                                    2. metadata-evalN/A

                                                                      \[\leadsto \frac{1 + \left(-1 \cdot x + {B}^{2} \cdot \left(\frac{1}{6} + -1 \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)\right)\right)}{B} \]
                                                                    3. lower-/.f64N/A

                                                                      \[\leadsto \frac{1 + \left(-1 \cdot x + {B}^{2} \cdot \left(\frac{1}{6} + -1 \cdot \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot x - \frac{-1}{6} \cdot x\right)\right)\right)}{B} \]
                                                                  12. Applied rewrites28.7%

                                                                    \[\leadsto \frac{1 + \mathsf{fma}\left(-1, x, {B}^{2} \cdot \left(0.16666666666666666 + -1 \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)\right)\right)}{\color{blue}{B}} \]

                                                                  if 8.0000000000000002e188 < F

                                                                  1. Initial program 77.7%

                                                                    \[\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}} \]
                                                                6. Recombined 4 regimes into one program.
                                                                7. Add Preprocessing

                                                                Alternative 20: 43.1% accurate, 2.3× speedup?

                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -8.5 \cdot 10^{+43}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 8.5 \cdot 10^{+88}:\\ \;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{+188}:\\ \;\;\;\;\mathsf{fma}\left(-\frac{x}{B \cdot F}, F, \frac{1 + 0.16666666666666666 \cdot {B}^{2}}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
                                                                (FPCore (F B x)
                                                                 :precision binary64
                                                                 (if (<= F -8.5e+43)
                                                                   (/ -1.0 (sin B))
                                                                   (if (<= F 8.5e+88)
                                                                     (- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F B)) (/ x B))
                                                                     (if (<= F 8e+188)
                                                                       (fma
                                                                        (- (/ x (* B F)))
                                                                        F
                                                                        (/ (+ 1.0 (* 0.16666666666666666 (pow B 2.0))) B))
                                                                       (/ 1.0 (sin B))))))
                                                                double code(double F, double B, double x) {
                                                                	double tmp;
                                                                	if (F <= -8.5e+43) {
                                                                		tmp = -1.0 / sin(B);
                                                                	} else if (F <= 8.5e+88) {
                                                                		tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / B);
                                                                	} else if (F <= 8e+188) {
                                                                		tmp = fma(-(x / (B * F)), F, ((1.0 + (0.16666666666666666 * pow(B, 2.0))) / B));
                                                                	} else {
                                                                		tmp = 1.0 / sin(B);
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                function code(F, B, x)
                                                                	tmp = 0.0
                                                                	if (F <= -8.5e+43)
                                                                		tmp = Float64(-1.0 / sin(B));
                                                                	elseif (F <= 8.5e+88)
                                                                		tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B));
                                                                	elseif (F <= 8e+188)
                                                                		tmp = fma(Float64(-Float64(x / Float64(B * F))), F, Float64(Float64(1.0 + Float64(0.16666666666666666 * (B ^ 2.0))) / B));
                                                                	else
                                                                		tmp = Float64(1.0 / sin(B));
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                code[F_, B_, x_] := If[LessEqual[F, -8.5e+43], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.5e+88], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e+188], N[((-N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision]) * F + N[(N[(1.0 + N[(0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                \begin{array}{l}
                                                                \mathbf{if}\;F \leq -8.5 \cdot 10^{+43}:\\
                                                                \;\;\;\;\frac{-1}{\sin B}\\
                                                                
                                                                \mathbf{elif}\;F \leq 8.5 \cdot 10^{+88}:\\
                                                                \;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
                                                                
                                                                \mathbf{elif}\;F \leq 8 \cdot 10^{+188}:\\
                                                                \;\;\;\;\mathsf{fma}\left(-\frac{x}{B \cdot F}, F, \frac{1 + 0.16666666666666666 \cdot {B}^{2}}{B}\right)\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;\frac{1}{\sin B}\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 4 regimes
                                                                2. if F < -8.5e43

                                                                  1. Initial program 77.7%

                                                                    \[\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 -8.5e43 < F < 8.5000000000000005e88

                                                                  1. Initial program 77.7%

                                                                    \[\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.7

                                                                      \[\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.8%

                                                                    \[\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}} \]
                                                                  4. Taylor expanded in B around 0

                                                                    \[\leadsto {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{\color{blue}{B}} - \frac{x}{\tan B} \]
                                                                  5. Step-by-step derivation
                                                                    1. Applied rewrites62.0%

                                                                      \[\leadsto {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\color{blue}{B}} - \frac{x}{\tan B} \]
                                                                    2. Taylor expanded in B around 0

                                                                      \[\leadsto {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{\frac{-1}{2}} \cdot \frac{F}{B} - \color{blue}{\frac{x}{B}} \]
                                                                    3. Step-by-step derivation
                                                                      1. lower-/.f6434.7

                                                                        \[\leadsto {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\color{blue}{B}} \]
                                                                    4. Applied rewrites34.7%

                                                                      \[\leadsto {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \color{blue}{\frac{x}{B}} \]

                                                                    if 8.5000000000000005e88 < F < 8.0000000000000002e188

                                                                    1. Initial program 77.7%

                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                    2. Taylor expanded in F around inf

                                                                      \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                    3. Step-by-step derivation
                                                                      1. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                      2. lower-fma.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      3. lower-/.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      4. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      5. lower-cos.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      6. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      7. lower-sin.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      8. lower-/.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      9. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      10. lower-sin.f6447.4

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                    4. Applied rewrites47.4%

                                                                      \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                                                                    5. Taylor expanded in B around 0

                                                                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{\color{blue}{B \cdot F}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                    6. Step-by-step derivation
                                                                      1. lower-/.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot \color{blue}{F}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      2. lower-*.f6431.3

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{F \cdot \sin B}\right) \]
                                                                    7. Applied rewrites31.3%

                                                                      \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x}{\color{blue}{B \cdot F}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                    8. Step-by-step derivation
                                                                      1. lift-*.f64N/A

                                                                        \[\leadsto F \cdot \color{blue}{\mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{F \cdot \sin B}\right)} \]
                                                                      2. lift-fma.f64N/A

                                                                        \[\leadsto F \cdot \left(-1 \cdot \frac{x}{B \cdot F} + \color{blue}{\frac{1}{F \cdot \sin B}}\right) \]
                                                                      3. distribute-rgt-inN/A

                                                                        \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \color{blue}{\frac{1}{F \cdot \sin B} \cdot F} \]
                                                                      4. lift-/.f64N/A

                                                                        \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{1}{F \cdot \sin B} \cdot F \]
                                                                      5. lift-*.f64N/A

                                                                        \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{1}{F \cdot \sin B} \cdot F \]
                                                                      6. associate-/r*N/A

                                                                        \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{\frac{1}{F}}{\sin B} \cdot F \]
                                                                      7. associate-*l/N/A

                                                                        \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{\frac{1}{F} \cdot F}{\color{blue}{\sin B}} \]
                                                                      8. inv-powN/A

                                                                        \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{{F}^{-1} \cdot F}{\sin B} \]
                                                                      9. pow-plusN/A

                                                                        \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{{F}^{\left(-1 + 1\right)}}{\sin \color{blue}{B}} \]
                                                                      10. metadata-evalN/A

                                                                        \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{{F}^{0}}{\sin B} \]
                                                                      11. metadata-evalN/A

                                                                        \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{1}{\sin \color{blue}{B}} \]
                                                                      12. lift-/.f64N/A

                                                                        \[\leadsto \left(-1 \cdot \frac{x}{B \cdot F}\right) \cdot F + \frac{1}{\color{blue}{\sin B}} \]
                                                                      13. lower-fma.f64N/A

                                                                        \[\leadsto \mathsf{fma}\left(-1 \cdot \frac{x}{B \cdot F}, \color{blue}{F}, \frac{1}{\sin B}\right) \]
                                                                    9. Applied rewrites34.0%

                                                                      \[\leadsto \mathsf{fma}\left(-\frac{x}{B \cdot F}, \color{blue}{F}, \frac{1}{\sin B}\right) \]
                                                                    10. Taylor expanded in B around 0

                                                                      \[\leadsto \mathsf{fma}\left(-\frac{x}{B \cdot F}, F, \frac{1 + \frac{1}{6} \cdot {B}^{2}}{B}\right) \]
                                                                    11. Step-by-step derivation
                                                                      1. lower-/.f64N/A

                                                                        \[\leadsto \mathsf{fma}\left(-\frac{x}{B \cdot F}, F, \frac{1 + \frac{1}{6} \cdot {B}^{2}}{B}\right) \]
                                                                      2. lower-+.f64N/A

                                                                        \[\leadsto \mathsf{fma}\left(-\frac{x}{B \cdot F}, F, \frac{1 + \frac{1}{6} \cdot {B}^{2}}{B}\right) \]
                                                                      3. lower-*.f64N/A

                                                                        \[\leadsto \mathsf{fma}\left(-\frac{x}{B \cdot F}, F, \frac{1 + \frac{1}{6} \cdot {B}^{2}}{B}\right) \]
                                                                      4. lower-pow.f6426.6

                                                                        \[\leadsto \mathsf{fma}\left(-\frac{x}{B \cdot F}, F, \frac{1 + 0.16666666666666666 \cdot {B}^{2}}{B}\right) \]
                                                                    12. Applied rewrites26.6%

                                                                      \[\leadsto \mathsf{fma}\left(-\frac{x}{B \cdot F}, F, \frac{1 + 0.16666666666666666 \cdot {B}^{2}}{B}\right) \]

                                                                    if 8.0000000000000002e188 < F

                                                                    1. Initial program 77.7%

                                                                      \[\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}} \]
                                                                  6. Recombined 4 regimes into one program.
                                                                  7. Add Preprocessing

                                                                  Alternative 21: 42.8% accurate, 2.4× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{+30}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-40}:\\ \;\;\;\;\frac{-1 \cdot x}{B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{+188}:\\ \;\;\;\;\frac{-1 \cdot \left(x - 1\right)}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sin B}\\ \end{array} \end{array} \]
                                                                  (FPCore (F B x)
                                                                   :precision binary64
                                                                   (if (<= F -2.3e+30)
                                                                     (/ -1.0 (sin B))
                                                                     (if (<= F 8e-40)
                                                                       (/ (* -1.0 x) B)
                                                                       (if (<= F 8e+188) (/ (* -1.0 (- x 1.0)) B) (/ 1.0 (sin B))))))
                                                                  double code(double F, double B, double x) {
                                                                  	double tmp;
                                                                  	if (F <= -2.3e+30) {
                                                                  		tmp = -1.0 / sin(B);
                                                                  	} else if (F <= 8e-40) {
                                                                  		tmp = (-1.0 * x) / B;
                                                                  	} else if (F <= 8e+188) {
                                                                  		tmp = (-1.0 * (x - 1.0)) / 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 <= (-2.3d+30)) then
                                                                          tmp = (-1.0d0) / sin(b)
                                                                      else if (f <= 8d-40) then
                                                                          tmp = ((-1.0d0) * x) / b
                                                                      else if (f <= 8d+188) then
                                                                          tmp = ((-1.0d0) * (x - 1.0d0)) / 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 <= -2.3e+30) {
                                                                  		tmp = -1.0 / Math.sin(B);
                                                                  	} else if (F <= 8e-40) {
                                                                  		tmp = (-1.0 * x) / B;
                                                                  	} else if (F <= 8e+188) {
                                                                  		tmp = (-1.0 * (x - 1.0)) / B;
                                                                  	} else {
                                                                  		tmp = 1.0 / Math.sin(B);
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  def code(F, B, x):
                                                                  	tmp = 0
                                                                  	if F <= -2.3e+30:
                                                                  		tmp = -1.0 / math.sin(B)
                                                                  	elif F <= 8e-40:
                                                                  		tmp = (-1.0 * x) / B
                                                                  	elif F <= 8e+188:
                                                                  		tmp = (-1.0 * (x - 1.0)) / B
                                                                  	else:
                                                                  		tmp = 1.0 / math.sin(B)
                                                                  	return tmp
                                                                  
                                                                  function code(F, B, x)
                                                                  	tmp = 0.0
                                                                  	if (F <= -2.3e+30)
                                                                  		tmp = Float64(-1.0 / sin(B));
                                                                  	elseif (F <= 8e-40)
                                                                  		tmp = Float64(Float64(-1.0 * x) / B);
                                                                  	elseif (F <= 8e+188)
                                                                  		tmp = Float64(Float64(-1.0 * Float64(x - 1.0)) / B);
                                                                  	else
                                                                  		tmp = Float64(1.0 / sin(B));
                                                                  	end
                                                                  	return tmp
                                                                  end
                                                                  
                                                                  function tmp_2 = code(F, B, x)
                                                                  	tmp = 0.0;
                                                                  	if (F <= -2.3e+30)
                                                                  		tmp = -1.0 / sin(B);
                                                                  	elseif (F <= 8e-40)
                                                                  		tmp = (-1.0 * x) / B;
                                                                  	elseif (F <= 8e+188)
                                                                  		tmp = (-1.0 * (x - 1.0)) / B;
                                                                  	else
                                                                  		tmp = 1.0 / sin(B);
                                                                  	end
                                                                  	tmp_2 = tmp;
                                                                  end
                                                                  
                                                                  code[F_, B_, x_] := If[LessEqual[F, -2.3e+30], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e-40], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8e+188], N[(N[(-1.0 * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  \mathbf{if}\;F \leq -2.3 \cdot 10^{+30}:\\
                                                                  \;\;\;\;\frac{-1}{\sin B}\\
                                                                  
                                                                  \mathbf{elif}\;F \leq 8 \cdot 10^{-40}:\\
                                                                  \;\;\;\;\frac{-1 \cdot x}{B}\\
                                                                  
                                                                  \mathbf{elif}\;F \leq 8 \cdot 10^{+188}:\\
                                                                  \;\;\;\;\frac{-1 \cdot \left(x - 1\right)}{B}\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;\frac{1}{\sin B}\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 4 regimes
                                                                  2. if F < -2.3e30

                                                                    1. Initial program 77.7%

                                                                      \[\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.3e30 < F < 7.9999999999999994e-40

                                                                    1. Initial program 77.7%

                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                    2. Taylor expanded in F around inf

                                                                      \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                    3. Step-by-step derivation
                                                                      1. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                      2. lower-fma.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      3. lower-/.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      4. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      5. lower-cos.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      6. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      7. lower-sin.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      8. lower-/.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      9. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      10. lower-sin.f6447.4

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                    4. Applied rewrites47.4%

                                                                      \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                                                                    5. Taylor expanded in B around 0

                                                                      \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{\color{blue}{B}} \]
                                                                    6. Step-by-step derivation
                                                                      1. lower-/.f64N/A

                                                                        \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                                      2. lower-*.f64N/A

                                                                        \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                                      3. lower-fma.f64N/A

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                      4. lower-/.f64N/A

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                      5. lower-/.f6428.0

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                    7. Applied rewrites28.0%

                                                                      \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{\color{blue}{B}} \]
                                                                    8. Taylor expanded in x around inf

                                                                      \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                    9. Step-by-step derivation
                                                                      1. lower-*.f6428.8

                                                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                    10. Applied rewrites28.8%

                                                                      \[\leadsto \frac{-1 \cdot x}{B} \]

                                                                    if 7.9999999999999994e-40 < F < 8.0000000000000002e188

                                                                    1. Initial program 77.7%

                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                    2. Taylor expanded in F around inf

                                                                      \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                    3. Step-by-step derivation
                                                                      1. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                      2. lower-fma.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      3. lower-/.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      4. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      5. lower-cos.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      6. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      7. lower-sin.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      8. lower-/.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      9. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      10. lower-sin.f6447.4

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                    4. Applied rewrites47.4%

                                                                      \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                                                                    5. Taylor expanded in B around 0

                                                                      \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{\color{blue}{B}} \]
                                                                    6. Step-by-step derivation
                                                                      1. lower-/.f64N/A

                                                                        \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                                      2. lower-*.f64N/A

                                                                        \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                                      3. lower-fma.f64N/A

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                      4. lower-/.f64N/A

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                      5. lower-/.f6428.0

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                    7. Applied rewrites28.0%

                                                                      \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{\color{blue}{B}} \]
                                                                    8. Taylor expanded in F around -inf

                                                                      \[\leadsto \frac{-1 \cdot \left(x - 1\right)}{B} \]
                                                                    9. Step-by-step derivation
                                                                      1. lower-*.f64N/A

                                                                        \[\leadsto \frac{-1 \cdot \left(x - 1\right)}{B} \]
                                                                      2. lower--.f6429.0

                                                                        \[\leadsto \frac{-1 \cdot \left(x - 1\right)}{B} \]
                                                                    10. Applied rewrites29.0%

                                                                      \[\leadsto \frac{-1 \cdot \left(x - 1\right)}{B} \]

                                                                    if 8.0000000000000002e188 < F

                                                                    1. Initial program 77.7%

                                                                      \[\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 4 regimes into one program.
                                                                  4. Add Preprocessing

                                                                  Alternative 22: 42.8% accurate, 2.9× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -2.3 \cdot 10^{+30}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-40}:\\ \;\;\;\;\frac{-1 \cdot x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 \cdot \left(x - 1\right)}{B}\\ \end{array} \end{array} \]
                                                                  (FPCore (F B x)
                                                                   :precision binary64
                                                                   (if (<= F -2.3e+30)
                                                                     (/ -1.0 (sin B))
                                                                     (if (<= F 8e-40) (/ (* -1.0 x) B) (/ (* -1.0 (- x 1.0)) B))))
                                                                  double code(double F, double B, double x) {
                                                                  	double tmp;
                                                                  	if (F <= -2.3e+30) {
                                                                  		tmp = -1.0 / sin(B);
                                                                  	} else if (F <= 8e-40) {
                                                                  		tmp = (-1.0 * x) / B;
                                                                  	} else {
                                                                  		tmp = (-1.0 * (x - 1.0)) / 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 <= (-2.3d+30)) then
                                                                          tmp = (-1.0d0) / sin(b)
                                                                      else if (f <= 8d-40) then
                                                                          tmp = ((-1.0d0) * x) / b
                                                                      else
                                                                          tmp = ((-1.0d0) * (x - 1.0d0)) / b
                                                                      end if
                                                                      code = tmp
                                                                  end function
                                                                  
                                                                  public static double code(double F, double B, double x) {
                                                                  	double tmp;
                                                                  	if (F <= -2.3e+30) {
                                                                  		tmp = -1.0 / Math.sin(B);
                                                                  	} else if (F <= 8e-40) {
                                                                  		tmp = (-1.0 * x) / B;
                                                                  	} else {
                                                                  		tmp = (-1.0 * (x - 1.0)) / B;
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  def code(F, B, x):
                                                                  	tmp = 0
                                                                  	if F <= -2.3e+30:
                                                                  		tmp = -1.0 / math.sin(B)
                                                                  	elif F <= 8e-40:
                                                                  		tmp = (-1.0 * x) / B
                                                                  	else:
                                                                  		tmp = (-1.0 * (x - 1.0)) / B
                                                                  	return tmp
                                                                  
                                                                  function code(F, B, x)
                                                                  	tmp = 0.0
                                                                  	if (F <= -2.3e+30)
                                                                  		tmp = Float64(-1.0 / sin(B));
                                                                  	elseif (F <= 8e-40)
                                                                  		tmp = Float64(Float64(-1.0 * x) / B);
                                                                  	else
                                                                  		tmp = Float64(Float64(-1.0 * Float64(x - 1.0)) / B);
                                                                  	end
                                                                  	return tmp
                                                                  end
                                                                  
                                                                  function tmp_2 = code(F, B, x)
                                                                  	tmp = 0.0;
                                                                  	if (F <= -2.3e+30)
                                                                  		tmp = -1.0 / sin(B);
                                                                  	elseif (F <= 8e-40)
                                                                  		tmp = (-1.0 * x) / B;
                                                                  	else
                                                                  		tmp = (-1.0 * (x - 1.0)) / B;
                                                                  	end
                                                                  	tmp_2 = tmp;
                                                                  end
                                                                  
                                                                  code[F_, B_, x_] := If[LessEqual[F, -2.3e+30], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e-40], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  \mathbf{if}\;F \leq -2.3 \cdot 10^{+30}:\\
                                                                  \;\;\;\;\frac{-1}{\sin B}\\
                                                                  
                                                                  \mathbf{elif}\;F \leq 8 \cdot 10^{-40}:\\
                                                                  \;\;\;\;\frac{-1 \cdot x}{B}\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;\frac{-1 \cdot \left(x - 1\right)}{B}\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 3 regimes
                                                                  2. if F < -2.3e30

                                                                    1. Initial program 77.7%

                                                                      \[\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.3e30 < F < 7.9999999999999994e-40

                                                                    1. Initial program 77.7%

                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                    2. Taylor expanded in F around inf

                                                                      \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                    3. Step-by-step derivation
                                                                      1. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                      2. lower-fma.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      3. lower-/.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      4. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      5. lower-cos.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      6. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      7. lower-sin.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      8. lower-/.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      9. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      10. lower-sin.f6447.4

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                    4. Applied rewrites47.4%

                                                                      \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                                                                    5. Taylor expanded in B around 0

                                                                      \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{\color{blue}{B}} \]
                                                                    6. Step-by-step derivation
                                                                      1. lower-/.f64N/A

                                                                        \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                                      2. lower-*.f64N/A

                                                                        \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                                      3. lower-fma.f64N/A

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                      4. lower-/.f64N/A

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                      5. lower-/.f6428.0

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                    7. Applied rewrites28.0%

                                                                      \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{\color{blue}{B}} \]
                                                                    8. Taylor expanded in x around inf

                                                                      \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                    9. Step-by-step derivation
                                                                      1. lower-*.f6428.8

                                                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                    10. Applied rewrites28.8%

                                                                      \[\leadsto \frac{-1 \cdot x}{B} \]

                                                                    if 7.9999999999999994e-40 < F

                                                                    1. Initial program 77.7%

                                                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                    2. Taylor expanded in F around inf

                                                                      \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                    3. Step-by-step derivation
                                                                      1. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                      2. lower-fma.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      3. lower-/.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      4. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      5. lower-cos.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      6. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      7. lower-sin.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      8. lower-/.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      9. lower-*.f64N/A

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      10. lower-sin.f6447.4

                                                                        \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                    4. Applied rewrites47.4%

                                                                      \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                                                                    5. Taylor expanded in B around 0

                                                                      \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{\color{blue}{B}} \]
                                                                    6. Step-by-step derivation
                                                                      1. lower-/.f64N/A

                                                                        \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                                      2. lower-*.f64N/A

                                                                        \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                                      3. lower-fma.f64N/A

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                      4. lower-/.f64N/A

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                      5. lower-/.f6428.0

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                    7. Applied rewrites28.0%

                                                                      \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{\color{blue}{B}} \]
                                                                    8. Taylor expanded in F around -inf

                                                                      \[\leadsto \frac{-1 \cdot \left(x - 1\right)}{B} \]
                                                                    9. Step-by-step derivation
                                                                      1. lower-*.f64N/A

                                                                        \[\leadsto \frac{-1 \cdot \left(x - 1\right)}{B} \]
                                                                      2. lower--.f6429.0

                                                                        \[\leadsto \frac{-1 \cdot \left(x - 1\right)}{B} \]
                                                                    10. Applied rewrites29.0%

                                                                      \[\leadsto \frac{-1 \cdot \left(x - 1\right)}{B} \]
                                                                  3. Recombined 3 regimes into one program.
                                                                  4. Add Preprocessing

                                                                  Alternative 23: 36.2% accurate, 6.6× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5.6 \cdot 10^{+34}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{elif}\;F \leq 8 \cdot 10^{-40}:\\ \;\;\;\;\frac{-1 \cdot x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 \cdot \left(x - 1\right)}{B}\\ \end{array} \end{array} \]
                                                                  (FPCore (F B x)
                                                                   :precision binary64
                                                                   (if (<= F -5.6e+34)
                                                                     (/ -1.0 B)
                                                                     (if (<= F 8e-40) (/ (* -1.0 x) B) (/ (* -1.0 (- x 1.0)) B))))
                                                                  double code(double F, double B, double x) {
                                                                  	double tmp;
                                                                  	if (F <= -5.6e+34) {
                                                                  		tmp = -1.0 / B;
                                                                  	} else if (F <= 8e-40) {
                                                                  		tmp = (-1.0 * x) / B;
                                                                  	} else {
                                                                  		tmp = (-1.0 * (x - 1.0)) / 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 <= (-5.6d+34)) then
                                                                          tmp = (-1.0d0) / b
                                                                      else if (f <= 8d-40) then
                                                                          tmp = ((-1.0d0) * x) / b
                                                                      else
                                                                          tmp = ((-1.0d0) * (x - 1.0d0)) / b
                                                                      end if
                                                                      code = tmp
                                                                  end function
                                                                  
                                                                  public static double code(double F, double B, double x) {
                                                                  	double tmp;
                                                                  	if (F <= -5.6e+34) {
                                                                  		tmp = -1.0 / B;
                                                                  	} else if (F <= 8e-40) {
                                                                  		tmp = (-1.0 * x) / B;
                                                                  	} else {
                                                                  		tmp = (-1.0 * (x - 1.0)) / B;
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  def code(F, B, x):
                                                                  	tmp = 0
                                                                  	if F <= -5.6e+34:
                                                                  		tmp = -1.0 / B
                                                                  	elif F <= 8e-40:
                                                                  		tmp = (-1.0 * x) / B
                                                                  	else:
                                                                  		tmp = (-1.0 * (x - 1.0)) / B
                                                                  	return tmp
                                                                  
                                                                  function code(F, B, x)
                                                                  	tmp = 0.0
                                                                  	if (F <= -5.6e+34)
                                                                  		tmp = Float64(-1.0 / B);
                                                                  	elseif (F <= 8e-40)
                                                                  		tmp = Float64(Float64(-1.0 * x) / B);
                                                                  	else
                                                                  		tmp = Float64(Float64(-1.0 * Float64(x - 1.0)) / B);
                                                                  	end
                                                                  	return tmp
                                                                  end
                                                                  
                                                                  function tmp_2 = code(F, B, x)
                                                                  	tmp = 0.0;
                                                                  	if (F <= -5.6e+34)
                                                                  		tmp = -1.0 / B;
                                                                  	elseif (F <= 8e-40)
                                                                  		tmp = (-1.0 * x) / B;
                                                                  	else
                                                                  		tmp = (-1.0 * (x - 1.0)) / B;
                                                                  	end
                                                                  	tmp_2 = tmp;
                                                                  end
                                                                  
                                                                  code[F_, B_, x_] := If[LessEqual[F, -5.6e+34], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 8e-40], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  \mathbf{if}\;F \leq -5.6 \cdot 10^{+34}:\\
                                                                  \;\;\;\;\frac{-1}{B}\\
                                                                  
                                                                  \mathbf{elif}\;F \leq 8 \cdot 10^{-40}:\\
                                                                  \;\;\;\;\frac{-1 \cdot x}{B}\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;\frac{-1 \cdot \left(x - 1\right)}{B}\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 3 regimes
                                                                  2. if F < -5.60000000000000016e34

                                                                    1. Initial program 77.7%

                                                                      \[\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 -5.60000000000000016e34 < F < 7.9999999999999994e-40

                                                                      1. Initial program 77.7%

                                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                      2. Taylor expanded in F around inf

                                                                        \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                      3. Step-by-step derivation
                                                                        1. lower-*.f64N/A

                                                                          \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                        2. lower-fma.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        3. lower-/.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        4. lower-*.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        5. lower-cos.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        6. lower-*.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        7. lower-sin.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        8. lower-/.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        9. lower-*.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        10. lower-sin.f6447.4

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      4. Applied rewrites47.4%

                                                                        \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                                                                      5. Taylor expanded in B around 0

                                                                        \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{\color{blue}{B}} \]
                                                                      6. Step-by-step derivation
                                                                        1. lower-/.f64N/A

                                                                          \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                                        2. lower-*.f64N/A

                                                                          \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                                        3. lower-fma.f64N/A

                                                                          \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                        4. lower-/.f64N/A

                                                                          \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                        5. lower-/.f6428.0

                                                                          \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                      7. Applied rewrites28.0%

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{\color{blue}{B}} \]
                                                                      8. Taylor expanded in x around inf

                                                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                      9. Step-by-step derivation
                                                                        1. lower-*.f6428.8

                                                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                      10. Applied rewrites28.8%

                                                                        \[\leadsto \frac{-1 \cdot x}{B} \]

                                                                      if 7.9999999999999994e-40 < F

                                                                      1. Initial program 77.7%

                                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                      2. Taylor expanded in F around inf

                                                                        \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                      3. Step-by-step derivation
                                                                        1. lower-*.f64N/A

                                                                          \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                        2. lower-fma.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        3. lower-/.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        4. lower-*.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        5. lower-cos.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        6. lower-*.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        7. lower-sin.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        8. lower-/.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        9. lower-*.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        10. lower-sin.f6447.4

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      4. Applied rewrites47.4%

                                                                        \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                                                                      5. Taylor expanded in B around 0

                                                                        \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{\color{blue}{B}} \]
                                                                      6. Step-by-step derivation
                                                                        1. lower-/.f64N/A

                                                                          \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                                        2. lower-*.f64N/A

                                                                          \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                                        3. lower-fma.f64N/A

                                                                          \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                        4. lower-/.f64N/A

                                                                          \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                        5. lower-/.f6428.0

                                                                          \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                      7. Applied rewrites28.0%

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{\color{blue}{B}} \]
                                                                      8. Taylor expanded in F around -inf

                                                                        \[\leadsto \frac{-1 \cdot \left(x - 1\right)}{B} \]
                                                                      9. Step-by-step derivation
                                                                        1. lower-*.f64N/A

                                                                          \[\leadsto \frac{-1 \cdot \left(x - 1\right)}{B} \]
                                                                        2. lower--.f6429.0

                                                                          \[\leadsto \frac{-1 \cdot \left(x - 1\right)}{B} \]
                                                                      10. Applied rewrites29.0%

                                                                        \[\leadsto \frac{-1 \cdot \left(x - 1\right)}{B} \]
                                                                    7. Recombined 3 regimes into one program.
                                                                    8. Add Preprocessing

                                                                    Alternative 24: 30.2% accurate, 7.8× speedup?

                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-1 \cdot x}{B}\\ \mathbf{if}\;x \leq -6 \cdot 10^{-154}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 5.6 \cdot 10^{-101}:\\ \;\;\;\;\frac{-1}{B}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                                    (FPCore (F B x)
                                                                     :precision binary64
                                                                     (let* ((t_0 (/ (* -1.0 x) B)))
                                                                       (if (<= x -6e-154) t_0 (if (<= x 5.6e-101) (/ -1.0 B) t_0))))
                                                                    double code(double F, double B, double x) {
                                                                    	double t_0 = (-1.0 * x) / B;
                                                                    	double tmp;
                                                                    	if (x <= -6e-154) {
                                                                    		tmp = t_0;
                                                                    	} else if (x <= 5.6e-101) {
                                                                    		tmp = -1.0 / B;
                                                                    	} else {
                                                                    		tmp = t_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) :: t_0
                                                                        real(8) :: tmp
                                                                        t_0 = ((-1.0d0) * x) / b
                                                                        if (x <= (-6d-154)) then
                                                                            tmp = t_0
                                                                        else if (x <= 5.6d-101) then
                                                                            tmp = (-1.0d0) / b
                                                                        else
                                                                            tmp = t_0
                                                                        end if
                                                                        code = tmp
                                                                    end function
                                                                    
                                                                    public static double code(double F, double B, double x) {
                                                                    	double t_0 = (-1.0 * x) / B;
                                                                    	double tmp;
                                                                    	if (x <= -6e-154) {
                                                                    		tmp = t_0;
                                                                    	} else if (x <= 5.6e-101) {
                                                                    		tmp = -1.0 / B;
                                                                    	} else {
                                                                    		tmp = t_0;
                                                                    	}
                                                                    	return tmp;
                                                                    }
                                                                    
                                                                    def code(F, B, x):
                                                                    	t_0 = (-1.0 * x) / B
                                                                    	tmp = 0
                                                                    	if x <= -6e-154:
                                                                    		tmp = t_0
                                                                    	elif x <= 5.6e-101:
                                                                    		tmp = -1.0 / B
                                                                    	else:
                                                                    		tmp = t_0
                                                                    	return tmp
                                                                    
                                                                    function code(F, B, x)
                                                                    	t_0 = Float64(Float64(-1.0 * x) / B)
                                                                    	tmp = 0.0
                                                                    	if (x <= -6e-154)
                                                                    		tmp = t_0;
                                                                    	elseif (x <= 5.6e-101)
                                                                    		tmp = Float64(-1.0 / B);
                                                                    	else
                                                                    		tmp = t_0;
                                                                    	end
                                                                    	return tmp
                                                                    end
                                                                    
                                                                    function tmp_2 = code(F, B, x)
                                                                    	t_0 = (-1.0 * x) / B;
                                                                    	tmp = 0.0;
                                                                    	if (x <= -6e-154)
                                                                    		tmp = t_0;
                                                                    	elseif (x <= 5.6e-101)
                                                                    		tmp = -1.0 / B;
                                                                    	else
                                                                    		tmp = t_0;
                                                                    	end
                                                                    	tmp_2 = tmp;
                                                                    end
                                                                    
                                                                    code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[x, -6e-154], t$95$0, If[LessEqual[x, 5.6e-101], N[(-1.0 / B), $MachinePrecision], t$95$0]]]
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    \begin{array}{l}
                                                                    t_0 := \frac{-1 \cdot x}{B}\\
                                                                    \mathbf{if}\;x \leq -6 \cdot 10^{-154}:\\
                                                                    \;\;\;\;t\_0\\
                                                                    
                                                                    \mathbf{elif}\;x \leq 5.6 \cdot 10^{-101}:\\
                                                                    \;\;\;\;\frac{-1}{B}\\
                                                                    
                                                                    \mathbf{else}:\\
                                                                    \;\;\;\;t\_0\\
                                                                    
                                                                    
                                                                    \end{array}
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Split input into 2 regimes
                                                                    2. if x < -6.0000000000000005e-154 or 5.59999999999999978e-101 < x

                                                                      1. Initial program 77.7%

                                                                        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                                      2. Taylor expanded in F around inf

                                                                        \[\leadsto \color{blue}{F \cdot \left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                      3. Step-by-step derivation
                                                                        1. lower-*.f64N/A

                                                                          \[\leadsto F \cdot \color{blue}{\left(-1 \cdot \frac{x \cdot \cos B}{F \cdot \sin B} + \frac{1}{F \cdot \sin B}\right)} \]
                                                                        2. lower-fma.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \color{blue}{\frac{x \cdot \cos B}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        3. lower-/.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F \cdot \sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        4. lower-*.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\color{blue}{F} \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        5. lower-cos.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        6. lower-*.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \color{blue}{\sin B}}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        7. lower-sin.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        8. lower-/.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        9. lower-*.f64N/A

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                        10. lower-sin.f6447.4

                                                                          \[\leadsto F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right) \]
                                                                      4. Applied rewrites47.4%

                                                                        \[\leadsto \color{blue}{F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{F \cdot \sin B}, \frac{1}{F \cdot \sin B}\right)} \]
                                                                      5. Taylor expanded in B around 0

                                                                        \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{\color{blue}{B}} \]
                                                                      6. Step-by-step derivation
                                                                        1. lower-/.f64N/A

                                                                          \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                                        2. lower-*.f64N/A

                                                                          \[\leadsto \frac{F \cdot \left(-1 \cdot \frac{x}{F} + \frac{1}{F}\right)}{B} \]
                                                                        3. lower-fma.f64N/A

                                                                          \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                        4. lower-/.f64N/A

                                                                          \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                        5. lower-/.f6428.0

                                                                          \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B} \]
                                                                      7. Applied rewrites28.0%

                                                                        \[\leadsto \frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{\color{blue}{B}} \]
                                                                      8. Taylor expanded in x around inf

                                                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                      9. Step-by-step derivation
                                                                        1. lower-*.f6428.8

                                                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                                                      10. Applied rewrites28.8%

                                                                        \[\leadsto \frac{-1 \cdot x}{B} \]

                                                                      if -6.0000000000000005e-154 < x < 5.59999999999999978e-101

                                                                      1. Initial program 77.7%

                                                                        \[\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} \]
                                                                      7. Recombined 2 regimes into one program.
                                                                      8. Add Preprocessing

                                                                      Alternative 25: 10.1% accurate, 26.5× speedup?

                                                                      \[\begin{array}{l} \\ \frac{-1}{B} \end{array} \]
                                                                      (FPCore (F B x) :precision binary64 (/ -1.0 B))
                                                                      double code(double F, double B, double x) {
                                                                      	return -1.0 / B;
                                                                      }
                                                                      
                                                                      module fmin_fmax_functions
                                                                          implicit none
                                                                          private
                                                                          public fmax
                                                                          public fmin
                                                                      
                                                                          interface fmax
                                                                              module procedure fmax88
                                                                              module procedure fmax44
                                                                              module procedure fmax84
                                                                              module procedure fmax48
                                                                          end interface
                                                                          interface fmin
                                                                              module procedure fmin88
                                                                              module procedure fmin44
                                                                              module procedure fmin84
                                                                              module procedure fmin48
                                                                          end interface
                                                                      contains
                                                                          real(8) function fmax88(x, y) result (res)
                                                                              real(8), intent (in) :: x
                                                                              real(8), intent (in) :: y
                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                          end function
                                                                          real(4) function fmax44(x, y) result (res)
                                                                              real(4), intent (in) :: x
                                                                              real(4), intent (in) :: y
                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmax84(x, y) result(res)
                                                                              real(8), intent (in) :: x
                                                                              real(4), intent (in) :: y
                                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmax48(x, y) result(res)
                                                                              real(4), intent (in) :: x
                                                                              real(8), intent (in) :: y
                                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmin88(x, y) result (res)
                                                                              real(8), intent (in) :: x
                                                                              real(8), intent (in) :: y
                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                          end function
                                                                          real(4) function fmin44(x, y) result (res)
                                                                              real(4), intent (in) :: x
                                                                              real(4), intent (in) :: y
                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmin84(x, y) result(res)
                                                                              real(8), intent (in) :: x
                                                                              real(4), intent (in) :: y
                                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                          end function
                                                                          real(8) function fmin48(x, y) result(res)
                                                                              real(4), intent (in) :: x
                                                                              real(8), intent (in) :: y
                                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                          end function
                                                                      end module
                                                                      
                                                                      real(8) function code(f, b, x)
                                                                      use fmin_fmax_functions
                                                                          real(8), intent (in) :: f
                                                                          real(8), intent (in) :: b
                                                                          real(8), intent (in) :: x
                                                                          code = (-1.0d0) / b
                                                                      end function
                                                                      
                                                                      public static double code(double F, double B, double x) {
                                                                      	return -1.0 / B;
                                                                      }
                                                                      
                                                                      def code(F, B, x):
                                                                      	return -1.0 / B
                                                                      
                                                                      function code(F, B, x)
                                                                      	return Float64(-1.0 / B)
                                                                      end
                                                                      
                                                                      function tmp = code(F, B, x)
                                                                      	tmp = -1.0 / B;
                                                                      end
                                                                      
                                                                      code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
                                                                      
                                                                      \begin{array}{l}
                                                                      
                                                                      \\
                                                                      \frac{-1}{B}
                                                                      \end{array}
                                                                      
                                                                      Derivation
                                                                      1. Initial program 77.7%

                                                                        \[\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 2025157 
                                                                        (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))))))