VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.0% → 99.6%
Time: 6.9s
Alternatives: 22
Speedup: 1.4×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 77.0% 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.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3 \cdot 10^{+30}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 110000000:\\ \;\;\;\;\left(-\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)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -3e+30)
   (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 (sin B)))
   (if (<= F 110000000.0)
     (+
      (- (/ (* 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 <= -3e+30) {
		tmp = -(x * (1.0 / tan(B))) + (-1.0 / sin(B));
	} else if (F <= 110000000.0) {
		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 <= (-3d+30)) then
        tmp = -(x * (1.0d0 / tan(b))) + ((-1.0d0) / sin(b))
    else if (f <= 110000000.0d0) 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 <= -3e+30) {
		tmp = -(x * (1.0 / Math.tan(B))) + (-1.0 / Math.sin(B));
	} else if (F <= 110000000.0) {
		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 <= -3e+30:
		tmp = -(x * (1.0 / math.tan(B))) + (-1.0 / math.sin(B))
	elif F <= 110000000.0:
		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 <= -3e+30)
		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / sin(B)));
	elseif (F <= 110000000.0)
		tmp = Float64(Float64(-Float64(Float64(x * 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 <= -3e+30)
		tmp = -(x * (1.0 / tan(B))) + (-1.0 / sin(B));
	elseif (F <= 110000000.0)
		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, -3e+30], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 110000000.0], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $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 -3 \cdot 10^{+30}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 110000000:\\
\;\;\;\;\left(-\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)}\\

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


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

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

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

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

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

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

    if -2.99999999999999978e30 < F < 1.1e8

    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. 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.5

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

      \[\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.1e8 < F

    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. Taylor expanded in F around inf

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

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

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

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

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

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

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

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

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

Alternative 2: 99.5% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -x \cdot \frac{1}{\tan B}\\ \mathbf{if}\;F \leq -7.4 \cdot 10^{+25}:\\ \;\;\;\;t\_0 + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 110000000:\\ \;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 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 -7.4e+25)
     (+ t_0 (/ -1.0 (sin B)))
     (if (<= F 110000000.0)
       (+ t_0 (* (/ F (sin B)) (sqrt (/ 1.0 (fma F F 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 <= -7.4e+25) {
		tmp = t_0 + (-1.0 / sin(B));
	} else if (F <= 110000000.0) {
		tmp = t_0 + ((F / sin(B)) * sqrt((1.0 / fma(F, F, 2.0))));
	} else {
		tmp = (1.0 - (cos(B) * x)) / sin(B);
	}
	return tmp;
}
function code(F, B, x)
	t_0 = Float64(-Float64(x * Float64(1.0 / tan(B))))
	tmp = 0.0
	if (F <= -7.4e+25)
		tmp = Float64(t_0 + Float64(-1.0 / sin(B)));
	elseif (F <= 110000000.0)
		tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / fma(F, F, 2.0)))));
	else
		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
	end
	return tmp
end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -7.4e+25], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 110000000.0], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $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 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -7.4 \cdot 10^{+25}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 110000000:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 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 < -7.3999999999999998e25

    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. Taylor expanded in F around -inf

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

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

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

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

    if -7.3999999999999998e25 < F < 1.1e8

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{F \cdot F + 2}} \]
      5. lower-fma.f6499.3

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

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

    if 1.1e8 < F

    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. Taylor expanded in F around inf

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

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

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

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

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

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

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

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

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

Alternative 3: 98.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -x \cdot \frac{1}{\tan B}\\ \mathbf{if}\;F \leq -2 \cdot 10^{+17}:\\ \;\;\;\;t\_0 + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 1.4:\\ \;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \sqrt{0.5}\\ \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 -2e+17)
     (+ t_0 (/ -1.0 (sin B)))
     (if (<= F 1.4)
       (+ t_0 (* (/ F (sin B)) (sqrt 0.5)))
       (/ (- 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 <= -2e+17) {
		tmp = t_0 + (-1.0 / sin(B));
	} else if (F <= 1.4) {
		tmp = t_0 + ((F / sin(B)) * sqrt(0.5));
	} 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 <= (-2d+17)) then
        tmp = t_0 + ((-1.0d0) / sin(b))
    else if (f <= 1.4d0) then
        tmp = t_0 + ((f / sin(b)) * sqrt(0.5d0))
    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 <= -2e+17) {
		tmp = t_0 + (-1.0 / Math.sin(B));
	} else if (F <= 1.4) {
		tmp = t_0 + ((F / Math.sin(B)) * Math.sqrt(0.5));
	} 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 <= -2e+17:
		tmp = t_0 + (-1.0 / math.sin(B))
	elif F <= 1.4:
		tmp = t_0 + ((F / math.sin(B)) * math.sqrt(0.5))
	else:
		tmp = (1.0 - (math.cos(B) * x)) / math.sin(B)
	return tmp
function code(F, B, x)
	t_0 = Float64(-Float64(x * Float64(1.0 / tan(B))))
	tmp = 0.0
	if (F <= -2e+17)
		tmp = Float64(t_0 + Float64(-1.0 / sin(B)));
	elseif (F <= 1.4)
		tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * sqrt(0.5)));
	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 <= -2e+17)
		tmp = t_0 + (-1.0 / sin(B));
	elseif (F <= 1.4)
		tmp = t_0 + ((F / sin(B)) * sqrt(0.5));
	else
		tmp = (1.0 - (cos(B) * x)) / sin(B);
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -2e+17], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $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 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+17}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \sqrt{0.5}\\

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


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

    1. Initial program 59.4%

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

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

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

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

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

    if -2e17 < F < 1.3999999999999999

    1. Initial program 99.4%

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{F \cdot F + 2}} \]
      5. lower-fma.f6499.3

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

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

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

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

      if 1.3999999999999999 < F

      1. Initial program 57.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. Taylor expanded in F around inf

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

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

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

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

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

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

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

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

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

    Alternative 4: 92.0% 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 -2 \cdot 10^{+17}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq 4 \cdot 10^{-67}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{t\_0}}\\ \mathbf{elif}\;F \leq 0.0024:\\ \;\;\;\;\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 -2e+17)
         (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 (sin B)))
         (if (<= F 4e-67)
           (+ (/ (- x) (tan B)) (* (/ F B) (sqrt (/ 1.0 t_0))))
           (if (<= F 0.0024)
             (+ (- (/ 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 <= -2e+17) {
    		tmp = -(x * (1.0 / tan(B))) + (-1.0 / sin(B));
    	} else if (F <= 4e-67) {
    		tmp = (-x / tan(B)) + ((F / B) * sqrt((1.0 / t_0)));
    	} else if (F <= 0.0024) {
    		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 <= -2e+17)
    		tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / sin(B)));
    	elseif (F <= 4e-67)
    		tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * sqrt(Float64(1.0 / t_0))));
    	elseif (F <= 0.0024)
    		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, -2e+17], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4e-67], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0024], 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 -2 \cdot 10^{+17}:\\
    \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\sin B}\\
    
    \mathbf{elif}\;F \leq 4 \cdot 10^{-67}:\\
    \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{t\_0}}\\
    
    \mathbf{elif}\;F \leq 0.0024:\\
    \;\;\;\;\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 < -2e17

      1. Initial program 59.4%

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

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

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

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

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

      if -2e17 < F < 3.99999999999999977e-67

      1. Initial program 99.4%

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

        \[\leadsto \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)}}} \]
      3. 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. lower-/.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)}} \]
        5. +-commutativeN/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}} \]
        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}^{2}\right) + 2}} \]
        7. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 3.99999999999999977e-67 < F < 0.00239999999999999979

      1. Initial program 99.4%

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
        10. 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)}} \]
        11. associate-*l/N/A

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
      3. Applied rewrites99.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}} \]
      4. 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} \]
      5. Step-by-step derivation
        1. lower-/.f6479.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} \]
      6. Applied rewrites79.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 0.00239999999999999979 < F

      1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 92.0% accurate, 1.4× speedup?

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

      1. Initial program 59.4%

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

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

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

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

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

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

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

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

          \[\leadsto -\frac{1 + \cos B \cdot x}{\sin B} \]
        8. lower-cos.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} \]
      4. Applied rewrites99.7%

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

      if -2e17 < F < 3.99999999999999977e-67

      1. Initial program 99.4%

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

        \[\leadsto \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)}}} \]
      3. 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. lower-/.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)}} \]
        5. +-commutativeN/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}} \]
        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}^{2}\right) + 2}} \]
        7. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 3.99999999999999977e-67 < F < 0.00239999999999999979

      1. Initial program 99.4%

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
        10. 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)}} \]
        11. associate-*l/N/A

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
      3. Applied rewrites99.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}} \]
      4. 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} \]
      5. Step-by-step derivation
        1. lower-/.f6479.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} \]
      6. Applied rewrites79.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 0.00239999999999999979 < F

      1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

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

    Alternative 6: 81.9% accurate, 1.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\\ t_1 := \left(-\frac{x}{B}\right) + \frac{F \cdot {t\_0}^{-0.5}}{\sin B}\\ \mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -5 \cdot 10^{-24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;F \leq 4 \cdot 10^{-67}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{t\_0}}\\ \mathbf{elif}\;F \leq 0.0024:\\ \;\;\;\;t\_1\\ \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)))
            (t_1 (+ (- (/ x B)) (/ (* F (pow t_0 -0.5)) (sin B)))))
       (if (<= F -1.35e+154)
         (/ (- -1.0 x) B)
         (if (<= F -5e-24)
           t_1
           (if (<= F 4e-67)
             (+ (/ (- x) (tan B)) (* (/ F B) (sqrt (/ 1.0 t_0))))
             (if (<= F 0.0024) t_1 (/ (- 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 t_1 = -(x / B) + ((F * pow(t_0, -0.5)) / sin(B));
    	double tmp;
    	if (F <= -1.35e+154) {
    		tmp = (-1.0 - x) / B;
    	} else if (F <= -5e-24) {
    		tmp = t_1;
    	} else if (F <= 4e-67) {
    		tmp = (-x / tan(B)) + ((F / B) * sqrt((1.0 / t_0)));
    	} else if (F <= 0.0024) {
    		tmp = t_1;
    	} 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))
    	t_1 = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (t_0 ^ -0.5)) / sin(B)))
    	tmp = 0.0
    	if (F <= -1.35e+154)
    		tmp = Float64(Float64(-1.0 - x) / B);
    	elseif (F <= -5e-24)
    		tmp = t_1;
    	elseif (F <= 4e-67)
    		tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * sqrt(Float64(1.0 / t_0))));
    	elseif (F <= 0.0024)
    		tmp = t_1;
    	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]}, Block[{t$95$1 = N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.35e+154], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -5e-24], t$95$1, If[LessEqual[F, 4e-67], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0024], t$95$1, 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)\\
    t_1 := \left(-\frac{x}{B}\right) + \frac{F \cdot {t\_0}^{-0.5}}{\sin B}\\
    \mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\
    \;\;\;\;\frac{-1 - x}{B}\\
    
    \mathbf{elif}\;F \leq -5 \cdot 10^{-24}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;F \leq 4 \cdot 10^{-67}:\\
    \;\;\;\;\frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{t\_0}}\\
    
    \mathbf{elif}\;F \leq 0.0024:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if F < -1.35000000000000003e154

      1. Initial program 34.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. Taylor expanded in B around 0

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

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

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

        \[\leadsto \frac{-1 - x}{B} \]
      6. Step-by-step derivation
        1. Applied rewrites49.0%

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

        if -1.35000000000000003e154 < F < -4.9999999999999998e-24 or 3.99999999999999977e-67 < F < 0.00239999999999999979

        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. 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 {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
          9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
          10. 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)}} \]
          11. associate-*l/N/A

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}} \]
        4. 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} \]
        5. Step-by-step derivation
          1. lower-/.f6478.0

            \[\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} \]
        6. Applied rewrites78.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)}^{-0.5}}{\sin B} \]

        if -4.9999999999999998e-24 < F < 3.99999999999999977e-67

        1. Initial program 99.4%

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

          \[\leadsto \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)}}} \]
        3. 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. lower-/.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)}} \]
          5. +-commutativeN/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}} \]
          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}^{2}\right) + 2}} \]
          7. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 0.00239999999999999979 < F

        1. Initial program 57.9%

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

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

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

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

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

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

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

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

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

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

      Alternative 7: 77.1% accurate, 0.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\ t_1 := \frac{-1 - x}{B}\\ t_2 := \frac{F}{\sin B}\\ t_3 := \left(-x \cdot \frac{1}{\tan B}\right) + t\_2 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{if}\;t\_3 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_3 \leq -60:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_3 \leq 5:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot t\_2\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (F B x)
       :precision binary64
       (let* ((t_0
               (+
                (/ (- x) (tan B))
                (* (/ F B) (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))))))
              (t_1 (/ (- -1.0 x) B))
              (t_2 (/ F (sin B)))
              (t_3
               (+
                (- (* x (/ 1.0 (tan B))))
                (* t_2 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))))
         (if (<= t_3 (- INFINITY))
           t_1
           (if (<= t_3 -60.0)
             t_0
             (if (<= t_3 5.0)
               (* (sqrt (/ 1.0 (fma F F 2.0))) t_2)
               (if (<= t_3 INFINITY) t_0 t_1))))))
      double code(double F, double B, double x) {
      	double t_0 = (-x / tan(B)) + ((F / B) * sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))));
      	double t_1 = (-1.0 - x) / B;
      	double t_2 = F / sin(B);
      	double t_3 = -(x * (1.0 / tan(B))) + (t_2 * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
      	double tmp;
      	if (t_3 <= -((double) INFINITY)) {
      		tmp = t_1;
      	} else if (t_3 <= -60.0) {
      		tmp = t_0;
      	} else if (t_3 <= 5.0) {
      		tmp = sqrt((1.0 / fma(F, F, 2.0))) * t_2;
      	} else if (t_3 <= ((double) INFINITY)) {
      		tmp = t_0;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(F, B, x)
      	t_0 = Float64(Float64(Float64(-x) / tan(B)) + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0))))))
      	t_1 = Float64(Float64(-1.0 - x) / B)
      	t_2 = Float64(F / sin(B))
      	t_3 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(t_2 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
      	tmp = 0.0
      	if (t_3 <= Float64(-Inf))
      		tmp = t_1;
      	elseif (t_3 <= -60.0)
      		tmp = t_0;
      	elseif (t_3 <= 5.0)
      		tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * t_2);
      	elseif (t_3 <= Inf)
      		tmp = t_0;
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[F_, B_, x_] := Block[{t$95$0 = N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$2 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(t$95$2 * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$1, If[LessEqual[t$95$3, -60.0], t$95$0, If[LessEqual[t$95$3, 5.0], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$0, t$95$1]]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{-x}{\tan B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
      t_1 := \frac{-1 - x}{B}\\
      t_2 := \frac{F}{\sin B}\\
      t_3 := \left(-x \cdot \frac{1}{\tan B}\right) + t\_2 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
      \mathbf{if}\;t\_3 \leq -\infty:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t\_3 \leq -60:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;t\_3 \leq 5:\\
      \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot t\_2\\
      
      \mathbf{elif}\;t\_3 \leq \infty:\\
      \;\;\;\;t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -inf.0 or +inf.0 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))))))

        1. Initial program 20.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. Taylor expanded in B around 0

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

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

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

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

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

          if -inf.0 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -60 or 5 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < +inf.0

          1. Initial program 96.5%

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

            \[\leadsto \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)}}} \]
          3. 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. lower-/.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)}} \]
            5. +-commutativeN/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}} \]
            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}^{2}\right) + 2}} \]
            7. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 75.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. Taylor expanded in x around 0

            \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
          3. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
            2. lower-*.f64N/A

              \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
            3. lower-sqrt.f64N/A

              \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
            4. lower-/.f64N/A

              \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
            5. +-commutativeN/A

              \[\leadsto \sqrt{\frac{1}{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
            6. pow2N/A

              \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
            7. lower-fma.f64N/A

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

              \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
            9. lift-/.f6447.5

              \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\color{blue}{\sin B}} \]
          4. Applied rewrites47.5%

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

        Alternative 8: 77.1% accurate, 0.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\ t_1 := -x \cdot \frac{1}{\tan B}\\ t_2 := t\_1 + \frac{F}{B} \cdot t\_0\\ t_3 := \frac{-1 - x}{B}\\ t_4 := \frac{F}{\sin B}\\ t_5 := t\_1 + t\_4 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{if}\;t\_5 \leq -\infty:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_5 \leq -60:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_5 \leq 5:\\ \;\;\;\;t\_0 \cdot t\_4\\ \mathbf{elif}\;t\_5 \leq \infty:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
        (FPCore (F B x)
         :precision binary64
         (let* ((t_0 (sqrt (/ 1.0 (fma F F 2.0))))
                (t_1 (- (* x (/ 1.0 (tan B)))))
                (t_2 (+ t_1 (* (/ F B) t_0)))
                (t_3 (/ (- -1.0 x) B))
                (t_4 (/ F (sin B)))
                (t_5
                 (+ t_1 (* t_4 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))))
           (if (<= t_5 (- INFINITY))
             t_3
             (if (<= t_5 -60.0)
               t_2
               (if (<= t_5 5.0) (* t_0 t_4) (if (<= t_5 INFINITY) t_2 t_3))))))
        double code(double F, double B, double x) {
        	double t_0 = sqrt((1.0 / fma(F, F, 2.0)));
        	double t_1 = -(x * (1.0 / tan(B)));
        	double t_2 = t_1 + ((F / B) * t_0);
        	double t_3 = (-1.0 - x) / B;
        	double t_4 = F / sin(B);
        	double t_5 = t_1 + (t_4 * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
        	double tmp;
        	if (t_5 <= -((double) INFINITY)) {
        		tmp = t_3;
        	} else if (t_5 <= -60.0) {
        		tmp = t_2;
        	} else if (t_5 <= 5.0) {
        		tmp = t_0 * t_4;
        	} else if (t_5 <= ((double) INFINITY)) {
        		tmp = t_2;
        	} else {
        		tmp = t_3;
        	}
        	return tmp;
        }
        
        function code(F, B, x)
        	t_0 = sqrt(Float64(1.0 / fma(F, F, 2.0)))
        	t_1 = Float64(-Float64(x * Float64(1.0 / tan(B))))
        	t_2 = Float64(t_1 + Float64(Float64(F / B) * t_0))
        	t_3 = Float64(Float64(-1.0 - x) / B)
        	t_4 = Float64(F / sin(B))
        	t_5 = Float64(t_1 + Float64(t_4 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))))
        	tmp = 0.0
        	if (t_5 <= Float64(-Inf))
        		tmp = t_3;
        	elseif (t_5 <= -60.0)
        		tmp = t_2;
        	elseif (t_5 <= 5.0)
        		tmp = Float64(t_0 * t_4);
        	elseif (t_5 <= Inf)
        		tmp = t_2;
        	else
        		tmp = t_3;
        	end
        	return tmp
        end
        
        code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$2 = N[(t$95$1 + N[(N[(F / B), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$4 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$1 + N[(t$95$4 * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, (-Infinity)], t$95$3, If[LessEqual[t$95$5, -60.0], t$95$2, If[LessEqual[t$95$5, 5.0], N[(t$95$0 * t$95$4), $MachinePrecision], If[LessEqual[t$95$5, Infinity], t$95$2, t$95$3]]]]]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
        t_1 := -x \cdot \frac{1}{\tan B}\\
        t_2 := t\_1 + \frac{F}{B} \cdot t\_0\\
        t_3 := \frac{-1 - x}{B}\\
        t_4 := \frac{F}{\sin B}\\
        t_5 := t\_1 + t\_4 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
        \mathbf{if}\;t\_5 \leq -\infty:\\
        \;\;\;\;t\_3\\
        
        \mathbf{elif}\;t\_5 \leq -60:\\
        \;\;\;\;t\_2\\
        
        \mathbf{elif}\;t\_5 \leq 5:\\
        \;\;\;\;t\_0 \cdot t\_4\\
        
        \mathbf{elif}\;t\_5 \leq \infty:\\
        \;\;\;\;t\_2\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_3\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -inf.0 or +inf.0 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64))))))

          1. Initial program 20.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. Taylor expanded in B around 0

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

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

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

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

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

            if -inf.0 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -60 or 5 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < +inf.0

            1. Initial program 96.5%

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

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

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

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

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{F \cdot F + 2}} \]
              5. lower-fma.f6496.4

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

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

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

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

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

              1. Initial program 75.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. Taylor expanded in x around 0

                \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                2. lower-*.f64N/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                4. lower-/.f64N/A

                  \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                5. +-commutativeN/A

                  \[\leadsto \sqrt{\frac{1}{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                6. pow2N/A

                  \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                7. lower-fma.f64N/A

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

                  \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
                9. lift-/.f6447.5

                  \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\color{blue}{\sin B}} \]
              4. Applied rewrites47.5%

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

            Alternative 9: 75.1% accurate, 1.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.4 \cdot 10^{-11}:\\ \;\;\;\;-\cos B \cdot \frac{x}{\sin B}\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{-24}:\\ \;\;\;\;\left(-\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}\\ \mathbf{else}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B}\\ \end{array} \end{array} \]
            (FPCore (F B x)
             :precision binary64
             (if (<= x -5.4e-11)
               (- (* (cos B) (/ x (sin B))))
               (if (<= x 1.1e-24)
                 (+ (- (/ x B)) (/ (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (sin B)))
                 (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 B)))))
            double code(double F, double B, double x) {
            	double tmp;
            	if (x <= -5.4e-11) {
            		tmp = -(cos(B) * (x / sin(B)));
            	} else if (x <= 1.1e-24) {
            		tmp = -(x / B) + ((F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) / sin(B));
            	} else {
            		tmp = -(x * (1.0 / tan(B))) + (1.0 / B);
            	}
            	return tmp;
            }
            
            function code(F, B, x)
            	tmp = 0.0
            	if (x <= -5.4e-11)
            		tmp = Float64(-Float64(cos(B) * Float64(x / sin(B))));
            	elseif (x <= 1.1e-24)
            		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) / sin(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[x, -5.4e-11], (-N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[x, 1.1e-24], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;x \leq -5.4 \cdot 10^{-11}:\\
            \;\;\;\;-\cos B \cdot \frac{x}{\sin B}\\
            
            \mathbf{elif}\;x \leq 1.1 \cdot 10^{-24}:\\
            \;\;\;\;\left(-\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}\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if x < -5.40000000000000009e-11

              1. Initial program 73.2%

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

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

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

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

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

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

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

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

                  \[\leadsto -\frac{\cos B \cdot x}{\sin B} \]
                5. associate-/l*N/A

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

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

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

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

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

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

              if -5.40000000000000009e-11 < x < 1.10000000000000001e-24

              1. Initial program 72.5%

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

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

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

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
                10. 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)}} \]
                11. associate-*l/N/A

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
              3. Applied rewrites75.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}} \]
              4. 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} \]
              5. Step-by-step derivation
                1. lower-/.f6464.1

                  \[\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} \]
              6. Applied rewrites64.1%

                \[\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 1.10000000000000001e-24 < x

              1. Initial program 86.6%

                \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
              2. Taylor expanded in 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)}}} \]
              3. 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. lower-/.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)}} \]
                5. +-commutativeN/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}} \]
                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}^{2}\right) + 2}} \]
                7. +-commutativeN/A

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

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

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

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

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

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

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

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

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

            Alternative 10: 74.9% accurate, 1.5× speedup?

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

              1. Initial program 82.9%

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

                \[\leadsto \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)}}} \]
              3. 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. lower-/.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)}} \]
                5. +-commutativeN/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}} \]
                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}^{2}\right) + 2}} \]
                7. +-commutativeN/A

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

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

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

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

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

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

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

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

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

              if -1.7499999999999999e-10 < x < 1.10000000000000001e-24

              1. Initial program 72.5%

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

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

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

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

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + \color{blue}{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 {\color{blue}{\left(\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(\color{blue}{\left(F \cdot F + 2\right)} + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                9. 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(-\color{blue}{\frac{1}{2}}\right)} \]
                10. 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)}} \]
                11. associate-*l/N/A

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

                  \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
              3. Applied rewrites75.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}} \]
              4. 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} \]
              5. Step-by-step derivation
                1. lower-/.f6464.1

                  \[\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} \]
              6. Applied rewrites64.1%

                \[\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} \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 11: 71.1% accurate, 1.6× speedup?

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

              1. Initial program 52.7%

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

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

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

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

                \[\leadsto \frac{-1 - x}{B} \]
              6. Step-by-step derivation
                1. Applied rewrites48.4%

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

                if -6.79999999999999973e69 < F < -2e17

                1. Initial program 96.2%

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

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

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

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

                  \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{F}{\sin B} \cdot \frac{-1}{F} \]
                6. Step-by-step derivation
                  1. lower-/.f6477.8

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

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

                if -2e17 < F < 3.09999999999999997e-33

                1. Initial program 99.4%

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

                  \[\leadsto \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)}}} \]
                3. 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. lower-/.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)}} \]
                  5. +-commutativeN/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}} \]
                  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}^{2}\right) + 2}} \]
                  7. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 3.09999999999999997e-33 < F < 1.08e8

                1. Initial program 99.4%

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

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                3. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                  3. lower-sqrt.f64N/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                  4. lower-/.f64N/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                  5. +-commutativeN/A

                    \[\leadsto \sqrt{\frac{1}{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                  6. pow2N/A

                    \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                  7. lower-fma.f64N/A

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

                    \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
                  9. lift-/.f6462.3

                    \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\color{blue}{\sin B}} \]
                4. Applied rewrites62.3%

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

                if 1.08e8 < F

                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. 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)}}} \]
                3. 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. lower-/.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)}} \]
                  5. +-commutativeN/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}} \]
                  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}^{2}\right) + 2}} \]
                  7. +-commutativeN/A

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

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

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

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

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

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

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

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

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

              Alternative 12: 69.3% accurate, 2.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B}\\ \mathbf{if}\;x \leq -2 \cdot 10^{-50}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{-33}:\\ \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\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 B))))
                 (if (<= x -2e-50)
                   t_0
                   (if (<= x 1.25e-33) (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B))) t_0))))
              double code(double F, double B, double x) {
              	double t_0 = -(x * (1.0 / tan(B))) + (1.0 / B);
              	double tmp;
              	if (x <= -2e-50) {
              		tmp = t_0;
              	} else if (x <= 1.25e-33) {
              		tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              function code(F, B, x)
              	t_0 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(1.0 / B))
              	tmp = 0.0
              	if (x <= -2e-50)
              		tmp = t_0;
              	elseif (x <= 1.25e-33)
              		tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B)));
              	else
              		tmp = t_0;
              	end
              	return tmp
              end
              
              code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2e-50], t$95$0, If[LessEqual[x, 1.25e-33], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B}\\
              \mathbf{if}\;x \leq -2 \cdot 10^{-50}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;x \leq 1.25 \cdot 10^{-33}:\\
              \;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x < -2.00000000000000002e-50 or 1.25000000000000007e-33 < x

                1. Initial program 81.6%

                  \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                2. Taylor expanded in 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)}}} \]
                3. 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. lower-/.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)}} \]
                  5. +-commutativeN/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}} \]
                  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}^{2}\right) + 2}} \]
                  7. +-commutativeN/A

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

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

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

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

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

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

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

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

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

                if -2.00000000000000002e-50 < x < 1.25000000000000007e-33

                1. Initial program 72.7%

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

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                3. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                  3. lower-sqrt.f64N/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                  4. lower-/.f64N/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                  5. +-commutativeN/A

                    \[\leadsto \sqrt{\frac{1}{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                  6. pow2N/A

                    \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                  7. lower-fma.f64N/A

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

                    \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
                  9. lift-/.f6451.6

                    \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\color{blue}{\sin B}} \]
                4. Applied rewrites51.6%

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

              Alternative 13: 50.8% accurate, 2.2× speedup?

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

                1. Initial program 74.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 4.79999999999999982 < B

                1. Initial program 84.5%

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

                  \[\leadsto \color{blue}{\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + {F}^{2}}}} \]
                3. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \color{blue}{\frac{F}{\sin B}} \]
                  3. lower-sqrt.f64N/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{\color{blue}{F}}{\sin B} \]
                  4. lower-/.f64N/A

                    \[\leadsto \sqrt{\frac{1}{2 + {F}^{2}}} \cdot \frac{F}{\sin B} \]
                  5. +-commutativeN/A

                    \[\leadsto \sqrt{\frac{1}{{F}^{2} + 2}} \cdot \frac{F}{\sin B} \]
                  6. pow2N/A

                    \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
                  7. lower-fma.f64N/A

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

                    \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B} \]
                  9. lift-/.f6430.3

                    \[\leadsto \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\color{blue}{\sin B}} \]
                4. Applied rewrites30.3%

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

              Alternative 14: 50.8% accurate, 3.5× speedup?

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

                1. Initial program 58.1%

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

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

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

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

                  \[\leadsto \frac{-1 - x}{B} \]
                6. Step-by-step derivation
                  1. Applied rewrites48.9%

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

                  if -1.99999999999999983e29 < F < 6.99999999999999965e117

                  1. Initial program 98.1%

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

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

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

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

                  if 6.99999999999999965e117 < F

                  1. Initial program 39.4%

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

                    \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}}} \]
                  3. 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. lower-/.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)}} \]
                    5. +-commutativeN/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}} \]
                    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}^{2}\right) + 2}} \]
                    7. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(-x \cdot \frac{1}{\mathsf{fma}\left(0.3333333333333333, B \cdot B, 1\right) \cdot B}\right) + \frac{1}{B} \]
                  10. Applied rewrites51.3%

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

                Alternative 15: 50.7% accurate, 3.5× speedup?

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

                  1. Initial program 34.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. Taylor expanded in B around 0

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

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

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

                    \[\leadsto \frac{-1 - x}{B} \]
                  6. Step-by-step derivation
                    1. Applied rewrites49.0%

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

                    if -1.00000000000000004e154 < F < 4.99999999999999983e117

                    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 4.99999999999999983e117 < F

                    1. Initial program 39.5%

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

                      \[\leadsto \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)}}} \]
                    3. 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. lower-/.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)}} \]
                      5. +-commutativeN/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}} \]
                      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}^{2}\right) + 2}} \]
                      7. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left(-x \cdot \frac{1}{\mathsf{fma}\left(0.3333333333333333, B \cdot B, 1\right) \cdot B}\right) + \frac{1}{B} \]
                    10. Applied rewrites51.3%

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

                  Alternative 16: 50.3% accurate, 3.5× speedup?

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

                    1. Initial program 34.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. Taylor expanded in B around 0

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

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

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

                      \[\leadsto \frac{-1 - x}{B} \]
                    6. Step-by-step derivation
                      1. Applied rewrites49.0%

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

                      if -1.00000000000000004e154 < F < 0.00239999999999999979

                      1. Initial program 97.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. Taylor expanded in B around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 0.00239999999999999979 < F

                      1. Initial program 57.9%

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

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

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

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

                        \[\leadsto \frac{1 - x}{B} \]
                      6. Step-by-step derivation
                        1. Applied rewrites50.3%

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

                      Alternative 17: 49.9% accurate, 5.0× speedup?

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

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

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

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

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

                          \[\leadsto \frac{-1 - x}{B} \]
                        6. Step-by-step derivation
                          1. Applied rewrites49.0%

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

                          if -7.3999999999999998e25 < F < 1.02e8

                          1. Initial program 99.4%

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

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

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

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

                            \[\leadsto \frac{-1 \cdot x}{B} \]
                          6. Step-by-step derivation
                            1. mul-1-negN/A

                              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                            2. lower-neg.f6433.5

                              \[\leadsto \frac{-x}{B} \]
                          7. Applied rewrites33.5%

                            \[\leadsto \frac{-x}{B} \]
                          8. Taylor expanded in F around 0

                            \[\leadsto -1 \cdot \frac{x}{B} + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
                          9. Step-by-step derivation
                            1. +-commutativeN/A

                              \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} + -1 \cdot \color{blue}{\frac{x}{B}} \]
                            2. lower-fma.f64N/A

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{-x}{B}\right) \]
                            11. lower-/.f6449.8

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

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

                            \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2}}, \frac{-x}{B}\right) \]
                          12. Step-by-step derivation
                            1. Applied rewrites49.8%

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

                            if 1.02e8 < F

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

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

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

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

                              \[\leadsto \frac{1 - x}{B} \]
                            6. Step-by-step derivation
                              1. Applied rewrites50.9%

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

                            Alternative 18: 49.9% accurate, 3.8× speedup?

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

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

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

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

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

                                \[\leadsto \frac{-1 - x}{B} \]
                              6. Step-by-step derivation
                                1. Applied rewrites49.0%

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

                                if -7.3999999999999998e25 < F < 1.02e8

                                1. Initial program 99.4%

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

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

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

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

                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                6. Step-by-step derivation
                                  1. mul-1-negN/A

                                    \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                  2. lower-neg.f6433.5

                                    \[\leadsto \frac{-x}{B} \]
                                7. Applied rewrites33.5%

                                  \[\leadsto \frac{-x}{B} \]
                                8. Taylor expanded in F around 0

                                  \[\leadsto -1 \cdot \frac{x}{B} + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
                                9. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} + -1 \cdot \color{blue}{\frac{x}{B}} \]
                                  2. lower-fma.f64N/A

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{-x}{B}\right) \]
                                  11. lower-/.f6449.8

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

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

                                  \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{2}}, \frac{-x}{B}\right) \]
                                12. Step-by-step derivation
                                  1. Applied rewrites49.8%

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

                                  if 1.02e8 < F

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

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

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

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

                                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + 2}} \cdot F - x}{B} \]
                                  6. Step-by-step derivation
                                    1. count-2-revN/A

                                      \[\leadsto \frac{\sqrt{\frac{1}{\left(x + x\right) + 2}} \cdot F - x}{B} \]
                                    2. lift-+.f6412.3

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{\mathsf{fma}\left(2 \cdot \frac{x}{{F}^{2}} + 2 \cdot \frac{1}{{F}^{2}}, \mathsf{neg}\left(\frac{1}{2}\right), 1\right) - x}{B} \]
                                  10. Applied rewrites50.9%

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

                                Alternative 19: 43.0% accurate, 6.3× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -0.00115:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq -1.2 \cdot 10^{-146}:\\ \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\ \mathbf{elif}\;F \leq 5.2 \cdot 10^{-72}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                (FPCore (F B x)
                                 :precision binary64
                                 (if (<= F -0.00115)
                                   (/ (- -1.0 x) B)
                                   (if (<= F -1.2e-146)
                                     (/ (* F (sqrt 0.5)) B)
                                     (if (<= F 5.2e-72) (/ (- x) B) (/ (- 1.0 x) B)))))
                                double code(double F, double B, double x) {
                                	double tmp;
                                	if (F <= -0.00115) {
                                		tmp = (-1.0 - x) / B;
                                	} else if (F <= -1.2e-146) {
                                		tmp = (F * sqrt(0.5)) / B;
                                	} else if (F <= 5.2e-72) {
                                		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 <= (-0.00115d0)) then
                                        tmp = ((-1.0d0) - x) / b
                                    else if (f <= (-1.2d-146)) then
                                        tmp = (f * sqrt(0.5d0)) / b
                                    else if (f <= 5.2d-72) 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 <= -0.00115) {
                                		tmp = (-1.0 - x) / B;
                                	} else if (F <= -1.2e-146) {
                                		tmp = (F * Math.sqrt(0.5)) / B;
                                	} else if (F <= 5.2e-72) {
                                		tmp = -x / B;
                                	} else {
                                		tmp = (1.0 - x) / B;
                                	}
                                	return tmp;
                                }
                                
                                def code(F, B, x):
                                	tmp = 0
                                	if F <= -0.00115:
                                		tmp = (-1.0 - x) / B
                                	elif F <= -1.2e-146:
                                		tmp = (F * math.sqrt(0.5)) / B
                                	elif F <= 5.2e-72:
                                		tmp = -x / B
                                	else:
                                		tmp = (1.0 - x) / B
                                	return tmp
                                
                                function code(F, B, x)
                                	tmp = 0.0
                                	if (F <= -0.00115)
                                		tmp = Float64(Float64(-1.0 - x) / B);
                                	elseif (F <= -1.2e-146)
                                		tmp = Float64(Float64(F * sqrt(0.5)) / B);
                                	elseif (F <= 5.2e-72)
                                		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 <= -0.00115)
                                		tmp = (-1.0 - x) / B;
                                	elseif (F <= -1.2e-146)
                                		tmp = (F * sqrt(0.5)) / B;
                                	elseif (F <= 5.2e-72)
                                		tmp = -x / B;
                                	else
                                		tmp = (1.0 - x) / B;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[F_, B_, x_] := If[LessEqual[F, -0.00115], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -1.2e-146], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.2e-72], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;F \leq -0.00115:\\
                                \;\;\;\;\frac{-1 - x}{B}\\
                                
                                \mathbf{elif}\;F \leq -1.2 \cdot 10^{-146}:\\
                                \;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\
                                
                                \mathbf{elif}\;F \leq 5.2 \cdot 10^{-72}:\\
                                \;\;\;\;\frac{-x}{B}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{1 - x}{B}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 4 regimes
                                2. if F < -0.00115

                                  1. Initial program 61.5%

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

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

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

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

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

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

                                    if -0.00115 < F < -1.2000000000000001e-146

                                    1. Initial program 99.5%

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

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

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

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

                                      \[\leadsto \frac{-1 \cdot x}{B} \]
                                    6. Step-by-step derivation
                                      1. mul-1-negN/A

                                        \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                      2. lower-neg.f6426.8

                                        \[\leadsto \frac{-x}{B} \]
                                    7. Applied rewrites26.8%

                                      \[\leadsto \frac{-x}{B} \]
                                    8. Taylor expanded in F around 0

                                      \[\leadsto -1 \cdot \frac{x}{B} + \color{blue}{\frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}}} \]
                                    9. Step-by-step derivation
                                      1. +-commutativeN/A

                                        \[\leadsto \frac{F}{B} \cdot \sqrt{\frac{1}{2 + 2 \cdot x}} + -1 \cdot \color{blue}{\frac{x}{B}} \]
                                      2. lower-fma.f64N/A

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

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

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

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

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

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

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

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

                                        \[\leadsto \mathsf{fma}\left(\frac{F}{B}, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{-x}{B}\right) \]
                                      11. lower-/.f6450.4

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

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

                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                    12. Step-by-step derivation
                                      1. metadata-evalN/A

                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                      2. lower-/.f64N/A

                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                      3. lower-*.f64N/A

                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                      4. lower-sqrt.f64N/A

                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2}}}{B} \]
                                      5. metadata-eval26.3

                                        \[\leadsto \frac{F \cdot \sqrt{0.5}}{B} \]
                                    13. Applied rewrites26.3%

                                      \[\leadsto \frac{F \cdot \sqrt{0.5}}{B} \]

                                    if -1.2000000000000001e-146 < F < 5.19999999999999992e-72

                                    1. Initial program 99.4%

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

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

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

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

                                      \[\leadsto \frac{-1 \cdot x}{B} \]
                                    6. Step-by-step derivation
                                      1. mul-1-negN/A

                                        \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                      2. lower-neg.f6439.8

                                        \[\leadsto \frac{-x}{B} \]
                                    7. Applied rewrites39.8%

                                      \[\leadsto \frac{-x}{B} \]

                                    if 5.19999999999999992e-72 < F

                                    1. Initial program 64.1%

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

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

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

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

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

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

                                    Alternative 20: 42.9% accurate, 7.9× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -1.6 \cdot 10^{-34}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 5.2 \cdot 10^{-72}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                    (FPCore (F B x)
                                     :precision binary64
                                     (if (<= F -1.6e-34)
                                       (/ (- -1.0 x) B)
                                       (if (<= F 5.2e-72) (/ (- x) B) (/ (- 1.0 x) B))))
                                    double code(double F, double B, double x) {
                                    	double tmp;
                                    	if (F <= -1.6e-34) {
                                    		tmp = (-1.0 - x) / B;
                                    	} else if (F <= 5.2e-72) {
                                    		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 <= (-1.6d-34)) then
                                            tmp = ((-1.0d0) - x) / b
                                        else if (f <= 5.2d-72) 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 <= -1.6e-34) {
                                    		tmp = (-1.0 - x) / B;
                                    	} else if (F <= 5.2e-72) {
                                    		tmp = -x / B;
                                    	} else {
                                    		tmp = (1.0 - x) / B;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    def code(F, B, x):
                                    	tmp = 0
                                    	if F <= -1.6e-34:
                                    		tmp = (-1.0 - x) / B
                                    	elif F <= 5.2e-72:
                                    		tmp = -x / B
                                    	else:
                                    		tmp = (1.0 - x) / B
                                    	return tmp
                                    
                                    function code(F, B, x)
                                    	tmp = 0.0
                                    	if (F <= -1.6e-34)
                                    		tmp = Float64(Float64(-1.0 - x) / B);
                                    	elseif (F <= 5.2e-72)
                                    		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 <= -1.6e-34)
                                    		tmp = (-1.0 - x) / B;
                                    	elseif (F <= 5.2e-72)
                                    		tmp = -x / B;
                                    	else
                                    		tmp = (1.0 - x) / B;
                                    	end
                                    	tmp_2 = tmp;
                                    end
                                    
                                    code[F_, B_, x_] := If[LessEqual[F, -1.6e-34], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.2e-72], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;F \leq -1.6 \cdot 10^{-34}:\\
                                    \;\;\;\;\frac{-1 - x}{B}\\
                                    
                                    \mathbf{elif}\;F \leq 5.2 \cdot 10^{-72}:\\
                                    \;\;\;\;\frac{-x}{B}\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{1 - x}{B}\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 3 regimes
                                    2. if F < -1.60000000000000001e-34

                                      1. Initial program 64.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. Taylor expanded in B around 0

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

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

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

                                        \[\leadsto \frac{-1 - x}{B} \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites47.1%

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

                                        if -1.60000000000000001e-34 < F < 5.19999999999999992e-72

                                        1. Initial program 99.4%

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

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

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

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

                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                        6. Step-by-step derivation
                                          1. mul-1-negN/A

                                            \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                          2. lower-neg.f6437.1

                                            \[\leadsto \frac{-x}{B} \]
                                        7. Applied rewrites37.1%

                                          \[\leadsto \frac{-x}{B} \]

                                        if 5.19999999999999992e-72 < F

                                        1. Initial program 64.1%

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

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

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

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

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

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

                                        Alternative 21: 35.9% accurate, 10.7× speedup?

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

                                          1. Initial program 64.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. Taylor expanded in B around 0

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

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

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

                                            \[\leadsto \frac{-1 - x}{B} \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites47.1%

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

                                            if -1.60000000000000001e-34 < F

                                            1. Initial program 82.9%

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

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

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

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

                                              \[\leadsto \frac{-1 \cdot x}{B} \]
                                            6. Step-by-step derivation
                                              1. mul-1-negN/A

                                                \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                              2. lower-neg.f6430.9

                                                \[\leadsto \frac{-x}{B} \]
                                            7. Applied rewrites30.9%

                                              \[\leadsto \frac{-x}{B} \]
                                          7. Recombined 2 regimes into one program.
                                          8. Add Preprocessing

                                          Alternative 22: 28.5% accurate, 21.7× speedup?

                                          \[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
                                          (FPCore (F B x) :precision binary64 (/ (- x) B))
                                          double code(double F, double B, double x) {
                                          	return -x / B;
                                          }
                                          
                                          module fmin_fmax_functions
                                              implicit none
                                              private
                                              public fmax
                                              public fmin
                                          
                                              interface fmax
                                                  module procedure fmax88
                                                  module procedure fmax44
                                                  module procedure fmax84
                                                  module procedure fmax48
                                              end interface
                                              interface fmin
                                                  module procedure fmin88
                                                  module procedure fmin44
                                                  module procedure fmin84
                                                  module procedure fmin48
                                              end interface
                                          contains
                                              real(8) function fmax88(x, y) result (res)
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                              end function
                                              real(4) function fmax44(x, y) result (res)
                                                  real(4), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                              end function
                                              real(8) function fmax84(x, y) result(res)
                                                  real(8), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                              end function
                                              real(8) function fmax48(x, y) result(res)
                                                  real(4), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                              end function
                                              real(8) function fmin88(x, y) result (res)
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                              end function
                                              real(4) function fmin44(x, y) result (res)
                                                  real(4), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                              end function
                                              real(8) function fmin84(x, y) result(res)
                                                  real(8), intent (in) :: x
                                                  real(4), intent (in) :: y
                                                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                              end function
                                              real(8) function fmin48(x, y) result(res)
                                                  real(4), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                              end function
                                          end module
                                          
                                          real(8) function code(f, b, x)
                                          use fmin_fmax_functions
                                              real(8), intent (in) :: f
                                              real(8), intent (in) :: b
                                              real(8), intent (in) :: x
                                              code = -x / b
                                          end function
                                          
                                          public static double code(double F, double B, double x) {
                                          	return -x / B;
                                          }
                                          
                                          def code(F, B, x):
                                          	return -x / B
                                          
                                          function code(F, B, x)
                                          	return Float64(Float64(-x) / B)
                                          end
                                          
                                          function tmp = code(F, B, x)
                                          	tmp = -x / B;
                                          end
                                          
                                          code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \frac{-x}{B}
                                          \end{array}
                                          
                                          Derivation
                                          1. Initial program 77.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. Taylor expanded in B around 0

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

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

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

                                            \[\leadsto \frac{-1 \cdot x}{B} \]
                                          6. Step-by-step derivation
                                            1. mul-1-negN/A

                                              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                            2. lower-neg.f6428.5

                                              \[\leadsto \frac{-x}{B} \]
                                          7. Applied rewrites28.5%

                                            \[\leadsto \frac{-x}{B} \]
                                          8. Add Preprocessing

                                          Reproduce

                                          ?
                                          herbie shell --seed 2025114 
                                          (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))))))