VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.9% → 99.7%
Time: 6.5s
Alternatives: 22
Speedup: 1.6×

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

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

Initial Program: 76.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := -\frac{x \cdot 1}{\tan B}\\
\mathbf{if}\;F \leq -3 \cdot 10^{+28}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 48000000:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\


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

    1. Initial program 56.6%

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
      2. lift-sin.f6499.7

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
    4. Applied rewrites99.7%

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

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

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

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

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

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

        \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{-1}{\sin B} \]
      7. lift-tan.f6499.8

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

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

    if -3.0000000000000001e28 < F < 4.8e7

    1. Initial program 99.4%

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

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

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

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

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

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

        \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      7. lift-tan.f6499.6

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

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

    if 4.8e7 < F

    1. Initial program 56.8%

      \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
      3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
    7. Step-by-step derivation
      1. Applied rewrites99.8%

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
    8. Recombined 3 regimes into one program.
    9. Add Preprocessing

    Alternative 2: 99.7% accurate, 1.0× speedup?

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

      1. Initial program 56.6%

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
        2. lift-sin.f6499.7

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
      4. Applied rewrites99.7%

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

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

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

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

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

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

          \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{-1}{\sin B} \]
        7. lift-tan.f6499.8

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

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

      if -3.0000000000000001e28 < F < 4.8e7

      1. Initial program 99.4%

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan 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. lift-/.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
        3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 4.8e7 < F

      1. Initial program 56.8%

        \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

          \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
        3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
      7. Step-by-step derivation
        1. Applied rewrites99.8%

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
      8. Recombined 3 regimes into one program.
      9. Add Preprocessing

      Alternative 3: 99.7% accurate, 1.3× speedup?

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

        1. Initial program 56.6%

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

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
          2. lift-sin.f6499.7

            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
        4. Applied rewrites99.7%

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

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

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

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

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

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

            \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{-1}{\sin B} \]
          7. lift-tan.f6499.8

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

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

        if -3.0000000000000001e28 < F < 5e12

        1. Initial program 99.4%

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

            \[\leadsto \left(-x \cdot \frac{1}{\tan 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. lift-/.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
          3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\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)} \]
        8. Step-by-step derivation
          1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 5e12 < F

        1. Initial program 56.3%

          \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

            \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
          3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
        7. Step-by-step derivation
          1. Applied rewrites99.8%

            \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
        8. Recombined 3 regimes into one program.
        9. Add Preprocessing

        Alternative 4: 91.1% accurate, 1.4× speedup?

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

          1. Initial program 56.6%

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
            2. lift-sin.f6499.7

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
          4. Applied rewrites99.7%

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

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

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

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

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

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

              \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{-1}{\sin B} \]
            7. lift-tan.f6499.8

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

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

          if -3.0000000000000001e28 < F < 70

          1. Initial program 99.4%

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan 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. lift-/.f64N/A

              \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
            3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 70 < F

            1. Initial program 57.5%

              \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
              3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
            8. Recombined 3 regimes into one program.
            9. Add Preprocessing

            Alternative 5: 91.1% accurate, 1.4× speedup?

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

              1. Initial program 56.6%

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                2. lift-sin.f6499.7

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
              4. Applied rewrites99.7%

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

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

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

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

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

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

                  \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{-1}{\sin B} \]
                7. lift-tan.f6499.8

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

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

              if -3.0000000000000001e28 < F < 70

              1. Initial program 99.4%

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan 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. lift-/.f64N/A

                  \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 70 < F

                1. Initial program 57.5%

                  \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                    \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                  3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
                8. Recombined 3 regimes into one program.
                9. Add Preprocessing

                Alternative 6: 84.8% accurate, 1.5× speedup?

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

                  1. Initial program 62.6%

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                    2. lift-sin.f6495.1

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

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

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

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

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

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

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

                      \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{-1}{\sin B} \]
                    7. lift-tan.f6495.2

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

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

                  if -4.4999999999999998e-29 < F < 1.20000000000000001e-27

                  1. Initial program 99.5%

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

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

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

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

                      \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
                    4. *-commutativeN/A

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

                      \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                    6. lower-cos.f64N/A

                      \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                    7. lift-sin.f6469.3

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

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

                  if 1.20000000000000001e-27 < F

                  1. Initial program 60.1%

                    \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                      \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                    3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{\color{blue}{1}}{\sin B} \]
                  8. Recombined 3 regimes into one program.
                  9. Add Preprocessing

                  Alternative 7: 84.7% accurate, 1.5× speedup?

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

                    1. Initial program 62.6%

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

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

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                      2. lift-sin.f6495.1

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

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

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

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

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

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

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

                        \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{-1}{\sin B} \]
                      7. lift-tan.f6495.2

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

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

                    if -4.4999999999999998e-29 < F < 1.20000000000000001e-27

                    1. Initial program 99.5%

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

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

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

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

                        \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
                      4. *-commutativeN/A

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

                        \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                      6. lower-cos.f64N/A

                        \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                      7. lift-sin.f6469.3

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

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

                    if 1.20000000000000001e-27 < F

                    1. Initial program 60.1%

                      \[\left(-x \cdot \frac{1}{\tan 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} - \frac{x \cdot \cos B}{\sin B}} \]
                    3. Step-by-step derivation
                      1. sub-divN/A

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

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

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

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

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

                        \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                      7. lift-sin.f6495.6

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

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

                  Alternative 8: 77.6% accurate, 1.5× speedup?

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

                    1. Initial program 28.9%

                      \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                      3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                    5. Step-by-step derivation
                      1. mul-1-negN/A

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

                        \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                      3. div-add-revN/A

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

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

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

                        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                      7. lower-cos.f64N/A

                        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                      8. lift-sin.f6499.8

                        \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                    6. Applied rewrites99.8%

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

                      \[\leadsto -\frac{1 + x}{\sin B} \]
                    8. Step-by-step derivation
                      1. Applied rewrites77.6%

                        \[\leadsto -\frac{1 + x}{\sin B} \]

                      if -1.4500000000000001e191 < F < -3.10000000000000026e-29

                      1. Initial program 81.8%

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

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

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                        2. lift-sin.f6492.3

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                      4. Applied rewrites92.3%

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                      5. Taylor expanded in B around 0

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
                      6. Step-by-step derivation
                        1. Applied rewrites67.3%

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]

                        if -3.10000000000000026e-29 < F < 1.20000000000000001e-27

                        1. Initial program 99.5%

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

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

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

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

                            \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
                          4. *-commutativeN/A

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

                            \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                          6. lower-cos.f64N/A

                            \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                          7. lift-sin.f6469.4

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

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

                        if 1.20000000000000001e-27 < F

                        1. Initial program 60.1%

                          \[\left(-x \cdot \frac{1}{\tan 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} - \frac{x \cdot \cos B}{\sin B}} \]
                        3. Step-by-step derivation
                          1. sub-divN/A

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

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

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

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

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

                            \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                          7. lift-sin.f6495.6

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

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

                      Alternative 9: 71.7% accurate, 1.6× speedup?

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

                        1. Initial program 28.9%

                          \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                            \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                          3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                        5. Step-by-step derivation
                          1. mul-1-negN/A

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

                            \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                          3. div-add-revN/A

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

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

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

                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                          7. lower-cos.f64N/A

                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                          8. lift-sin.f6499.8

                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                        6. Applied rewrites99.8%

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

                          \[\leadsto -\frac{1 + x}{\sin B} \]
                        8. Step-by-step derivation
                          1. Applied rewrites77.6%

                            \[\leadsto -\frac{1 + x}{\sin B} \]

                          if -1.4500000000000001e191 < F < -3.10000000000000026e-29

                          1. Initial program 81.8%

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

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

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\color{blue}{\sin B}} \]
                            2. lift-sin.f6492.3

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B} \]
                          4. Applied rewrites92.3%

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                          5. Taylor expanded in B around 0

                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
                          6. Step-by-step derivation
                            1. Applied rewrites67.3%

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]

                            if -3.10000000000000026e-29 < F < 5.19999999999999954e-4

                            1. Initial program 99.4%

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

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

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

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

                                \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
                              4. *-commutativeN/A

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

                                \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                              6. lower-cos.f64N/A

                                \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                              7. lift-sin.f6468.2

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

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

                            if 5.19999999999999954e-4 < F

                            1. Initial program 58.1%

                              \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                                \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                              3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{1 - x \cdot \cos B}{\sin B} \]
                              6. lift-sin.f6498.6

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

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

                              \[\leadsto \frac{1 - x}{\sin B} \]
                            8. Step-by-step derivation
                              1. Applied rewrites77.5%

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

                            Alternative 10: 84.7% accurate, 1.6× speedup?

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

                              1. Initial program 62.6%

                                \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                                3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                              5. Step-by-step derivation
                                1. mul-1-negN/A

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

                                  \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                                3. div-add-revN/A

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

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

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

                                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                7. lower-cos.f64N/A

                                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                8. lift-sin.f6495.1

                                  \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                              6. Applied rewrites95.1%

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{x \cdot \cos B + 1}{\mathsf{neg}\left(\color{blue}{\sin B}\right)} \]
                                10. *-commutativeN/A

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

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

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

                                  \[\leadsto \frac{\mathsf{fma}\left(\cos B, x, 1\right)}{-\sin B} \]
                                14. lift-sin.f6495.1

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

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

                              if -4.4999999999999998e-29 < F < 1.20000000000000001e-27

                              1. Initial program 99.5%

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

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

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

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

                                  \[\leadsto -\frac{x \cdot \cos B}{\sin B} \]
                                4. *-commutativeN/A

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

                                  \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                                6. lower-cos.f64N/A

                                  \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                                7. lift-sin.f6469.3

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

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

                              if 1.20000000000000001e-27 < F

                              1. Initial program 60.1%

                                \[\left(-x \cdot \frac{1}{\tan 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} - \frac{x \cdot \cos B}{\sin B}} \]
                              3. Step-by-step derivation
                                1. sub-divN/A

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

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

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

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

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

                                  \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                                7. lift-sin.f6495.6

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

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

                            Alternative 11: 55.6% accurate, 2.2× speedup?

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

                              1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                9. div-subN/A

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

                                  \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F}{B} - \color{blue}{\frac{x}{B}} \]
                              6. Applied rewrites55.8%

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

                              if 2.6999999999999998e-12 < B

                              1. Initial program 86.8%

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

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

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

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

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                              5. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \mathsf{fma}\left(B \cdot B, \frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}, 1\right)} \]
                                9. lower-*.f6454.8

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \mathsf{fma}\left(B \cdot B, 0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, 1\right)} \]
                              7. Applied rewrites54.8%

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

                            Alternative 12: 55.4% accurate, 2.4× speedup?

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

                              1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                9. div-subN/A

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

                                  \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F}{B} - \color{blue}{\frac{x}{B}} \]
                              6. Applied rewrites55.8%

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

                              if 2.6999999999999998e-12 < B

                              1. Initial program 86.8%

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

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

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

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

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                              5. Taylor expanded in B around 0

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

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

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

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

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \mathsf{fma}\left(\frac{-1}{6}, B \cdot B, 1\right)} \]
                                5. lower-*.f6454.0

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right)} \]
                              7. Applied rewrites54.0%

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

                            Alternative 13: 54.6% accurate, 2.5× speedup?

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

                              1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                9. div-subN/A

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

                                  \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F}{B} - \color{blue}{\frac{x}{B}} \]
                              6. Applied rewrites55.8%

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

                              if 2.6999999999999998e-12 < B

                              1. Initial program 86.8%

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

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

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

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

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                              5. Taylor expanded in B around 0

                                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
                              6. Step-by-step derivation
                                1. Applied rewrites51.0%

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
                              7. Recombined 2 regimes into one program.
                              8. Add Preprocessing

                              Alternative 14: 54.6% accurate, 2.6× speedup?

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

                                1. Initial program 73.4%

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                  5. pow2N/A

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

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

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

                                    \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \cdot F - x}{B} \]
                                  9. associate-+r+N/A

                                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                                  10. pow2N/A

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

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

                                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                  13. lift-fma.f6455.8

                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                                6. Applied rewrites55.8%

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

                                if 2.6999999999999998e-12 < B

                                1. Initial program 86.8%

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

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

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

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

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                                5. Taylor expanded in B around 0

                                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites51.0%

                                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B} \]
                                7. Recombined 2 regimes into one program.
                                8. Add Preprocessing

                                Alternative 15: 64.8% accurate, 2.9× speedup?

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

                                  1. Initial program 56.6%

                                    \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                                    3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                  5. Step-by-step derivation
                                    1. mul-1-negN/A

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

                                      \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                                    3. div-add-revN/A

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

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

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

                                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                    7. lower-cos.f64N/A

                                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                    8. lift-sin.f6499.7

                                      \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                  6. Applied rewrites99.7%

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

                                    \[\leadsto -\frac{1 + x}{\sin B} \]
                                  8. Step-by-step derivation
                                    1. Applied rewrites77.1%

                                      \[\leadsto -\frac{1 + x}{\sin B} \]

                                    if -3.0000000000000001e28 < F < 70

                                    1. Initial program 99.4%

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

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

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

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

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

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

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

                                        \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                      5. pow2N/A

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

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

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

                                        \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \cdot F - x}{B} \]
                                      9. associate-+r+N/A

                                        \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                                      10. pow2N/A

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

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

                                        \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                      13. lift-fma.f6450.1

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

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

                                    if 70 < F

                                    1. Initial program 57.5%

                                      \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                                        \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                                      3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \frac{1 - x \cdot \cos B}{\sin B} \]
                                      6. lift-sin.f6499.4

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

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

                                      \[\leadsto \frac{1 - x}{\sin B} \]
                                    8. Step-by-step derivation
                                      1. Applied rewrites78.3%

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

                                    Alternative 16: 57.9% accurate, 2.9× speedup?

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

                                      1. Initial program 41.3%

                                        \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                                          \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                                        3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                      5. Step-by-step derivation
                                        1. mul-1-negN/A

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

                                          \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                                        3. div-add-revN/A

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

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

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

                                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                        7. lower-cos.f64N/A

                                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                        8. lift-sin.f6499.8

                                          \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                      6. Applied rewrites99.8%

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

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

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

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

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

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

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

                                          \[\leadsto -\frac{\mathsf{fma}\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right), {B}^{2}, x\right) + 1}{B} \]
                                        7. fp-cancel-sub-sign-invN/A

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

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

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

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

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

                                          \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]
                                        13. lift-*.f6451.5

                                          \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]
                                      9. Applied rewrites51.5%

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

                                      if -1.40000000000000002e116 < F < 70

                                      1. Initial program 98.2%

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

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

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

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

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

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

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

                                          \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                        5. pow2N/A

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

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

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

                                          \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \cdot F - x}{B} \]
                                        9. associate-+r+N/A

                                          \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                                        10. pow2N/A

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

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

                                          \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                        13. lift-fma.f6449.6

                                          \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                                      6. Applied rewrites49.6%

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

                                      if 70 < F

                                      1. Initial program 57.5%

                                        \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                                          \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                                        3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{1 - x \cdot \cos B}{\sin B} \]
                                        6. lift-sin.f6499.4

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

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

                                        \[\leadsto \frac{1 - x}{\sin B} \]
                                      8. Step-by-step derivation
                                        1. Applied rewrites78.3%

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

                                      Alternative 17: 50.2% accurate, 3.0× speedup?

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

                                        1. Initial program 41.3%

                                          \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                                            \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                                          3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                        5. Step-by-step derivation
                                          1. mul-1-negN/A

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

                                            \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                                          3. div-add-revN/A

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

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

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

                                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                          7. lower-cos.f64N/A

                                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                          8. lift-sin.f6499.8

                                            \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                        6. Applied rewrites99.8%

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

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

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

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

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

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

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

                                            \[\leadsto -\frac{\mathsf{fma}\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right), {B}^{2}, x\right) + 1}{B} \]
                                          7. fp-cancel-sub-sign-invN/A

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

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

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

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

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

                                            \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]
                                          13. lift-*.f6451.5

                                            \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]
                                        9. Applied rewrites51.5%

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

                                        if -1.40000000000000002e116 < F < 8.2000000000000001e98

                                        1. Initial program 97.4%

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

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

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

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

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

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

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

                                            \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                          5. pow2N/A

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

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

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

                                            \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \cdot F - x}{B} \]
                                          9. associate-+r+N/A

                                            \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                                          10. pow2N/A

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

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

                                            \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                          13. lift-fma.f6449.6

                                            \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                                        6. Applied rewrites49.6%

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

                                        if 8.2000000000000001e98 < F

                                        1. Initial program 44.1%

                                          \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                                            \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                                          3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{1 - x \cdot \cos B}{\sin B} \]
                                          6. lift-sin.f6499.8

                                            \[\leadsto \frac{1 - x \cdot \cos B}{\sin B} \]
                                        6. Applied rewrites99.8%

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

                                          \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
                                        8. Step-by-step derivation
                                          1. Applied rewrites50.7%

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

                                        Alternative 18: 50.4% accurate, 5.7× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.4 \cdot 10^{+116}:\\ \;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\ \mathbf{elif}\;F \leq 70:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\frac{2}{B \cdot F}}{F}, -0.5, \frac{1 - x}{B}\right)\\ \end{array} \end{array} \]
                                        (FPCore (F B x)
                                         :precision binary64
                                         (if (<= F -1.4e+116)
                                           (-
                                            (/
                                             (+ (fma (fma -0.5 x (* 0.16666666666666666 (+ 1.0 x))) (* B B) x) 1.0)
                                             B))
                                           (if (<= F 70.0)
                                             (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                                             (fma (/ (/ 2.0 (* B F)) F) -0.5 (/ (- 1.0 x) B)))))
                                        double code(double F, double B, double x) {
                                        	double tmp;
                                        	if (F <= -1.4e+116) {
                                        		tmp = -((fma(fma(-0.5, x, (0.16666666666666666 * (1.0 + x))), (B * B), x) + 1.0) / B);
                                        	} else if (F <= 70.0) {
                                        		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
                                        	} else {
                                        		tmp = fma(((2.0 / (B * F)) / F), -0.5, ((1.0 - x) / B));
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(F, B, x)
                                        	tmp = 0.0
                                        	if (F <= -1.4e+116)
                                        		tmp = Float64(-Float64(Float64(fma(fma(-0.5, x, Float64(0.16666666666666666 * Float64(1.0 + x))), Float64(B * B), x) + 1.0) / B));
                                        	elseif (F <= 70.0)
                                        		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
                                        	else
                                        		tmp = fma(Float64(Float64(2.0 / Float64(B * F)) / F), -0.5, Float64(Float64(1.0 - x) / B));
                                        	end
                                        	return tmp
                                        end
                                        
                                        code[F_, B_, x_] := If[LessEqual[F, -1.4e+116], (-N[(N[(N[(N[(-0.5 * x + N[(0.16666666666666666 * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), If[LessEqual[F, 70.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(2.0 / N[(B * F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] * -0.5 + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;F \leq -1.4 \cdot 10^{+116}:\\
                                        \;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\
                                        
                                        \mathbf{elif}\;F \leq 70:\\
                                        \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\mathsf{fma}\left(\frac{\frac{2}{B \cdot F}}{F}, -0.5, \frac{1 - x}{B}\right)\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 3 regimes
                                        2. if F < -1.40000000000000002e116

                                          1. Initial program 41.3%

                                            \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                                            3. lift-sin.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                          5. Step-by-step derivation
                                            1. mul-1-negN/A

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

                                              \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                                            3. div-add-revN/A

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

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

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

                                              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                            7. lower-cos.f64N/A

                                              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                            8. lift-sin.f6499.8

                                              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                          6. Applied rewrites99.8%

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

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

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

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

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

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

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

                                              \[\leadsto -\frac{\mathsf{fma}\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right), {B}^{2}, x\right) + 1}{B} \]
                                            7. fp-cancel-sub-sign-invN/A

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

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

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

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

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

                                              \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]
                                            13. lift-*.f6451.5

                                              \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]
                                          9. Applied rewrites51.5%

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

                                          if -1.40000000000000002e116 < F < 70

                                          1. Initial program 98.2%

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

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

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

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

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

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

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

                                              \[\leadsto \frac{\sqrt{{\left(\left(2 \cdot x + F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B} \]
                                            5. pow2N/A

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

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

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

                                              \[\leadsto \frac{\sqrt{\frac{1}{\left(2 \cdot x + {F}^{2}\right) + 2}} \cdot F - x}{B} \]
                                            9. associate-+r+N/A

                                              \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \left({F}^{2} + 2\right)}} \cdot F - x}{B} \]
                                            10. pow2N/A

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

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

                                              \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + \mathsf{fma}\left(F, F, 2\right)}} \cdot F - x}{B} \]
                                            13. lift-fma.f6449.6

                                              \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B} \]
                                          6. Applied rewrites49.6%

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

                                          if 70 < F

                                          1. Initial program 57.5%

                                            \[\left(-x \cdot \frac{1}{\tan 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 \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                          3. Step-by-step derivation
                                            1. lower-/.f64N/A

                                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                          4. Applied rewrites37.4%

                                            \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                          5. Taylor expanded in F around 0

                                            \[\leadsto \frac{-1 \cdot x}{B} \]
                                          6. Step-by-step derivation
                                            1. mul-1-negN/A

                                              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                            2. lower-neg.f6425.5

                                              \[\leadsto \frac{-x}{B} \]
                                          7. Applied rewrites25.5%

                                            \[\leadsto \frac{-x}{B} \]
                                          8. Taylor expanded in F around inf

                                            \[\leadsto \left(\frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{B \cdot {F}^{2}} + \frac{1}{B}\right) - \color{blue}{\frac{x}{B}} \]
                                          9. Step-by-step derivation
                                            1. associate--l+N/A

                                              \[\leadsto \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{B \cdot {F}^{2}} + \left(\frac{1}{B} - \color{blue}{\frac{x}{B}}\right) \]
                                            2. *-commutativeN/A

                                              \[\leadsto \frac{2 + 2 \cdot x}{B \cdot {F}^{2}} \cdot \frac{-1}{2} + \left(\frac{1}{B} - \frac{\color{blue}{x}}{B}\right) \]
                                            3. +-commutativeN/A

                                              \[\leadsto \frac{2 \cdot x + 2}{B \cdot {F}^{2}} \cdot \frac{-1}{2} + \left(\frac{1}{B} - \frac{x}{B}\right) \]
                                            4. associate-/l/N/A

                                              \[\leadsto \frac{\frac{2 \cdot x + 2}{B}}{{F}^{2}} \cdot \frac{-1}{2} + \left(\frac{1}{B} - \frac{x}{B}\right) \]
                                            5. pow2N/A

                                              \[\leadsto \frac{\frac{2 \cdot x + 2}{B}}{F \cdot F} \cdot \frac{-1}{2} + \left(\frac{1}{B} - \frac{x}{B}\right) \]
                                            6. div-subN/A

                                              \[\leadsto \frac{\frac{2 \cdot x + 2}{B}}{F \cdot F} \cdot \frac{-1}{2} + \frac{1 - x}{B} \]
                                            7. lower-fma.f64N/A

                                              \[\leadsto \mathsf{fma}\left(\frac{\frac{2 \cdot x + 2}{B}}{F \cdot F}, \frac{-1}{2}, \frac{1 - x}{B}\right) \]
                                            8. associate-/r*N/A

                                              \[\leadsto \mathsf{fma}\left(\frac{\frac{\frac{2 \cdot x + 2}{B}}{F}}{F}, \frac{-1}{2}, \frac{1 - x}{B}\right) \]
                                            9. lower-/.f64N/A

                                              \[\leadsto \mathsf{fma}\left(\frac{\frac{\frac{2 \cdot x + 2}{B}}{F}}{F}, \frac{-1}{2}, \frac{1 - x}{B}\right) \]
                                            10. lower-/.f64N/A

                                              \[\leadsto \mathsf{fma}\left(\frac{\frac{\frac{2 \cdot x + 2}{B}}{F}}{F}, \frac{-1}{2}, \frac{1 - x}{B}\right) \]
                                            11. lift-fma.f64N/A

                                              \[\leadsto \mathsf{fma}\left(\frac{\frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{F}}{F}, \frac{-1}{2}, \frac{1 - x}{B}\right) \]
                                            12. lift-/.f64N/A

                                              \[\leadsto \mathsf{fma}\left(\frac{\frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{F}}{F}, \frac{-1}{2}, \frac{1 - x}{B}\right) \]
                                            13. lower-/.f64N/A

                                              \[\leadsto \mathsf{fma}\left(\frac{\frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{F}}{F}, \frac{-1}{2}, \frac{1 - x}{B}\right) \]
                                            14. lower--.f6450.9

                                              \[\leadsto \mathsf{fma}\left(\frac{\frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{F}}{F}, -0.5, \frac{1 - x}{B}\right) \]
                                          10. Applied rewrites50.9%

                                            \[\leadsto \mathsf{fma}\left(\frac{\frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{B}}{F}}{F}, \color{blue}{-0.5}, \frac{1 - x}{B}\right) \]
                                          11. Taylor expanded in x around 0

                                            \[\leadsto \mathsf{fma}\left(\frac{\frac{2}{B \cdot F}}{F}, \frac{-1}{2}, \frac{1 - x}{B}\right) \]
                                          12. Step-by-step derivation
                                            1. lower-/.f64N/A

                                              \[\leadsto \mathsf{fma}\left(\frac{\frac{2}{B \cdot F}}{F}, \frac{-1}{2}, \frac{1 - x}{B}\right) \]
                                            2. lower-*.f6451.0

                                              \[\leadsto \mathsf{fma}\left(\frac{\frac{2}{B \cdot F}}{F}, -0.5, \frac{1 - x}{B}\right) \]
                                          13. Applied rewrites51.0%

                                            \[\leadsto \mathsf{fma}\left(\frac{\frac{2}{B \cdot F}}{F}, -0.5, \frac{1 - x}{B}\right) \]
                                        3. Recombined 3 regimes into one program.
                                        4. Add Preprocessing

                                        Alternative 19: 43.2% accurate, 7.7× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -6.6 \cdot 10^{-29}:\\ \;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\ \mathbf{elif}\;F \leq 1.2 \cdot 10^{-27}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                        (FPCore (F B x)
                                         :precision binary64
                                         (if (<= F -6.6e-29)
                                           (-
                                            (/
                                             (+ (fma (fma -0.5 x (* 0.16666666666666666 (+ 1.0 x))) (* B B) x) 1.0)
                                             B))
                                           (if (<= F 1.2e-27) (/ (- x) B) (/ (- 1.0 x) B))))
                                        double code(double F, double B, double x) {
                                        	double tmp;
                                        	if (F <= -6.6e-29) {
                                        		tmp = -((fma(fma(-0.5, x, (0.16666666666666666 * (1.0 + x))), (B * B), x) + 1.0) / B);
                                        	} else if (F <= 1.2e-27) {
                                        		tmp = -x / B;
                                        	} else {
                                        		tmp = (1.0 - x) / B;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(F, B, x)
                                        	tmp = 0.0
                                        	if (F <= -6.6e-29)
                                        		tmp = Float64(-Float64(Float64(fma(fma(-0.5, x, Float64(0.16666666666666666 * Float64(1.0 + x))), Float64(B * B), x) + 1.0) / B));
                                        	elseif (F <= 1.2e-27)
                                        		tmp = Float64(Float64(-x) / B);
                                        	else
                                        		tmp = Float64(Float64(1.0 - x) / B);
                                        	end
                                        	return tmp
                                        end
                                        
                                        code[F_, B_, x_] := If[LessEqual[F, -6.6e-29], (-N[(N[(N[(N[(-0.5 * x + N[(0.16666666666666666 * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), If[LessEqual[F, 1.2e-27], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;F \leq -6.6 \cdot 10^{-29}:\\
                                        \;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\
                                        
                                        \mathbf{elif}\;F \leq 1.2 \cdot 10^{-27}:\\
                                        \;\;\;\;\frac{-x}{B}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{1 - x}{B}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 3 regimes
                                        2. if F < -6.60000000000000055e-29

                                          1. Initial program 62.6%

                                            \[\left(-x \cdot \frac{1}{\tan 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}{\tan 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. lift-/.f64N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan 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)} \]
                                            3. lift-sin.f64N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\color{blue}{\sin B}} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            4. lift-pow.f64N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}} \]
                                            5. lift-+.f64N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\color{blue}{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}}^{\left(-\frac{1}{2}\right)} \]
                                            6. lift-+.f64N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            7. lift-*.f64N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(\color{blue}{F \cdot F} + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            8. lift-*.f64N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + \color{blue}{2 \cdot x}\right)}^{\left(-\frac{1}{2}\right)} \]
                                            9. lift-neg.f64N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\color{blue}{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}} \]
                                            10. lift-/.f64N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}}\right)\right)} \]
                                            11. *-commutativeN/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B}} \]
                                            12. lower-*.f64N/A

                                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot \frac{F}{\sin B}} \]
                                          3. Applied rewrites62.6%

                                            \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B}} \]
                                          4. Taylor expanded in F around -inf

                                            \[\leadsto \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
                                          5. Step-by-step derivation
                                            1. mul-1-negN/A

                                              \[\leadsto \mathsf{neg}\left(\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)\right) \]
                                            2. lower-neg.f64N/A

                                              \[\leadsto -\left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right) \]
                                            3. div-add-revN/A

                                              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                            4. lower-/.f64N/A

                                              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                            5. lower-+.f64N/A

                                              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                            6. lower-*.f64N/A

                                              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                            7. lower-cos.f64N/A

                                              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                            8. lift-sin.f6495.2

                                              \[\leadsto -\frac{1 + x \cdot \cos B}{\sin B} \]
                                          6. Applied rewrites95.2%

                                            \[\leadsto \color{blue}{-\frac{1 + x \cdot \cos B}{\sin B}} \]
                                          7. Taylor expanded in B around 0

                                            \[\leadsto -\frac{1 + \left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right)}{B} \]
                                          8. Step-by-step derivation
                                            1. lower-/.f64N/A

                                              \[\leadsto -\frac{1 + \left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right)}{B} \]
                                            2. +-commutativeN/A

                                              \[\leadsto -\frac{\left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right) + 1}{B} \]
                                            3. lower-+.f64N/A

                                              \[\leadsto -\frac{\left(x + {B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right)\right) + 1}{B} \]
                                            4. +-commutativeN/A

                                              \[\leadsto -\frac{\left({B}^{2} \cdot \left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right) + x\right) + 1}{B} \]
                                            5. *-commutativeN/A

                                              \[\leadsto -\frac{\left(\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right)\right) \cdot {B}^{2} + x\right) + 1}{B} \]
                                            6. lower-fma.f64N/A

                                              \[\leadsto -\frac{\mathsf{fma}\left(\frac{-1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 + x\right), {B}^{2}, x\right) + 1}{B} \]
                                            7. fp-cancel-sub-sign-invN/A

                                              \[\leadsto -\frac{\mathsf{fma}\left(\frac{-1}{2} \cdot x + \left(\mathsf{neg}\left(\frac{-1}{6}\right)\right) \cdot \left(1 + x\right), {B}^{2}, x\right) + 1}{B} \]
                                            8. lower-fma.f64N/A

                                              \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \left(\mathsf{neg}\left(\frac{-1}{6}\right)\right) \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                                            9. metadata-evalN/A

                                              \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                                            10. lower-*.f64N/A

                                              \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                                            11. lift-+.f64N/A

                                              \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), {B}^{2}, x\right) + 1}{B} \]
                                            12. pow2N/A

                                              \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{2}, x, \frac{1}{6} \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]
                                            13. lift-*.f6447.5

                                              \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]
                                          9. Applied rewrites47.5%

                                            \[\leadsto -\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B} \]

                                          if -6.60000000000000055e-29 < F < 1.20000000000000001e-27

                                          1. Initial program 99.5%

                                            \[\left(-x \cdot \frac{1}{\tan 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 \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                          3. Step-by-step derivation
                                            1. lower-/.f64N/A

                                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                          4. Applied rewrites50.6%

                                            \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                          5. Taylor expanded in F around 0

                                            \[\leadsto \frac{-1 \cdot x}{B} \]
                                          6. Step-by-step derivation
                                            1. mul-1-negN/A

                                              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                            2. lower-neg.f6435.9

                                              \[\leadsto \frac{-x}{B} \]
                                          7. Applied rewrites35.9%

                                            \[\leadsto \frac{-x}{B} \]

                                          if 1.20000000000000001e-27 < F

                                          1. Initial program 60.1%

                                            \[\left(-x \cdot \frac{1}{\tan 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 \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                          3. Step-by-step derivation
                                            1. lower-/.f64N/A

                                              \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                          4. Applied rewrites37.9%

                                            \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                          5. Taylor expanded in F around inf

                                            \[\leadsto \frac{1 - x}{B} \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites48.9%

                                              \[\leadsto \frac{1 - x}{B} \]
                                          7. Recombined 3 regimes into one program.
                                          8. Add Preprocessing

                                          Alternative 20: 43.2% accurate, 13.6× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.1 \cdot 10^{-29}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 1.75 \cdot 10^{-5}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                          (FPCore (F B x)
                                           :precision binary64
                                           (if (<= F -3.1e-29)
                                             (/ (- -1.0 x) B)
                                             (if (<= F 1.75e-5) (/ (- x) B) (/ (- 1.0 x) B))))
                                          double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= -3.1e-29) {
                                          		tmp = (-1.0 - x) / B;
                                          	} else if (F <= 1.75e-5) {
                                          		tmp = -x / B;
                                          	} else {
                                          		tmp = (1.0 - x) / B;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          module fmin_fmax_functions
                                              implicit none
                                              private
                                              public fmax
                                              public fmin
                                          
                                              interface fmax
                                                  module procedure fmax88
                                                  module procedure fmax44
                                                  module procedure fmax84
                                                  module procedure fmax48
                                              end interface
                                              interface fmin
                                                  module procedure fmin88
                                                  module procedure fmin44
                                                  module procedure fmin84
                                                  module procedure fmin48
                                              end interface
                                          contains
                                              real(8) function fmax88(x, y) result (res)
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                              end function
                                              real(4) function fmax44(x, y) result (res)
                                                  real(4), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                              end function
                                              real(8) function fmax84(x, y) result(res)
                                                  real(8), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                              end function
                                              real(8) function fmax48(x, y) result(res)
                                                  real(4), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                              end function
                                              real(8) function fmin88(x, y) result (res)
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                              end function
                                              real(4) function fmin44(x, y) result (res)
                                                  real(4), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                              end function
                                              real(8) function fmin84(x, y) result(res)
                                                  real(8), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                              end function
                                              real(8) function fmin48(x, y) result(res)
                                                  real(4), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                              end function
                                          end module
                                          
                                          real(8) function code(f, b, x)
                                          use fmin_fmax_functions
                                              real(8), intent (in) :: f
                                              real(8), intent (in) :: b
                                              real(8), intent (in) :: x
                                              real(8) :: tmp
                                              if (f <= (-3.1d-29)) then
                                                  tmp = ((-1.0d0) - x) / b
                                              else if (f <= 1.75d-5) then
                                                  tmp = -x / b
                                              else
                                                  tmp = (1.0d0 - x) / b
                                              end if
                                              code = tmp
                                          end function
                                          
                                          public static double code(double F, double B, double x) {
                                          	double tmp;
                                          	if (F <= -3.1e-29) {
                                          		tmp = (-1.0 - x) / B;
                                          	} else if (F <= 1.75e-5) {
                                          		tmp = -x / B;
                                          	} else {
                                          		tmp = (1.0 - x) / B;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(F, B, x):
                                          	tmp = 0
                                          	if F <= -3.1e-29:
                                          		tmp = (-1.0 - x) / B
                                          	elif F <= 1.75e-5:
                                          		tmp = -x / B
                                          	else:
                                          		tmp = (1.0 - x) / B
                                          	return tmp
                                          
                                          function code(F, B, x)
                                          	tmp = 0.0
                                          	if (F <= -3.1e-29)
                                          		tmp = Float64(Float64(-1.0 - x) / B);
                                          	elseif (F <= 1.75e-5)
                                          		tmp = Float64(Float64(-x) / B);
                                          	else
                                          		tmp = Float64(Float64(1.0 - x) / B);
                                          	end
                                          	return tmp
                                          end
                                          
                                          function tmp_2 = code(F, B, x)
                                          	tmp = 0.0;
                                          	if (F <= -3.1e-29)
                                          		tmp = (-1.0 - x) / B;
                                          	elseif (F <= 1.75e-5)
                                          		tmp = -x / B;
                                          	else
                                          		tmp = (1.0 - x) / B;
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[F_, B_, x_] := If[LessEqual[F, -3.1e-29], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.75e-5], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;F \leq -3.1 \cdot 10^{-29}:\\
                                          \;\;\;\;\frac{-1 - x}{B}\\
                                          
                                          \mathbf{elif}\;F \leq 1.75 \cdot 10^{-5}:\\
                                          \;\;\;\;\frac{-x}{B}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\frac{1 - x}{B}\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if F < -3.10000000000000026e-29

                                            1. Initial program 62.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 \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                            3. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                            4. Applied rewrites36.8%

                                              \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                            5. Taylor expanded in F around -inf

                                              \[\leadsto \frac{-1 - x}{B} \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites47.4%

                                                \[\leadsto \frac{-1 - x}{B} \]

                                              if -3.10000000000000026e-29 < F < 1.7499999999999998e-5

                                              1. Initial program 99.4%

                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              2. Taylor expanded in B around 0

                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                              4. Applied rewrites50.4%

                                                \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                              5. Taylor expanded in F around 0

                                                \[\leadsto \frac{-1 \cdot x}{B} \]
                                              6. Step-by-step derivation
                                                1. mul-1-negN/A

                                                  \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                2. lower-neg.f6435.4

                                                  \[\leadsto \frac{-x}{B} \]
                                              7. Applied rewrites35.4%

                                                \[\leadsto \frac{-x}{B} \]

                                              if 1.7499999999999998e-5 < F

                                              1. Initial program 58.2%

                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              2. Taylor expanded in B around 0

                                                \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                              3. Step-by-step derivation
                                                1. lower-/.f64N/A

                                                  \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                              4. Applied rewrites37.5%

                                                \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                              5. Taylor expanded in F around inf

                                                \[\leadsto \frac{1 - x}{B} \]
                                              6. Step-by-step derivation
                                                1. Applied rewrites50.2%

                                                  \[\leadsto \frac{1 - x}{B} \]
                                              7. Recombined 3 regimes into one program.
                                              8. Add Preprocessing

                                              Alternative 21: 36.1% accurate, 17.5× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.1 \cdot 10^{-29}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                              (FPCore (F B x)
                                               :precision binary64
                                               (if (<= F -3.1e-29) (/ (- -1.0 x) B) (/ (- x) B)))
                                              double code(double F, double B, double x) {
                                              	double tmp;
                                              	if (F <= -3.1e-29) {
                                              		tmp = (-1.0 - x) / B;
                                              	} else {
                                              		tmp = -x / B;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              module fmin_fmax_functions
                                                  implicit none
                                                  private
                                                  public fmax
                                                  public fmin
                                              
                                                  interface fmax
                                                      module procedure fmax88
                                                      module procedure fmax44
                                                      module procedure fmax84
                                                      module procedure fmax48
                                                  end interface
                                                  interface fmin
                                                      module procedure fmin88
                                                      module procedure fmin44
                                                      module procedure fmin84
                                                      module procedure fmin48
                                                  end interface
                                              contains
                                                  real(8) function fmax88(x, y) result (res)
                                                      real(8), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                  end function
                                                  real(4) function fmax44(x, y) result (res)
                                                      real(4), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmax84(x, y) result(res)
                                                      real(8), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmax48(x, y) result(res)
                                                      real(4), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin88(x, y) result (res)
                                                      real(8), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                  end function
                                                  real(4) function fmin44(x, y) result (res)
                                                      real(4), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin84(x, y) result(res)
                                                      real(8), intent (in) :: x
                                                      real(4), intent (in) :: y
                                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                  end function
                                                  real(8) function fmin48(x, y) result(res)
                                                      real(4), intent (in) :: x
                                                      real(8), intent (in) :: y
                                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                  end function
                                              end module
                                              
                                              real(8) function code(f, b, x)
                                              use fmin_fmax_functions
                                                  real(8), intent (in) :: f
                                                  real(8), intent (in) :: b
                                                  real(8), intent (in) :: x
                                                  real(8) :: tmp
                                                  if (f <= (-3.1d-29)) then
                                                      tmp = ((-1.0d0) - x) / b
                                                  else
                                                      tmp = -x / b
                                                  end if
                                                  code = tmp
                                              end function
                                              
                                              public static double code(double F, double B, double x) {
                                              	double tmp;
                                              	if (F <= -3.1e-29) {
                                              		tmp = (-1.0 - x) / B;
                                              	} else {
                                              		tmp = -x / B;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              def code(F, B, x):
                                              	tmp = 0
                                              	if F <= -3.1e-29:
                                              		tmp = (-1.0 - x) / B
                                              	else:
                                              		tmp = -x / B
                                              	return tmp
                                              
                                              function code(F, B, x)
                                              	tmp = 0.0
                                              	if (F <= -3.1e-29)
                                              		tmp = Float64(Float64(-1.0 - x) / B);
                                              	else
                                              		tmp = Float64(Float64(-x) / B);
                                              	end
                                              	return tmp
                                              end
                                              
                                              function tmp_2 = code(F, B, x)
                                              	tmp = 0.0;
                                              	if (F <= -3.1e-29)
                                              		tmp = (-1.0 - x) / B;
                                              	else
                                              		tmp = -x / B;
                                              	end
                                              	tmp_2 = tmp;
                                              end
                                              
                                              code[F_, B_, x_] := If[LessEqual[F, -3.1e-29], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;F \leq -3.1 \cdot 10^{-29}:\\
                                              \;\;\;\;\frac{-1 - x}{B}\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\frac{-x}{B}\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if F < -3.10000000000000026e-29

                                                1. Initial program 62.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 \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                3. Step-by-step derivation
                                                  1. lower-/.f64N/A

                                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                4. Applied rewrites36.8%

                                                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                                5. Taylor expanded in F around -inf

                                                  \[\leadsto \frac{-1 - x}{B} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites47.4%

                                                    \[\leadsto \frac{-1 - x}{B} \]

                                                  if -3.10000000000000026e-29 < F

                                                  1. Initial program 82.9%

                                                    \[\left(-x \cdot \frac{1}{\tan 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 \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                  3. Step-by-step derivation
                                                    1. lower-/.f64N/A

                                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                  4. Applied rewrites45.3%

                                                    \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                                  5. Taylor expanded in F around 0

                                                    \[\leadsto \frac{-1 \cdot x}{B} \]
                                                  6. Step-by-step derivation
                                                    1. mul-1-negN/A

                                                      \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                    2. lower-neg.f6431.3

                                                      \[\leadsto \frac{-x}{B} \]
                                                  7. Applied rewrites31.3%

                                                    \[\leadsto \frac{-x}{B} \]
                                                7. Recombined 2 regimes into one program.
                                                8. Add Preprocessing

                                                Alternative 22: 28.9% accurate, 26.3× speedup?

                                                \[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
                                                (FPCore (F B x) :precision binary64 (/ (- x) B))
                                                double code(double F, double B, double x) {
                                                	return -x / 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 = -x / b
                                                end function
                                                
                                                public static double code(double F, double B, double x) {
                                                	return -x / B;
                                                }
                                                
                                                def code(F, B, x):
                                                	return -x / B
                                                
                                                function code(F, B, x)
                                                	return Float64(Float64(-x) / B)
                                                end
                                                
                                                function tmp = code(F, B, x)
                                                	tmp = -x / B;
                                                end
                                                
                                                code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \frac{-x}{B}
                                                \end{array}
                                                
                                                Derivation
                                                1. Initial program 76.9%

                                                  \[\left(-x \cdot \frac{1}{\tan 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 \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                3. Step-by-step derivation
                                                  1. lower-/.f64N/A

                                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                4. Applied rewrites42.8%

                                                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                                5. Taylor expanded in F around 0

                                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                                6. Step-by-step derivation
                                                  1. mul-1-negN/A

                                                    \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                  2. lower-neg.f6428.9

                                                    \[\leadsto \frac{-x}{B} \]
                                                7. Applied rewrites28.9%

                                                  \[\leadsto \frac{-x}{B} \]
                                                8. Add Preprocessing

                                                Reproduce

                                                ?
                                                herbie shell --seed 2025101 
                                                (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))))))