VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.8% → 99.4%
Time: 6.9s
Alternatives: 26
Speedup: 2.1×

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 26 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.8% 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.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -\frac{x \cdot 1}{\tan B}\\ \mathbf{if}\;F \leq -1.32 \cdot 10^{+19}:\\ \;\;\;\;t\_0 + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{+66}:\\ \;\;\;\;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}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (/ (* x 1.0) (tan B)))))
   (if (<= F -1.32e+19)
     (+ t_0 (/ -1.0 (sin B)))
     (if (<= F 1.65e+66)
       (+
        t_0
        (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
       (/ (- 1.0 (* (cos B) x)) (sin B))))))
double code(double F, double B, double x) {
	double t_0 = -((x * 1.0) / tan(B));
	double tmp;
	if (F <= -1.32e+19) {
		tmp = t_0 + (-1.0 / sin(B));
	} else if (F <= 1.65e+66) {
		tmp = t_0 + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = (1.0 - (cos(B) * 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) :: t_0
    real(8) :: tmp
    t_0 = -((x * 1.0d0) / tan(b))
    if (f <= (-1.32d+19)) then
        tmp = t_0 + ((-1.0d0) / sin(b))
    else if (f <= 1.65d+66) then
        tmp = t_0 + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
    else
        tmp = (1.0d0 - (cos(b) * x)) / 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 <= -1.32e+19) {
		tmp = t_0 + (-1.0 / Math.sin(B));
	} else if (F <= 1.65e+66) {
		tmp = t_0 + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = (1.0 - (Math.cos(B) * x)) / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -((x * 1.0) / math.tan(B))
	tmp = 0
	if F <= -1.32e+19:
		tmp = t_0 + (-1.0 / math.sin(B))
	elif F <= 1.65e+66:
		tmp = t_0 + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
	else:
		tmp = (1.0 - (math.cos(B) * x)) / 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 <= -1.32e+19)
		tmp = Float64(t_0 + Float64(-1.0 / sin(B)));
	elseif (F <= 1.65e+66)
		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(Float64(1.0 - Float64(cos(B) * x)) / 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 <= -1.32e+19)
		tmp = t_0 + (-1.0 / sin(B));
	elseif (F <= 1.65e+66)
		tmp = t_0 + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
	else
		tmp = (1.0 - (cos(B) * x)) / 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, -1.32e+19], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.65e+66], 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[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;F \leq 1.65 \cdot 10^{+66}:\\
\;\;\;\;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}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\


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

    1. Initial program 56.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. Add Preprocessing
    3. Taylor expanded in F around -inf

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. 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} \]
    5. Applied rewrites99.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. 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} \]
    7. Applied rewrites99.8%

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

    if -1.32e19 < F < 1.6500000000000001e66

    1. Initial program 98.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. Add Preprocessing
    3. 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.0

        \[\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)} \]
    4. Applied rewrites99.0%

      \[\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 1.6500000000000001e66 < F

    1. Initial program 49.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. Add Preprocessing
    3. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
    4. 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.f6499.8

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

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

Alternative 2: 99.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.32 \cdot 10^{+19}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{+66}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -1.32e+19)
   (+ (- (/ (* x 1.0) (tan B))) (/ -1.0 (sin B)))
   (if (<= F 1.65e+66)
     (+
      (- (* x (/ 1.0 (tan B))))
      (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
     (/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.32e+19) {
		tmp = -((x * 1.0) / tan(B)) + (-1.0 / sin(B));
	} else if (F <= 1.65e+66) {
		tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = (1.0 - (cos(B) * 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.32d+19)) then
        tmp = -((x * 1.0d0) / tan(b)) + ((-1.0d0) / sin(b))
    else if (f <= 1.65d+66) then
        tmp = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
    else
        tmp = (1.0d0 - (cos(b) * x)) / sin(b)
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -1.32e+19) {
		tmp = -((x * 1.0) / Math.tan(B)) + (-1.0 / Math.sin(B));
	} else if (F <= 1.65e+66) {
		tmp = -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = (1.0 - (Math.cos(B) * x)) / Math.sin(B);
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -1.32e+19:
		tmp = -((x * 1.0) / math.tan(B)) + (-1.0 / math.sin(B))
	elif F <= 1.65e+66:
		tmp = -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
	else:
		tmp = (1.0 - (math.cos(B) * x)) / math.sin(B)
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -1.32e+19)
		tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(-1.0 / sin(B)));
	elseif (F <= 1.65e+66)
		tmp = 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)))));
	else
		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -1.32e+19)
		tmp = -((x * 1.0) / tan(B)) + (-1.0 / sin(B));
	elseif (F <= 1.65e+66)
		tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
	else
		tmp = (1.0 - (cos(B) * x)) / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -1.32e+19], 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.65e+66], 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], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.32 \cdot 10^{+19}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 1.65 \cdot 10^{+66}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\

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


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

    1. Initial program 56.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. Add Preprocessing
    3. Taylor expanded in F around -inf

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. 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} \]
    5. Applied rewrites99.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. 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} \]
    7. Applied rewrites99.8%

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

    if -1.32e19 < F < 1.6500000000000001e66

    1. Initial program 98.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. Add Preprocessing

    if 1.6500000000000001e66 < F

    1. Initial program 49.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. Add Preprocessing
    3. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
    4. 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.f6499.8

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

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

Alternative 3: 99.6% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{+35}:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.65 \cdot 10^{+66}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -5e+35)
   (+ (- (/ (* x 1.0) (tan B))) (/ -1.0 (sin B)))
   (if (<= F 1.65e+66)
     (+
      (- (* x (/ 1.0 (tan B))))
      (/ F (* (sqrt (fma 2.0 x (fma F F 2.0))) (sin B))))
     (/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -5e+35) {
		tmp = -((x * 1.0) / tan(B)) + (-1.0 / sin(B));
	} else if (F <= 1.65e+66) {
		tmp = -(x * (1.0 / tan(B))) + (F / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B)));
	} else {
		tmp = (1.0 - (cos(B) * x)) / sin(B);
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -5e+35)
		tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(-1.0 / sin(B)));
	elseif (F <= 1.65e+66)
		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(F / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))));
	else
		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -5e+35], 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.65e+66], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(F / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+35}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 1.65 \cdot 10^{+66}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B}\\

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


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

    1. Initial program 55.0%

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. 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} \]
    5. Applied rewrites99.7%

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. 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} \]
    7. Applied rewrites99.8%

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

    if -5.00000000000000021e35 < F < 1.6500000000000001e66

    1. Initial program 98.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. Add Preprocessing
    3. 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}} \]
    4. Applied rewrites99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6500000000000001e66 < F

    1. Initial program 49.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. Add Preprocessing
    3. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
    4. 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.f6499.8

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

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

Alternative 4: 91.9% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;F \leq 1.6 \cdot 10^{-153}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{\frac{F}{\sqrt{t\_0}}}{B}\\

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

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


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

    1. Initial program 58.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. Add Preprocessing
    3. Taylor expanded in F around -inf

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    4. 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.6

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    6. 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.7

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

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

    if -2e5 < F < 1.6e-153

    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. Add Preprocessing
    3. 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}} \]
    4. 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}} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
    10. Step-by-step derivation
      1. Applied rewrites85.0%

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

      if 1.6e-153 < F < 3.8e7

      1. Initial program 99.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. Add Preprocessing
      3. 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}} \]
      4. Applied rewrites99.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}} \]
      5. Taylor expanded in B around 0

        \[\leadsto \left(-\color{blue}{\frac{x}{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. Step-by-step derivation
        1. lower-/.f6475.5

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

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

      if 3.8e7 < F

      1. Initial program 56.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. Add Preprocessing
      3. Taylor expanded in F around inf

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      4. 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.f6499.8

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

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

    Alternative 5: 91.6% accurate, 1.5× speedup?

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

      1. Initial program 58.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. Add Preprocessing
      3. Taylor expanded in F around -inf

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
      4. 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.6

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
      6. 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.7

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

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

      if -2e5 < F < 3.3999999999999999e-173

      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. Add Preprocessing
      3. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
        10. lift-*.f6485.0

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
      5. Applied rewrites85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 3.3999999999999999e-173 < F < 3.8e7

      1. Initial program 99.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. Add Preprocessing
      3. 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}} \]
      4. Applied rewrites99.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}} \]
      5. Step-by-step derivation
        1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{\frac{F \cdot 1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} \]
      10. Step-by-step derivation
        1. lower-/.f6474.2

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

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

      if 3.8e7 < F

      1. Initial program 56.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. Add Preprocessing
      3. Taylor expanded in F around inf

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      4. 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.f6499.8

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

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

    Alternative 6: 91.6% accurate, 1.5× speedup?

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

      1. Initial program 58.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. Add Preprocessing
      3. 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}} \]
      4. Applied rewrites73.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -2e5 < F < 3.3999999999999999e-173

      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. Add Preprocessing
      3. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
        10. lift-*.f6485.0

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \]
      5. Applied rewrites85.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 3.3999999999999999e-173 < F < 3.8e7

      1. Initial program 99.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. Add Preprocessing
      3. 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}} \]
      4. Applied rewrites99.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}} \]
      5. Step-by-step derivation
        1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{\frac{F \cdot 1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} \]
      10. Step-by-step derivation
        1. lower-/.f6474.2

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

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

      if 3.8e7 < F

      1. Initial program 56.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. Add Preprocessing
      3. Taylor expanded in F around inf

        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
      4. 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.f6499.8

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

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

    Alternative 7: 85.7% accurate, 1.5× speedup?

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

      1. Initial program 56.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. Add Preprocessing
      3. 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}} \]
      4. Applied rewrites72.2%

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

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

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

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

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

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

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

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

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

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

        if -8.49999999999999979e22 < F < 3.3999999999999999e-173

        1. Initial program 99.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. Add Preprocessing
        3. 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}} \]
        4. 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}} \]
        5. Step-by-step derivation
          1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
        10. Step-by-step derivation
          1. Applied rewrites84.5%

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

          if 3.3999999999999999e-173 < F < 3.8e7

          1. Initial program 99.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. Add Preprocessing
          3. 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}} \]
          4. Applied rewrites99.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}} \]
          5. Step-by-step derivation
            1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{\frac{F \cdot 1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} \]
          10. Step-by-step derivation
            1. lower-/.f6474.2

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

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

          if 3.8e7 < F

          1. Initial program 56.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. Add Preprocessing
          3. Taylor expanded in F around inf

            \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
          4. 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.f6499.8

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

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

        Alternative 8: 80.2% accurate, 2.0× speedup?

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

          1. Initial program 56.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. Add Preprocessing
          3. 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}} \]
          4. Applied rewrites72.2%

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

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

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

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

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

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

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

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

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

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

            if -8.49999999999999979e22 < F < 3.3999999999999999e-173

            1. Initial program 99.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. Add Preprocessing
            3. 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}} \]
            4. 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}} \]
            5. Step-by-step derivation
              1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
            10. Step-by-step derivation
              1. Applied rewrites84.5%

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

              if 3.3999999999999999e-173 < F < 6.3999999999999996e46

              1. Initial program 98.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. Add Preprocessing
              3. 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}} \]
              4. Applied rewrites99.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}} \]
              5. Step-by-step derivation
                1. lift-pow.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 6.3999999999999996e46 < F

              1. Initial program 52.0%

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

                \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
              4. 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.f6499.8

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

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

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

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

              Alternative 9: 77.3% accurate, 2.1× speedup?

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

                1. Initial program 82.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. Add Preprocessing
                3. Taylor expanded in F around -inf

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                4. 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.6

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                6. 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)}} \]
                7. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{-1}{6}, B \cdot B, 1\right) \cdot B} \]
                  7. lift-tan.f6496.3

                    \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} \]
                10. Applied rewrites96.3%

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

                if -7.19999999999999962e-8 < x < 1.04999999999999997e-8

                1. Initial program 72.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. Add Preprocessing
                3. 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}} \]
                4. Applied rewrites75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{\frac{F \cdot 1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} \]
                10. Step-by-step derivation
                  1. lower-/.f6463.4

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

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

              Alternative 10: 77.3% accurate, 2.1× speedup?

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

                1. Initial program 82.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. Add Preprocessing
                3. Taylor expanded in F around -inf

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                4. 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.6

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                6. 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)}} \]
                7. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{-1}{6}, B \cdot B, 1\right) \cdot B} \]
                  7. lift-tan.f6496.3

                    \[\leadsto \left(-\frac{x \cdot 1}{\color{blue}{\tan B}}\right) + \frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} \]
                10. Applied rewrites96.3%

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

                if -7.19999999999999962e-8 < x < 1.04999999999999997e-8

                1. Initial program 72.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. Add Preprocessing
                3. 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}} \]
                4. Applied rewrites75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 11: 57.1% accurate, 2.2× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 1.2 \cdot 10^{-11}:\\ \;\;\;\;\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}{\mathsf{fma}\left(\left(B \cdot B\right) \cdot 0.008333333333333333, B \cdot B, 1\right) \cdot B}\\ \end{array} \end{array} \]
              (FPCore (F B x)
               :precision binary64
               (if (<= B 1.2e-11)
                 (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                 (+
                  (- (* x (/ 1.0 (tan B))))
                  (/ -1.0 (* (fma (* (* B B) 0.008333333333333333) (* B B) 1.0) B)))))
              double code(double F, double B, double x) {
              	double tmp;
              	if (B <= 1.2e-11) {
              		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 / (fma(((B * B) * 0.008333333333333333), (B * B), 1.0) * B));
              	}
              	return tmp;
              }
              
              function code(F, B, x)
              	tmp = 0.0
              	if (B <= 1.2e-11)
              		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 / Float64(fma(Float64(Float64(B * B) * 0.008333333333333333), Float64(B * B), 1.0) * B)));
              	end
              	return tmp
              end
              
              code[F_, B_, x_] := If[LessEqual[B, 1.2e-11], 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 / N[(N[(N[(N[(B * B), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;B \leq 1.2 \cdot 10^{-11}:\\
              \;\;\;\;\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}{\mathsf{fma}\left(\left(B \cdot B\right) \cdot 0.008333333333333333, B \cdot B, 1\right) \cdot B}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if B < 1.2000000000000001e-11

                1. Initial program 74.0%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Add Preprocessing
                3. 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}} \]
                4. 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}} \]
                5. Applied rewrites57.6%

                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                6. 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. unpow-1N/A

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

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

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

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

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

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

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

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

                if 1.2000000000000001e-11 < B

                1. Initial program 85.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. Add Preprocessing
                3. Taylor expanded in F around -inf

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                4. 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.f6455.9

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                6. 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)}} \]
                7. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot \color{blue}{B}} \]
                9. Taylor expanded in B around inf

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{1}{120} \cdot {B}^{2}, B \cdot B, 1\right) \cdot B} \]
                10. Step-by-step derivation
                  1. *-commutativeN/A

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

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

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\left(B \cdot B\right) \cdot \frac{1}{120}, B \cdot B, 1\right) \cdot B} \]
                  4. lift-*.f6455.4

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\left(B \cdot B\right) \cdot 0.008333333333333333, B \cdot B, 1\right) \cdot B} \]
                11. Applied rewrites55.4%

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

              Alternative 12: 56.9% accurate, 2.4× speedup?

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

                1. Initial program 74.0%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Add Preprocessing
                3. 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}} \]
                4. 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}} \]
                5. Applied rewrites57.6%

                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                6. 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. unpow-1N/A

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

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

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

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

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

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

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

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

                if 1.2000000000000001e-11 < B

                1. Initial program 85.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. Add Preprocessing
                3. Taylor expanded in F around -inf

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                4. 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.f6455.9

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                6. 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)}} \]
                7. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(-\frac{\color{blue}{x \cdot 1}}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\frac{-1}{6}, B \cdot B, 1\right) \cdot B} \]
                  7. lift-tan.f6454.8

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

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

              Alternative 13: 56.3% accurate, 2.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 6 \cdot 10^{-26}:\\ \;\;\;\;\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}{\left(-0.16666666666666666 \cdot \left(B \cdot B\right)\right) \cdot B}\\ \end{array} \end{array} \]
              (FPCore (F B x)
               :precision binary64
               (if (<= B 6e-26)
                 (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                 (+
                  (- (* x (/ 1.0 (tan B))))
                  (/ -1.0 (* (* -0.16666666666666666 (* B B)) B)))))
              double code(double F, double B, double x) {
              	double tmp;
              	if (B <= 6e-26) {
              		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 / ((-0.16666666666666666 * (B * B)) * B));
              	}
              	return tmp;
              }
              
              function code(F, B, x)
              	tmp = 0.0
              	if (B <= 6e-26)
              		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 / Float64(Float64(-0.16666666666666666 * Float64(B * B)) * B)));
              	end
              	return tmp
              end
              
              code[F_, B_, x_] := If[LessEqual[B, 6e-26], 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 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;B \leq 6 \cdot 10^{-26}:\\
              \;\;\;\;\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}{\left(-0.16666666666666666 \cdot \left(B \cdot B\right)\right) \cdot B}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if B < 6.00000000000000023e-26

                1. Initial program 73.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. Add Preprocessing
                3. 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}} \]
                4. 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}} \]
                5. Applied rewrites57.2%

                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                6. 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. unpow-1N/A

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

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

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

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

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

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

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

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

                if 6.00000000000000023e-26 < B

                1. Initial program 85.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. Add Preprocessing
                3. Taylor expanded in F around -inf

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                4. 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.f6455.8

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                6. 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)}} \]
                7. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

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

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot \color{blue}{B}} \]
                9. Taylor expanded in B around inf

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

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

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\left(\frac{-1}{6} \cdot \left(B \cdot B\right)\right) \cdot B} \]
                  3. lift-*.f6453.5

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\left(-0.16666666666666666 \cdot \left(B \cdot B\right)\right) \cdot B} \]
                11. Applied rewrites53.5%

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

              Alternative 14: 56.2% accurate, 2.6× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;B \leq 1.2 \cdot 10^{-11}:\\ \;\;\;\;\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 1.2e-11)
                 (/ (- (* (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 <= 1.2e-11) {
              		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 <= 1.2e-11)
              		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, 1.2e-11], 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 1.2 \cdot 10^{-11}:\\
              \;\;\;\;\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 < 1.2000000000000001e-11

                1. Initial program 74.0%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Add Preprocessing
                3. 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}} \]
                4. 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}} \]
                5. Applied rewrites57.6%

                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                6. 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. unpow-1N/A

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

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

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

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

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

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

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

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

                if 1.2000000000000001e-11 < B

                1. Initial program 85.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. Add Preprocessing
                3. Taylor expanded in F around -inf

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                4. 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.f6455.9

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

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

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

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

                Alternative 15: 51.3% accurate, 2.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{+177}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.28 \cdot 10^{+123}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{+230}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \left(1 - x\right)\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \end{array} \]
                (FPCore (F B x)
                 :precision binary64
                 (if (<= F -1e+177)
                   (/ -1.0 (sin B))
                   (if (<= F 1.28e+123)
                     (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                     (if (<= F 4.2e+230)
                       (/ 1.0 (sin B))
                       (/
                        (- (fma (fma 0.5 x (* 0.16666666666666666 (- 1.0 x))) (* B B) 1.0) x)
                        B)))))
                double code(double F, double B, double x) {
                	double tmp;
                	if (F <= -1e+177) {
                		tmp = -1.0 / sin(B);
                	} else if (F <= 1.28e+123) {
                		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
                	} else if (F <= 4.2e+230) {
                		tmp = 1.0 / sin(B);
                	} else {
                		tmp = (fma(fma(0.5, x, (0.16666666666666666 * (1.0 - x))), (B * B), 1.0) - x) / B;
                	}
                	return tmp;
                }
                
                function code(F, B, x)
                	tmp = 0.0
                	if (F <= -1e+177)
                		tmp = Float64(-1.0 / sin(B));
                	elseif (F <= 1.28e+123)
                		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
                	elseif (F <= 4.2e+230)
                		tmp = Float64(1.0 / sin(B));
                	else
                		tmp = Float64(Float64(fma(fma(0.5, x, Float64(0.16666666666666666 * Float64(1.0 - x))), Float64(B * B), 1.0) - x) / B);
                	end
                	return tmp
                end
                
                code[F_, B_, x_] := If[LessEqual[F, -1e+177], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.28e+123], 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], If[LessEqual[F, 4.2e+230], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.5 * x + N[(0.16666666666666666 * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;F \leq -1 \cdot 10^{+177}:\\
                \;\;\;\;\frac{-1}{\sin B}\\
                
                \mathbf{elif}\;F \leq 1.28 \cdot 10^{+123}:\\
                \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
                
                \mathbf{elif}\;F \leq 4.2 \cdot 10^{+230}:\\
                \;\;\;\;\frac{1}{\sin B}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \left(1 - x\right)\right), B \cdot B, 1\right) - x}{B}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 4 regimes
                2. if F < -1e177

                  1. Initial program 30.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. Add Preprocessing
                  3. 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}} \]
                  4. Applied rewrites51.8%

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{-1}{\sin B} \]
                    2. lift-sin.f6449.7

                      \[\leadsto \frac{-1}{\sin B} \]
                  10. Applied rewrites49.7%

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

                  if -1e177 < F < 1.28000000000000005e123

                  1. Initial program 94.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. Add Preprocessing
                  3. 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}} \]
                  4. 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}} \]
                  5. Applied rewrites51.4%

                    \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                  6. 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. unpow-1N/A

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

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

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

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

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

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

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

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

                  if 1.28000000000000005e123 < F < 4.19999999999999986e230

                  1. Initial program 43.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. Add Preprocessing
                  3. Taylor expanded in F around inf

                    \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                  4. 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.f6499.8

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

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

                    \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
                  7. Step-by-step derivation
                    1. Applied rewrites53.1%

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

                    if 4.19999999999999986e230 < F

                    1. Initial program 31.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. Add Preprocessing
                    3. Taylor expanded in F around inf

                      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                    4. 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.f6499.8

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

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

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

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

                        \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 - x\right)\right)\right) - x}{B} \]
                    8. Applied rewrites50.5%

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

                  Alternative 16: 52.2% accurate, 2.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{+97}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot B}\\ \mathbf{elif}\;F \leq 1.28 \cdot 10^{+123}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{elif}\;F \leq 4.2 \cdot 10^{+230}:\\ \;\;\;\;\frac{1}{\sin B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \left(1 - x\right)\right), B \cdot B, 1\right) - x}{B}\\ \end{array} \end{array} \]
                  (FPCore (F B x)
                   :precision binary64
                   (if (<= F -3e+97)
                     (+
                      (- (/ x B))
                      (/
                       -1.0
                       (*
                        (fma
                         (- (* 0.008333333333333333 (* B B)) 0.16666666666666666)
                         (* B B)
                         1.0)
                        B)))
                     (if (<= F 1.28e+123)
                       (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                       (if (<= F 4.2e+230)
                         (/ 1.0 (sin B))
                         (/
                          (- (fma (fma 0.5 x (* 0.16666666666666666 (- 1.0 x))) (* B B) 1.0) x)
                          B)))))
                  double code(double F, double B, double x) {
                  	double tmp;
                  	if (F <= -3e+97) {
                  		tmp = -(x / B) + (-1.0 / (fma(((0.008333333333333333 * (B * B)) - 0.16666666666666666), (B * B), 1.0) * B));
                  	} else if (F <= 1.28e+123) {
                  		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
                  	} else if (F <= 4.2e+230) {
                  		tmp = 1.0 / sin(B);
                  	} else {
                  		tmp = (fma(fma(0.5, x, (0.16666666666666666 * (1.0 - x))), (B * B), 1.0) - x) / B;
                  	}
                  	return tmp;
                  }
                  
                  function code(F, B, x)
                  	tmp = 0.0
                  	if (F <= -3e+97)
                  		tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / Float64(fma(Float64(Float64(0.008333333333333333 * Float64(B * B)) - 0.16666666666666666), Float64(B * B), 1.0) * B)));
                  	elseif (F <= 1.28e+123)
                  		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
                  	elseif (F <= 4.2e+230)
                  		tmp = Float64(1.0 / sin(B));
                  	else
                  		tmp = Float64(Float64(fma(fma(0.5, x, Float64(0.16666666666666666 * Float64(1.0 - x))), Float64(B * B), 1.0) - x) / B);
                  	end
                  	return tmp
                  end
                  
                  code[F_, B_, x_] := If[LessEqual[F, -3e+97], N[((-N[(x / B), $MachinePrecision]) + N[(-1.0 / N[(N[(N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.28e+123], 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], If[LessEqual[F, 4.2e+230], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.5 * x + N[(0.16666666666666666 * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;F \leq -3 \cdot 10^{+97}:\\
                  \;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot B}\\
                  
                  \mathbf{elif}\;F \leq 1.28 \cdot 10^{+123}:\\
                  \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
                  
                  \mathbf{elif}\;F \leq 4.2 \cdot 10^{+230}:\\
                  \;\;\;\;\frac{1}{\sin B}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \left(1 - x\right)\right), B \cdot B, 1\right) - x}{B}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 4 regimes
                  2. if F < -2.9999999999999998e97

                    1. Initial program 45.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. Add Preprocessing
                    3. Taylor expanded in F around -inf

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                    4. 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} \]
                    5. Applied rewrites99.7%

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                    6. 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)}} \]
                    7. Step-by-step derivation
                      1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot \color{blue}{B}} \]
                    9. Taylor expanded in B around 0

                      \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\mathsf{fma}\left(\frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}, B \cdot B, 1\right) \cdot B} \]
                    10. Step-by-step derivation
                      1. lower-/.f6451.7

                        \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot B} \]
                    11. Applied rewrites51.7%

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

                    if -2.9999999999999998e97 < F < 1.28000000000000005e123

                    1. Initial program 97.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. Add Preprocessing
                    3. 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}} \]
                    4. 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}} \]
                    5. Applied rewrites52.4%

                      \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                    6. 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. unpow-1N/A

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

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

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

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

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

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

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

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

                    if 1.28000000000000005e123 < F < 4.19999999999999986e230

                    1. Initial program 43.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. Add Preprocessing
                    3. Taylor expanded in F around inf

                      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                    4. 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.f6499.8

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

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

                      \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
                    7. Step-by-step derivation
                      1. Applied rewrites53.1%

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

                      if 4.19999999999999986e230 < F

                      1. Initial program 31.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. Add Preprocessing
                      3. Taylor expanded in F around inf

                        \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                      4. 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.f6499.8

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

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

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

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

                          \[\leadsto \frac{\left(1 + {B}^{2} \cdot \left(\frac{1}{2} \cdot x - \frac{-1}{6} \cdot \left(1 - x\right)\right)\right) - x}{B} \]
                      8. Applied rewrites50.5%

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

                    Alternative 17: 66.6% accurate, 2.9× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -200000:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 38000000:\\ \;\;\;\;\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 -200000.0)
                       (- (/ (+ 1.0 x) (sin B)))
                       (if (<= F 38000000.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 <= -200000.0) {
                    		tmp = -((1.0 + x) / sin(B));
                    	} else if (F <= 38000000.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 <= -200000.0)
                    		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
                    	elseif (F <= 38000000.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, -200000.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 38000000.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 -200000:\\
                    \;\;\;\;-\frac{1 + x}{\sin B}\\
                    
                    \mathbf{elif}\;F \leq 38000000:\\
                    \;\;\;\;\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 < -2e5

                      1. Initial program 58.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. Add Preprocessing
                      3. 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}} \]
                      4. Applied rewrites73.6%

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

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

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

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

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

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

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

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

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

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

                        if -2e5 < F < 3.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. Add Preprocessing
                        3. 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}} \]
                        4. 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}} \]
                        5. Applied rewrites52.2%

                          \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                        6. 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. unpow-1N/A

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

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

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

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

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

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

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

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

                        if 3.8e7 < F

                        1. Initial program 56.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. Add Preprocessing
                        3. Taylor expanded in F around inf

                          \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                        4. 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.f6499.8

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

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

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

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

                        Alternative 18: 58.3% accurate, 2.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1 \cdot 10^{+177}:\\ \;\;\;\;\frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 38000000:\\ \;\;\;\;\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 -1e+177)
                           (/ -1.0 (sin B))
                           (if (<= F 38000000.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 <= -1e+177) {
                        		tmp = -1.0 / sin(B);
                        	} else if (F <= 38000000.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 <= -1e+177)
                        		tmp = Float64(-1.0 / sin(B));
                        	elseif (F <= 38000000.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, -1e+177], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 38000000.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 \cdot 10^{+177}:\\
                        \;\;\;\;\frac{-1}{\sin B}\\
                        
                        \mathbf{elif}\;F \leq 38000000:\\
                        \;\;\;\;\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 < -1e177

                          1. Initial program 30.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. Add Preprocessing
                          3. 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}} \]
                          4. Applied rewrites51.8%

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{-1}{\sin B} \]
                            2. lift-sin.f6449.7

                              \[\leadsto \frac{-1}{\sin B} \]
                          10. Applied rewrites49.7%

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

                          if -1e177 < F < 3.8e7

                          1. Initial program 95.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. Add Preprocessing
                          3. 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}} \]
                          4. 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}} \]
                          5. Applied rewrites51.3%

                            \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                          6. 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. unpow-1N/A

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

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

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

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

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

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

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

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

                          if 3.8e7 < F

                          1. Initial program 56.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. Add Preprocessing
                          3. Taylor expanded in F around inf

                            \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                          4. 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.f6499.8

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

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

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

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

                          Alternative 19: 52.1% accurate, 5.7× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{+97}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot B}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{+141}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot x, 0.5, 1\right) - x}{B}\\ \end{array} \end{array} \]
                          (FPCore (F B x)
                           :precision binary64
                           (if (<= F -3e+97)
                             (+
                              (- (/ x B))
                              (/
                               -1.0
                               (*
                                (fma
                                 (- (* 0.008333333333333333 (* B B)) 0.16666666666666666)
                                 (* B B)
                                 1.0)
                                B)))
                             (if (<= F 3.6e+141)
                               (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                               (/ (- (fma (* (* B B) x) 0.5 1.0) x) B))))
                          double code(double F, double B, double x) {
                          	double tmp;
                          	if (F <= -3e+97) {
                          		tmp = -(x / B) + (-1.0 / (fma(((0.008333333333333333 * (B * B)) - 0.16666666666666666), (B * B), 1.0) * B));
                          	} else if (F <= 3.6e+141) {
                          		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
                          	} else {
                          		tmp = (fma(((B * B) * x), 0.5, 1.0) - x) / B;
                          	}
                          	return tmp;
                          }
                          
                          function code(F, B, x)
                          	tmp = 0.0
                          	if (F <= -3e+97)
                          		tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / Float64(fma(Float64(Float64(0.008333333333333333 * Float64(B * B)) - 0.16666666666666666), Float64(B * B), 1.0) * B)));
                          	elseif (F <= 3.6e+141)
                          		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
                          	else
                          		tmp = Float64(Float64(fma(Float64(Float64(B * B) * x), 0.5, 1.0) - x) / B);
                          	end
                          	return tmp
                          end
                          
                          code[F_, B_, x_] := If[LessEqual[F, -3e+97], N[((-N[(x / B), $MachinePrecision]) + N[(-1.0 / N[(N[(N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.6e+141], 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[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;F \leq -3 \cdot 10^{+97}:\\
                          \;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot B}\\
                          
                          \mathbf{elif}\;F \leq 3.6 \cdot 10^{+141}:\\
                          \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot x, 0.5, 1\right) - x}{B}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if F < -2.9999999999999998e97

                            1. Initial program 45.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. Add Preprocessing
                            3. Taylor expanded in F around -inf

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                            4. 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} \]
                            5. Applied rewrites99.7%

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
                            6. 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)}} \]
                            7. Step-by-step derivation
                              1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot \color{blue}{B}} \]
                            9. Taylor expanded in B around 0

                              \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\mathsf{fma}\left(\frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}, B \cdot B, 1\right) \cdot B} \]
                            10. Step-by-step derivation
                              1. lower-/.f6451.7

                                \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot B} \]
                            11. Applied rewrites51.7%

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

                            if -2.9999999999999998e97 < F < 3.6000000000000001e141

                            1. Initial program 97.0%

                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                            2. Add Preprocessing
                            3. 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}} \]
                            4. 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}} \]
                            5. Applied rewrites52.4%

                              \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                            6. 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. unpow-1N/A

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

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

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

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

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

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

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

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

                            if 3.6000000000000001e141 < F

                            1. Initial program 34.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. Add Preprocessing
                            3. Taylor expanded in F around inf

                              \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                            4. 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.f6499.8

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

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

                              \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
                            7. Step-by-step derivation
                              1. Applied rewrites49.7%

                                \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
                              2. Taylor expanded in B around 0

                                \[\leadsto \frac{1}{B} \]
                              3. Step-by-step derivation
                                1. Applied rewrites26.0%

                                  \[\leadsto \frac{1}{B} \]
                                2. Taylor expanded in B around 0

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

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

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

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

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

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

                                    \[\leadsto \frac{\mathsf{fma}\left({B}^{2} \cdot x, \frac{1}{2}, 1\right) - x}{B} \]
                                  7. pow2N/A

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

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

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

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

                              Alternative 20: 52.1% accurate, 5.7× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -5 \cdot 10^{+98}:\\ \;\;\;\;\frac{-\left(1 + x\right)}{B}\\ \mathbf{elif}\;F \leq 3.6 \cdot 10^{+141}:\\ \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot x, 0.5, 1\right) - x}{B}\\ \end{array} \end{array} \]
                              (FPCore (F B x)
                               :precision binary64
                               (if (<= F -5e+98)
                                 (/ (- (+ 1.0 x)) B)
                                 (if (<= F 3.6e+141)
                                   (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
                                   (/ (- (fma (* (* B B) x) 0.5 1.0) x) B))))
                              double code(double F, double B, double x) {
                              	double tmp;
                              	if (F <= -5e+98) {
                              		tmp = -(1.0 + x) / B;
                              	} else if (F <= 3.6e+141) {
                              		tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
                              	} else {
                              		tmp = (fma(((B * B) * x), 0.5, 1.0) - x) / B;
                              	}
                              	return tmp;
                              }
                              
                              function code(F, B, x)
                              	tmp = 0.0
                              	if (F <= -5e+98)
                              		tmp = Float64(Float64(-Float64(1.0 + x)) / B);
                              	elseif (F <= 3.6e+141)
                              		tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B);
                              	else
                              		tmp = Float64(Float64(fma(Float64(Float64(B * B) * x), 0.5, 1.0) - x) / B);
                              	end
                              	return tmp
                              end
                              
                              code[F_, B_, x_] := If[LessEqual[F, -5e+98], N[((-N[(1.0 + x), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 3.6e+141], 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[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;F \leq -5 \cdot 10^{+98}:\\
                              \;\;\;\;\frac{-\left(1 + x\right)}{B}\\
                              
                              \mathbf{elif}\;F \leq 3.6 \cdot 10^{+141}:\\
                              \;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot x, 0.5, 1\right) - x}{B}\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if F < -4.9999999999999998e98

                                1. Initial program 45.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. Add Preprocessing
                                3. 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}} \]
                                4. 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}} \]
                                5. Applied rewrites33.7%

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

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

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

                                    \[\leadsto \frac{-\left(1 + x\right)}{B} \]
                                  3. lower-+.f6451.6

                                    \[\leadsto \frac{-\left(1 + x\right)}{B} \]
                                8. Applied rewrites51.6%

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

                                if -4.9999999999999998e98 < F < 3.6000000000000001e141

                                1. Initial program 97.0%

                                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                2. Add Preprocessing
                                3. 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}} \]
                                4. 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}} \]
                                5. Applied rewrites52.4%

                                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                6. 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. unpow-1N/A

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

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

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

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

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

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

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

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

                                if 3.6000000000000001e141 < F

                                1. Initial program 34.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. Add Preprocessing
                                3. Taylor expanded in F around inf

                                  \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                4. 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.f6499.8

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

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

                                  \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites49.7%

                                    \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
                                  2. Taylor expanded in B around 0

                                    \[\leadsto \frac{1}{B} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites26.0%

                                      \[\leadsto \frac{1}{B} \]
                                    2. Taylor expanded in B around 0

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

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

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

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

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

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

                                        \[\leadsto \frac{\mathsf{fma}\left({B}^{2} \cdot x, \frac{1}{2}, 1\right) - x}{B} \]
                                      7. pow2N/A

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

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

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

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

                                  Alternative 21: 51.3% accurate, 6.1× speedup?

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

                                    1. Initial program 29.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. Add Preprocessing
                                    3. 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}} \]
                                    4. 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}} \]
                                    5. Applied rewrites28.6%

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

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

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

                                        \[\leadsto \frac{-\left(1 + x\right)}{B} \]
                                      3. lower-+.f6452.8

                                        \[\leadsto \frac{-\left(1 + x\right)}{B} \]
                                    8. Applied rewrites52.8%

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

                                    if -1.35e188 < F < 4.00000000000000007e141

                                    1. Initial program 93.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. Add Preprocessing
                                    3. 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}} \]
                                    4. Applied rewrites97.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\color{blue}{\frac{F \cdot 1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}}{\sin B} \]
                                    9. 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}} \]
                                    10. Applied rewrites51.0%

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

                                    if 4.00000000000000007e141 < F

                                    1. Initial program 34.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. Add Preprocessing
                                    3. Taylor expanded in F around inf

                                      \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                    4. 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.f6499.8

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

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

                                      \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites49.8%

                                        \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
                                      2. Taylor expanded in B around 0

                                        \[\leadsto \frac{1}{B} \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites26.0%

                                          \[\leadsto \frac{1}{B} \]
                                        2. Taylor expanded in B around 0

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

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

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

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

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

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

                                            \[\leadsto \frac{\mathsf{fma}\left({B}^{2} \cdot x, \frac{1}{2}, 1\right) - x}{B} \]
                                          7. pow2N/A

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

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

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

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

                                      Alternative 22: 44.0% accurate, 9.2× speedup?

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

                                        1. Initial program 58.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. Add Preprocessing
                                        3. 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}} \]
                                        4. 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}} \]
                                        5. Applied rewrites38.9%

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

                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                        7. Step-by-step derivation
                                          1. mul-1-negN/A

                                            \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                          2. lower-neg.f6426.6

                                            \[\leadsto \frac{-x}{B} \]
                                        8. Applied rewrites26.6%

                                          \[\leadsto \frac{-x}{B} \]
                                        9. Taylor expanded in F around -inf

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{\frac{\frac{1}{2} \cdot \mathsf{fma}\left(2, x, 2\right)}{F \cdot F} - \left(1 + x\right)}{B} \]
                                          11. lower-+.f6452.0

                                            \[\leadsto \frac{\frac{0.5 \cdot \mathsf{fma}\left(2, x, 2\right)}{F \cdot F} - \left(1 + x\right)}{B} \]
                                        11. Applied rewrites52.0%

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

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

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

                                          if -200 < F < 2.7499999999999998e-61

                                          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. Add Preprocessing
                                          3. 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}} \]
                                          4. 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}} \]
                                          5. Applied rewrites52.3%

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

                                            \[\leadsto \frac{-1 \cdot x}{B} \]
                                          7. Step-by-step derivation
                                            1. mul-1-negN/A

                                              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                            2. lower-neg.f6436.0

                                              \[\leadsto \frac{-x}{B} \]
                                          8. Applied rewrites36.0%

                                            \[\leadsto \frac{-x}{B} \]

                                          if 2.7499999999999998e-61 < F

                                          1. Initial program 63.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. Add Preprocessing
                                          3. 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}} \]
                                          4. 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}} \]
                                          5. Applied rewrites41.0%

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

                                            \[\leadsto \frac{1 - x}{B} \]
                                          7. Step-by-step derivation
                                            1. lower--.f6447.3

                                              \[\leadsto \frac{1 - x}{B} \]
                                          8. Applied rewrites47.3%

                                            \[\leadsto \frac{1 - x}{B} \]
                                        14. Recombined 3 regimes into one program.
                                        15. Add Preprocessing

                                        Alternative 23: 44.0% accurate, 13.6× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -200:\\ \;\;\;\;\frac{-\left(1 + x\right)}{B}\\ \mathbf{elif}\;F \leq 2.75 \cdot 10^{-61}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                        (FPCore (F B x)
                                         :precision binary64
                                         (if (<= F -200.0)
                                           (/ (- (+ 1.0 x)) B)
                                           (if (<= F 2.75e-61) (/ (- x) B) (/ (- 1.0 x) B))))
                                        double code(double F, double B, double x) {
                                        	double tmp;
                                        	if (F <= -200.0) {
                                        		tmp = -(1.0 + x) / B;
                                        	} else if (F <= 2.75e-61) {
                                        		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 <= (-200.0d0)) then
                                                tmp = -(1.0d0 + x) / b
                                            else if (f <= 2.75d-61) 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 <= -200.0) {
                                        		tmp = -(1.0 + x) / B;
                                        	} else if (F <= 2.75e-61) {
                                        		tmp = -x / B;
                                        	} else {
                                        		tmp = (1.0 - x) / B;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(F, B, x):
                                        	tmp = 0
                                        	if F <= -200.0:
                                        		tmp = -(1.0 + x) / B
                                        	elif F <= 2.75e-61:
                                        		tmp = -x / B
                                        	else:
                                        		tmp = (1.0 - x) / B
                                        	return tmp
                                        
                                        function code(F, B, x)
                                        	tmp = 0.0
                                        	if (F <= -200.0)
                                        		tmp = Float64(Float64(-Float64(1.0 + x)) / B);
                                        	elseif (F <= 2.75e-61)
                                        		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 <= -200.0)
                                        		tmp = -(1.0 + x) / B;
                                        	elseif (F <= 2.75e-61)
                                        		tmp = -x / B;
                                        	else
                                        		tmp = (1.0 - x) / B;
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[F_, B_, x_] := If[LessEqual[F, -200.0], N[((-N[(1.0 + x), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 2.75e-61], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;F \leq -200:\\
                                        \;\;\;\;\frac{-\left(1 + x\right)}{B}\\
                                        
                                        \mathbf{elif}\;F \leq 2.75 \cdot 10^{-61}:\\
                                        \;\;\;\;\frac{-x}{B}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{1 - x}{B}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 3 regimes
                                        2. if F < -200

                                          1. Initial program 58.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. Add Preprocessing
                                          3. 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}} \]
                                          4. 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}} \]
                                          5. Applied rewrites38.9%

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

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

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

                                              \[\leadsto \frac{-\left(1 + x\right)}{B} \]
                                            3. lower-+.f6451.9

                                              \[\leadsto \frac{-\left(1 + x\right)}{B} \]
                                          8. Applied rewrites51.9%

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

                                          if -200 < F < 2.7499999999999998e-61

                                          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. Add Preprocessing
                                          3. 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}} \]
                                          4. 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}} \]
                                          5. Applied rewrites52.3%

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

                                            \[\leadsto \frac{-1 \cdot x}{B} \]
                                          7. Step-by-step derivation
                                            1. mul-1-negN/A

                                              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                            2. lower-neg.f6436.0

                                              \[\leadsto \frac{-x}{B} \]
                                          8. Applied rewrites36.0%

                                            \[\leadsto \frac{-x}{B} \]

                                          if 2.7499999999999998e-61 < F

                                          1. Initial program 63.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. Add Preprocessing
                                          3. 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}} \]
                                          4. 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}} \]
                                          5. Applied rewrites41.0%

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

                                            \[\leadsto \frac{1 - x}{B} \]
                                          7. Step-by-step derivation
                                            1. lower--.f6447.3

                                              \[\leadsto \frac{1 - x}{B} \]
                                          8. Applied rewrites47.3%

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

                                        Alternative 24: 32.1% accurate, 14.1× speedup?

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

                                          1. Initial program 78.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. Add Preprocessing
                                          3. 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}} \]
                                          4. 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}} \]
                                          5. Applied rewrites47.2%

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

                                            \[\leadsto \frac{-1 \cdot x}{B} \]
                                          7. Step-by-step derivation
                                            1. mul-1-negN/A

                                              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                            2. lower-neg.f6440.0

                                              \[\leadsto \frac{-x}{B} \]
                                          8. Applied rewrites40.0%

                                            \[\leadsto \frac{-x}{B} \]

                                          if -1.1e-155 < x < 7.6999999999999996e-118

                                          1. Initial program 72.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. Add Preprocessing
                                          3. Taylor expanded in F around inf

                                            \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                          4. 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.f6426.8

                                              \[\leadsto \frac{1 - \cos B \cdot x}{\sin B} \]
                                          5. Applied rewrites26.8%

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

                                            \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites26.8%

                                              \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
                                            2. Taylor expanded in B around 0

                                              \[\leadsto \frac{1}{B} \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites16.0%

                                                \[\leadsto \frac{1}{B} \]
                                            4. Recombined 2 regimes into one program.
                                            5. Add Preprocessing

                                            Alternative 25: 36.9% accurate, 17.5× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 2.75 \cdot 10^{-61}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                            (FPCore (F B x)
                                             :precision binary64
                                             (if (<= F 2.75e-61) (/ (- x) B) (/ (- 1.0 x) B)))
                                            double code(double F, double B, double x) {
                                            	double tmp;
                                            	if (F <= 2.75e-61) {
                                            		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 <= 2.75d-61) 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 <= 2.75e-61) {
                                            		tmp = -x / B;
                                            	} else {
                                            		tmp = (1.0 - x) / B;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(F, B, x):
                                            	tmp = 0
                                            	if F <= 2.75e-61:
                                            		tmp = -x / B
                                            	else:
                                            		tmp = (1.0 - x) / B
                                            	return tmp
                                            
                                            function code(F, B, x)
                                            	tmp = 0.0
                                            	if (F <= 2.75e-61)
                                            		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 <= 2.75e-61)
                                            		tmp = -x / B;
                                            	else
                                            		tmp = (1.0 - x) / B;
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[F_, B_, x_] := If[LessEqual[F, 2.75e-61], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;F \leq 2.75 \cdot 10^{-61}:\\
                                            \;\;\;\;\frac{-x}{B}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{1 - x}{B}\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if F < 2.7499999999999998e-61

                                              1. Initial program 83.0%

                                                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                              2. Add Preprocessing
                                              3. 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}} \]
                                              4. 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}} \]
                                              5. Applied rewrites46.9%

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

                                                \[\leadsto \frac{-1 \cdot x}{B} \]
                                              7. Step-by-step derivation
                                                1. mul-1-negN/A

                                                  \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                2. lower-neg.f6432.2

                                                  \[\leadsto \frac{-x}{B} \]
                                              8. Applied rewrites32.2%

                                                \[\leadsto \frac{-x}{B} \]

                                              if 2.7499999999999998e-61 < F

                                              1. Initial program 63.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. Add Preprocessing
                                              3. 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}} \]
                                              4. 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}} \]
                                              5. Applied rewrites41.0%

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

                                                \[\leadsto \frac{1 - x}{B} \]
                                              7. Step-by-step derivation
                                                1. lower--.f6447.3

                                                  \[\leadsto \frac{1 - x}{B} \]
                                              8. Applied rewrites47.3%

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

                                            Alternative 26: 9.8% accurate, 30.7× speedup?

                                            \[\begin{array}{l} \\ \frac{1}{B} \end{array} \]
                                            (FPCore (F B x) :precision binary64 (/ 1.0 B))
                                            double code(double F, double B, double x) {
                                            	return 1.0 / B;
                                            }
                                            
                                            module fmin_fmax_functions
                                                implicit none
                                                private
                                                public fmax
                                                public fmin
                                            
                                                interface fmax
                                                    module procedure fmax88
                                                    module procedure fmax44
                                                    module procedure fmax84
                                                    module procedure fmax48
                                                end interface
                                                interface fmin
                                                    module procedure fmin88
                                                    module procedure fmin44
                                                    module procedure fmin84
                                                    module procedure fmin48
                                                end interface
                                            contains
                                                real(8) function fmax88(x, y) result (res)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                end function
                                                real(4) function fmax44(x, y) result (res)
                                                    real(4), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                end function
                                                real(8) function fmax84(x, y) result(res)
                                                    real(8), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                end function
                                                real(8) function fmax48(x, y) result(res)
                                                    real(4), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                end function
                                                real(8) function fmin88(x, y) result (res)
                                                    real(8), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                end function
                                                real(4) function fmin44(x, y) result (res)
                                                    real(4), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                end function
                                                real(8) function fmin84(x, y) result(res)
                                                    real(8), intent (in) :: x
                                                    real(4), intent (in) :: y
                                                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                end function
                                                real(8) function fmin48(x, y) result(res)
                                                    real(4), intent (in) :: x
                                                    real(8), intent (in) :: y
                                                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                end function
                                            end module
                                            
                                            real(8) function code(f, b, x)
                                            use fmin_fmax_functions
                                                real(8), intent (in) :: f
                                                real(8), intent (in) :: b
                                                real(8), intent (in) :: x
                                                code = 1.0d0 / b
                                            end function
                                            
                                            public static double code(double F, double B, double x) {
                                            	return 1.0 / B;
                                            }
                                            
                                            def code(F, B, x):
                                            	return 1.0 / B
                                            
                                            function code(F, B, x)
                                            	return Float64(1.0 / B)
                                            end
                                            
                                            function tmp = code(F, B, x)
                                            	tmp = 1.0 / B;
                                            end
                                            
                                            code[F_, B_, x_] := N[(1.0 / B), $MachinePrecision]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \frac{1}{B}
                                            \end{array}
                                            
                                            Derivation
                                            1. Initial program 76.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. Add Preprocessing
                                            3. Taylor expanded in F around inf

                                              \[\leadsto \color{blue}{\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}} \]
                                            4. 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.f6455.6

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

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

                                              \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites16.4%

                                                \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
                                              2. Taylor expanded in B around 0

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

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

                                                Reproduce

                                                ?
                                                herbie shell --seed 2025089 
                                                (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))))))