VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.0% → 99.1%
Time: 6.9s
Alternatives: 25
Speedup: 1.6×

Specification

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

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

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

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 25 alternatives:

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

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

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -155000000000:\\ \;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\ \;\;\;\;\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}:\\ \;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -155000000000.0)
   (- (/ (+ 1.0 (* (cos B) x)) (sin B)))
   (if (<= F 2e-9)
     (+
      (- (/ (* x 1.0) (tan B)))
      (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
     (+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -155000000000.0) {
		tmp = -((1.0 + (cos(B) * x)) / sin(B));
	} else if (F <= 2e-9) {
		tmp = -((x * 1.0) / tan(B)) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = -(x * (1.0 / tan(B))) + (1.0 / sin(B));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: tmp
    if (f <= (-155000000000.0d0)) then
        tmp = -((1.0d0 + (cos(b) * x)) / sin(b))
    else if (f <= 2d-9) then
        tmp = -((x * 1.0d0) / tan(b)) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
    else
        tmp = -(x * (1.0d0 / tan(b))) + (1.0d0 / sin(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double tmp;
	if (F <= -155000000000.0) {
		tmp = -((1.0 + (Math.cos(B) * x)) / Math.sin(B));
	} else if (F <= 2e-9) {
		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 = -(x * (1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
	}
	return tmp;
}
def code(F, B, x):
	tmp = 0
	if F <= -155000000000.0:
		tmp = -((1.0 + (math.cos(B) * x)) / math.sin(B))
	elif F <= 2e-9:
		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 = -(x * (1.0 / math.tan(B))) + (1.0 / math.sin(B))
	return tmp
function code(F, B, x)
	tmp = 0.0
	if (F <= -155000000000.0)
		tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B)));
	elseif (F <= 2e-9)
		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(-Float64(x * Float64(1.0 / tan(B)))) + Float64(1.0 / sin(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	tmp = 0.0;
	if (F <= -155000000000.0)
		tmp = -((1.0 + (cos(B) * x)) / sin(B));
	elseif (F <= 2e-9)
		tmp = -((x * 1.0) / tan(B)) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
	else
		tmp = -(x * (1.0 / tan(B))) + (1.0 / sin(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := If[LessEqual[F, -155000000000.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 2e-9], 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[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -155000000000:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\

\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\\


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

    1. Initial program 59.1%

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

      \[\leadsto \color{blue}{-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 -1.55e11 < F < 2.00000000000000012e-9

    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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

    if 2.00000000000000012e-9 < F

    1. Initial program 59.6%

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

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

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

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

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

Alternative 2: 99.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -x \cdot \frac{1}{\tan B}\\ \mathbf{if}\;F \leq -100000000000:\\ \;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\ \;\;\;\;t\_0 + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (* x (/ 1.0 (tan B))))))
   (if (<= F -100000000000.0)
     (- (/ (+ 1.0 (* (cos B) x)) (sin B)))
     (if (<= F 2e-9)
       (+
        t_0
        (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
       (+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
	double t_0 = -(x * (1.0 / tan(B)));
	double tmp;
	if (F <= -100000000000.0) {
		tmp = -((1.0 + (cos(B) * x)) / sin(B));
	} else if (F <= 2e-9) {
		tmp = t_0 + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = t_0 + (1.0 / sin(B));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = -(x * (1.0d0 / tan(b)))
    if (f <= (-100000000000.0d0)) then
        tmp = -((1.0d0 + (cos(b) * x)) / sin(b))
    else if (f <= 2d-9) then
        tmp = t_0 + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
    else
        tmp = t_0 + (1.0d0 / sin(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = -(x * (1.0 / Math.tan(B)));
	double tmp;
	if (F <= -100000000000.0) {
		tmp = -((1.0 + (Math.cos(B) * x)) / Math.sin(B));
	} else if (F <= 2e-9) {
		tmp = t_0 + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = t_0 + (1.0 / Math.sin(B));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -(x * (1.0 / math.tan(B)))
	tmp = 0
	if F <= -100000000000.0:
		tmp = -((1.0 + (math.cos(B) * x)) / math.sin(B))
	elif F <= 2e-9:
		tmp = t_0 + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
	else:
		tmp = t_0 + (1.0 / math.sin(B))
	return tmp
function code(F, B, x)
	t_0 = Float64(-Float64(x * Float64(1.0 / tan(B))))
	tmp = 0.0
	if (F <= -100000000000.0)
		tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B)));
	elseif (F <= 2e-9)
		tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))));
	else
		tmp = Float64(t_0 + Float64(1.0 / sin(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -(x * (1.0 / tan(B)));
	tmp = 0.0;
	if (F <= -100000000000.0)
		tmp = -((1.0 + (cos(B) * x)) / sin(B));
	elseif (F <= 2e-9)
		tmp = t_0 + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)));
	else
		tmp = t_0 + (1.0 / sin(B));
	end
	tmp_2 = tmp;
end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -100000000000.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 2e-9], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -100000000000:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\

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

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


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

    1. Initial program 59.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 \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 -1e11 < F < 2.00000000000000012e-9

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

    if 2.00000000000000012e-9 < F

    1. Initial program 59.6%

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

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

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

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

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

Alternative 3: 99.0% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -100000000000:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\

\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\

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


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

    1. Initial program 59.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 \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 -1e11 < F < 2.00000000000000012e-9

    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 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.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 rewrites99.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. Step-by-step derivation
      1. lift-sqrt.f64N/A

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

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

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

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

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

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

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

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

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

    if 2.00000000000000012e-9 < F

    1. Initial program 59.6%

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

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

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

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

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

Alternative 4: 99.0% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -100000000000:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\

\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\

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


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

    1. Initial program 59.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 \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 -1e11 < F < 2.00000000000000012e-9

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

    if 2.00000000000000012e-9 < F

    1. Initial program 59.6%

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

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

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

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

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

Alternative 5: 98.8% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -x \cdot \frac{1}{\tan B}\\ \mathbf{if}\;F \leq -195:\\ \;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\ \mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\ \;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \sqrt{0.5}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \frac{1}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (let* ((t_0 (- (* x (/ 1.0 (tan B))))))
   (if (<= F -195.0)
     (- (/ (+ 1.0 (* (cos B) x)) (sin B)))
     (if (<= F 2e-9)
       (+ t_0 (* (/ F (sin B)) (sqrt 0.5)))
       (+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
	double t_0 = -(x * (1.0 / tan(B)));
	double tmp;
	if (F <= -195.0) {
		tmp = -((1.0 + (cos(B) * x)) / sin(B));
	} else if (F <= 2e-9) {
		tmp = t_0 + ((F / sin(B)) * sqrt(0.5));
	} else {
		tmp = t_0 + (1.0 / sin(B));
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(f, b, x)
use fmin_fmax_functions
    real(8), intent (in) :: f
    real(8), intent (in) :: b
    real(8), intent (in) :: x
    real(8) :: t_0
    real(8) :: tmp
    t_0 = -(x * (1.0d0 / tan(b)))
    if (f <= (-195.0d0)) then
        tmp = -((1.0d0 + (cos(b) * x)) / sin(b))
    else if (f <= 2d-9) then
        tmp = t_0 + ((f / sin(b)) * sqrt(0.5d0))
    else
        tmp = t_0 + (1.0d0 / sin(b))
    end if
    code = tmp
end function
public static double code(double F, double B, double x) {
	double t_0 = -(x * (1.0 / Math.tan(B)));
	double tmp;
	if (F <= -195.0) {
		tmp = -((1.0 + (Math.cos(B) * x)) / Math.sin(B));
	} else if (F <= 2e-9) {
		tmp = t_0 + ((F / Math.sin(B)) * Math.sqrt(0.5));
	} else {
		tmp = t_0 + (1.0 / Math.sin(B));
	}
	return tmp;
}
def code(F, B, x):
	t_0 = -(x * (1.0 / math.tan(B)))
	tmp = 0
	if F <= -195.0:
		tmp = -((1.0 + (math.cos(B) * x)) / math.sin(B))
	elif F <= 2e-9:
		tmp = t_0 + ((F / math.sin(B)) * math.sqrt(0.5))
	else:
		tmp = t_0 + (1.0 / 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 <= -195.0)
		tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B)));
	elseif (F <= 2e-9)
		tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * sqrt(0.5)));
	else
		tmp = Float64(t_0 + Float64(1.0 / sin(B)));
	end
	return tmp
end
function tmp_2 = code(F, B, x)
	t_0 = -(x * (1.0 / tan(B)));
	tmp = 0.0;
	if (F <= -195.0)
		tmp = -((1.0 + (cos(B) * x)) / sin(B));
	elseif (F <= 2e-9)
		tmp = t_0 + ((F / sin(B)) * sqrt(0.5));
	else
		tmp = t_0 + (1.0 / 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, -195.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 2e-9], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -195:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\

\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \sqrt{0.5}\\

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


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

    1. Initial program 60.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 \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.5

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

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

    if -195 < F < 2.00000000000000012e-9

    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 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.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 rewrites99.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 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 rewrites99.0%

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

      if 2.00000000000000012e-9 < F

      1. Initial program 59.6%

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

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

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

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

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

    Alternative 6: 91.9% accurate, 1.3× speedup?

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

      1. Initial program 60.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 \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.5

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

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

      if -230 < F < 1.46000000000000004e-12

      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. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.46000000000000004e-12 < F

      1. Initial program 59.8%

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

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

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

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

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

    Alternative 7: 91.8% accurate, 1.4× speedup?

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

      1. Initial program 60.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 \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.5

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

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

      if -230 < F < 1.46000000000000004e-12

      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. Step-by-step derivation
        1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.46000000000000004e-12 < F

      1. Initial program 59.8%

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

        \[\leadsto \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.f6497.3

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

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

    Alternative 8: 85.5% accurate, 1.4× speedup?

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

      1. Initial program 26.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-+.f6427.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 rewrites27.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.8

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

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

      if -3.4999999999999998e281 < F < -340

      1. Initial program 63.5%

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

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

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

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

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

        if -340 < F < 1.46000000000000004e-12

        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. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.46000000000000004e-12 < F

        1. Initial program 59.8%

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

          \[\leadsto \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.f6497.3

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

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

      Alternative 9: 79.3% accurate, 1.5× speedup?

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

        1. Initial program 26.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-+.f6427.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 rewrites27.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.8

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

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

        if -3.4999999999999998e281 < F < -340

        1. Initial program 63.5%

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

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

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

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

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

          if -340 < F < 1e4

          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. Step-by-step derivation
            1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

          if 1e4 < F

          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. 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 rewrites73.6%

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

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

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

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

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

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

            \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot {\color{blue}{\left(F \cdot F\right)}}^{-0.5}}{\sin B} \]
          10. Taylor expanded in F around inf

            \[\leadsto \left(-\frac{x}{B}\right) + \frac{\color{blue}{1}}{\sin B} \]
          11. Step-by-step derivation
            1. Applied rewrites76.2%

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

          Alternative 10: 79.2% accurate, 1.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := -x \cdot \frac{1}{\tan B}\\ \mathbf{if}\;F \leq -3.5 \cdot 10^{+281}:\\ \;\;\;\;t\_0 + \frac{-1}{B}\\ \mathbf{elif}\;F \leq -340:\\ \;\;\;\;-\frac{1 + x}{\sin B}\\ \mathbf{elif}\;F \leq 7800:\\ \;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{1}{\sin B}\\ \end{array} \end{array} \]
          (FPCore (F B x)
           :precision binary64
           (let* ((t_0 (- (* x (/ 1.0 (tan B))))))
             (if (<= F -3.5e+281)
               (+ t_0 (/ -1.0 B))
               (if (<= F -340.0)
                 (- (/ (+ 1.0 x) (sin B)))
                 (if (<= F 7800.0)
                   (+ t_0 (* (/ F B) (sqrt (/ 1.0 (fma F F 2.0)))))
                   (+ (- (/ x B)) (/ 1.0 (sin B))))))))
          double code(double F, double B, double x) {
          	double t_0 = -(x * (1.0 / tan(B)));
          	double tmp;
          	if (F <= -3.5e+281) {
          		tmp = t_0 + (-1.0 / B);
          	} else if (F <= -340.0) {
          		tmp = -((1.0 + x) / sin(B));
          	} else if (F <= 7800.0) {
          		tmp = t_0 + ((F / B) * sqrt((1.0 / fma(F, F, 2.0))));
          	} else {
          		tmp = -(x / B) + (1.0 / sin(B));
          	}
          	return tmp;
          }
          
          function code(F, B, x)
          	t_0 = Float64(-Float64(x * Float64(1.0 / tan(B))))
          	tmp = 0.0
          	if (F <= -3.5e+281)
          		tmp = Float64(t_0 + Float64(-1.0 / B));
          	elseif (F <= -340.0)
          		tmp = Float64(-Float64(Float64(1.0 + x) / sin(B)));
          	elseif (F <= 7800.0)
          		tmp = Float64(t_0 + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(F, F, 2.0)))));
          	else
          		tmp = Float64(Float64(-Float64(x / B)) + Float64(1.0 / 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, -3.5e+281], N[(t$95$0 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -340.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 7800.0], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := -x \cdot \frac{1}{\tan B}\\
          \mathbf{if}\;F \leq -3.5 \cdot 10^{+281}:\\
          \;\;\;\;t\_0 + \frac{-1}{B}\\
          
          \mathbf{elif}\;F \leq -340:\\
          \;\;\;\;-\frac{1 + x}{\sin B}\\
          
          \mathbf{elif}\;F \leq 7800:\\
          \;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(-\frac{x}{B}\right) + \frac{1}{\sin B}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if F < -3.4999999999999998e281

            1. Initial program 26.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-+.f6427.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 rewrites27.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.8

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

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

            if -3.4999999999999998e281 < F < -340

            1. Initial program 63.5%

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

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

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

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

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

              if -340 < F < 7800

              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 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.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 rewrites99.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 rewrites82.5%

                  \[\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 7800 < F

                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. 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 rewrites73.6%

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

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

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

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

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

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

                  \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot {\color{blue}{\left(F \cdot F\right)}}^{-0.5}}{\sin B} \]
                10. Taylor expanded in F around inf

                  \[\leadsto \left(-\frac{x}{B}\right) + \frac{\color{blue}{1}}{\sin B} \]
                11. Step-by-step derivation
                  1. Applied rewrites76.2%

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

                Alternative 11: 75.4% accurate, 1.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\ \mathbf{if}\;x \leq -3.5 \cdot 10^{-9}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{-88}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot 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 -3.5e-9)
                     t_0
                     (if (<= x 1.9e-88)
                       (+ (- (/ x B)) (/ (* (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 <= -3.5e-9) {
                		tmp = t_0;
                	} else if (x <= 1.9e-88) {
                		tmp = -(x / B) + ((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 <= -3.5e-9)
                		tmp = t_0;
                	elseif (x <= 1.9e-88)
                		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * 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, -3.5e-9], t$95$0, If[LessEqual[x, 1.9e-88], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $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 -3.5 \cdot 10^{-9}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;x \leq 1.9 \cdot 10^{-88}:\\
                \;\;\;\;\left(-\frac{x}{B}\right) + \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{\sin B}\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if x < -3.4999999999999999e-9 or 1.90000000000000006e-88 < x

                  1. Initial program 82.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 \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.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 rewrites78.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 F around -inf

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

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

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

                  if -3.4999999999999999e-9 < x < 1.90000000000000006e-88

                  1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 12: 68.5% 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 -1.4 \cdot 10^{-75}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 2.15 \cdot 10^{-128}:\\ \;\;\;\;\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 -1.4e-75)
                     t_0
                     (if (<= x 2.15e-128)
                       (* (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 <= -1.4e-75) {
                		tmp = t_0;
                	} else if (x <= 2.15e-128) {
                		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 <= -1.4e-75)
                		tmp = t_0;
                	elseif (x <= 2.15e-128)
                		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, -1.4e-75], t$95$0, If[LessEqual[x, 2.15e-128], 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 -1.4 \cdot 10^{-75}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;x \leq 2.15 \cdot 10^{-128}:\\
                \;\;\;\;\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 < -1.39999999999999999e-75 or 2.14999999999999997e-128 < x

                  1. Initial program 80.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 \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-+.f6474.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 rewrites74.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 F around -inf

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

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

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

                  if -1.39999999999999999e-75 < x < 2.14999999999999997e-128

                  1. Initial program 72.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-/.f6455.5

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

                    \[\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: 64.8% accurate, 2.3× speedup?

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

                  1. Initial program 60.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 \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.5

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

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

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

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

                    if -230 < F < 2.00000000000000012e-9

                    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 \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 B around 0

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

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

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

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

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

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

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

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

                    if 2.00000000000000012e-9 < F

                    1. Initial program 59.6%

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

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

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

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

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

                        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\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 rewrites74.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-/.f6451.7

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

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

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

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

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

                      \[\leadsto \left(-\frac{x}{B}\right) + \frac{F \cdot {\color{blue}{\left(F \cdot F\right)}}^{-0.5}}{\sin B} \]
                    10. Taylor expanded in F around inf

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

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

                    Alternative 14: 58.1% accurate, 2.4× speedup?

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

                      1. Initial program 60.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 \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.5

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

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

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

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

                        if -230 < F < 2.00000000000000012e-9

                        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 \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 B around 0

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

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

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

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

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

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

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

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

                        if 2.00000000000000012e-9 < F

                        1. Initial program 59.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-+.f6445.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 rewrites45.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 B around 0

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

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

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

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

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

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

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

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

                          \[\leadsto \left(-x \cdot \color{blue}{\frac{1 - 0.3333333333333333 \cdot \left(B \cdot B\right)}{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 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}\right) + \frac{1}{\color{blue}{B}} \]
                        9. Step-by-step derivation
                          1. lower-/.f6449.7

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

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

                      Alternative 15: 57.7% accurate, 2.7× speedup?

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

                        1. Initial program 60.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 \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.5

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

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

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

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

                          if -230 < F < 1.15e139

                          1. Initial program 97.4%

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

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

                          if 1.15e139 < F

                          1. Initial program 34.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-+.f6432.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 rewrites32.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 B around 0

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

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

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

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

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

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

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

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

                            \[\leadsto \left(-x \cdot \color{blue}{\frac{1 - 0.3333333333333333 \cdot \left(B \cdot B\right)}{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 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}\right) + \frac{1}{\color{blue}{B}} \]
                          9. Step-by-step derivation
                            1. lower-/.f6451.5

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

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

                        Alternative 16: 51.1% accurate, 2.9× speedup?

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

                          1. Initial program 59.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 \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}} \]
                          5. Taylor expanded in x around 0

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

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

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

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

                          if -9e11 < F < 1.15e139

                          1. Initial program 97.4%

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

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

                          if 1.15e139 < F

                          1. Initial program 34.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-+.f6432.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 rewrites32.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 B around 0

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

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

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

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

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

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

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

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

                            \[\leadsto \left(-x \cdot \color{blue}{\frac{1 - 0.3333333333333333 \cdot \left(B \cdot B\right)}{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 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}\right) + \frac{1}{\color{blue}{B}} \]
                          9. Step-by-step derivation
                            1. lower-/.f6451.5

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

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

                        Alternative 17: 50.1% accurate, 3.5× speedup?

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

                          1. Initial program 31.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 \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-+.f6431.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 rewrites31.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 B around 0

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

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

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

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

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

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

                              \[\leadsto \left(-x \cdot \frac{1 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                            7. lower-*.f646.8

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

                            \[\leadsto \left(-x \cdot \color{blue}{\frac{1 - 0.3333333333333333 \cdot \left(B \cdot B\right)}{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 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}\right) + \frac{-1}{\color{blue}{B}} \]
                          9. Step-by-step derivation
                            1. lower-/.f6450.8

                              \[\leadsto \left(-x \cdot \frac{1 - 0.3333333333333333 \cdot \left(B \cdot B\right)}{B}\right) + \frac{-1}{B} \]
                          10. Applied rewrites50.8%

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

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

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

                              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}}\right)\right) + \frac{-1}{B} \]
                            4. distribute-lft-neg-inN/A

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{1 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}, \frac{-1}{B}\right)} \]
                          12. Applied rewrites50.8%

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

                          if -5.49999999999999972e169 < F < 1.15e139

                          1. Initial program 95.1%

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

                              \[\leadsto \left(-\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.f6495.3

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

                            \[\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 B around 0

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

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

                          if 1.15e139 < F

                          1. Initial program 34.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-+.f6432.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 rewrites32.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 B around 0

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

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

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

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

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

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

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

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

                            \[\leadsto \left(-x \cdot \color{blue}{\frac{1 - 0.3333333333333333 \cdot \left(B \cdot B\right)}{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 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}\right) + \frac{1}{\color{blue}{B}} \]
                          9. Step-by-step derivation
                            1. lower-/.f6451.5

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

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

                        Alternative 18: 50.0% accurate, 3.7× speedup?

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

                          1. Initial program 60.2%

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

                            \[\leadsto \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-+.f6446.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 rewrites46.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 \color{blue}{\frac{1 + \frac{-1}{3} \cdot {B}^{2}}{B}}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                          6. Step-by-step derivation
                            1. lower-/.f64N/A

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

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

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

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

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

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

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

                            \[\leadsto \left(-x \cdot \color{blue}{\frac{1 - 0.3333333333333333 \cdot \left(B \cdot B\right)}{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 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}\right) + \frac{-1}{\color{blue}{B}} \]
                          9. Step-by-step derivation
                            1. lower-/.f6449.7

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

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

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

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

                              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}}\right)\right) + \frac{-1}{B} \]
                            4. distribute-lft-neg-inN/A

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{1 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}, \frac{-1}{B}\right)} \]
                          12. Applied rewrites49.7%

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

                          if -1.5 < F < 1.85e12

                          1. Initial program 99.5%

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

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

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

                            \[\leadsto \color{blue}{\frac{\sqrt{\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 rewrites19.9%

                              \[\leadsto \frac{-1 - x}{B} \]
                            2. 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}}} \]
                            3. 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                            if 1.85e12 < F

                            1. Initial program 57.5%

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

                              \[\leadsto \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.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 rewrites44.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 B around 0

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

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

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

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

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

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

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

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

                              \[\leadsto \left(-x \cdot \color{blue}{\frac{1 - 0.3333333333333333 \cdot \left(B \cdot B\right)}{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 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}\right) + \frac{1}{\color{blue}{B}} \]
                            9. Step-by-step derivation
                              1. lower-/.f6450.6

                                \[\leadsto \left(-x \cdot \frac{1 - 0.3333333333333333 \cdot \left(B \cdot B\right)}{B}\right) + \frac{1}{B} \]
                            10. Applied rewrites50.6%

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

                          Alternative 19: 50.0% accurate, 3.8× speedup?

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

                            1. Initial program 60.2%

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

                              \[\leadsto \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-+.f6446.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 rewrites46.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 \color{blue}{\frac{1 + \frac{-1}{3} \cdot {B}^{2}}{B}}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                            6. Step-by-step derivation
                              1. lower-/.f64N/A

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

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

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

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

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

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

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

                              \[\leadsto \left(-x \cdot \color{blue}{\frac{1 - 0.3333333333333333 \cdot \left(B \cdot B\right)}{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 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}\right) + \frac{-1}{\color{blue}{B}} \]
                            9. Step-by-step derivation
                              1. lower-/.f6449.7

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

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

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

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

                                \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}}\right)\right) + \frac{-1}{B} \]
                              4. distribute-lft-neg-inN/A

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

                                \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{1 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}, \frac{-1}{B}\right)} \]
                            12. Applied rewrites49.7%

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

                            if -1.5 < F < 1.85e12

                            1. Initial program 99.5%

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

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

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

                              \[\leadsto \color{blue}{\frac{\sqrt{\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 rewrites19.9%

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

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

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

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

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

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

                                  \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + 2}} \cdot F - x}{B} \]
                                6. lower-fma.f6449.7

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

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

                              if 1.85e12 < F

                              1. Initial program 57.5%

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

                                \[\leadsto \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.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 rewrites44.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 B around 0

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

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

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

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

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

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

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

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

                                \[\leadsto \left(-x \cdot \color{blue}{\frac{1 - 0.3333333333333333 \cdot \left(B \cdot B\right)}{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 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}\right) + \frac{1}{\color{blue}{B}} \]
                              9. Step-by-step derivation
                                1. lower-/.f6450.6

                                  \[\leadsto \left(-x \cdot \frac{1 - 0.3333333333333333 \cdot \left(B \cdot B\right)}{B}\right) + \frac{1}{B} \]
                              10. Applied rewrites50.6%

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

                            Alternative 20: 49.9% accurate, 4.2× speedup?

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

                              1. Initial program 60.2%

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

                                \[\leadsto \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-+.f6446.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 rewrites46.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 \color{blue}{\frac{1 + \frac{-1}{3} \cdot {B}^{2}}{B}}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \]
                              6. Step-by-step derivation
                                1. lower-/.f64N/A

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

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

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

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

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

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

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

                                \[\leadsto \left(-x \cdot \color{blue}{\frac{1 - 0.3333333333333333 \cdot \left(B \cdot B\right)}{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 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}\right) + \frac{-1}{\color{blue}{B}} \]
                              9. Step-by-step derivation
                                1. lower-/.f6449.7

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

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

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

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

                                  \[\leadsto \left(\mathsf{neg}\left(\color{blue}{x \cdot \frac{1 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}}\right)\right) + \frac{-1}{B} \]
                                4. distribute-lft-neg-inN/A

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

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(x\right), \frac{1 - \frac{1}{3} \cdot \left(B \cdot B\right)}{B}, \frac{-1}{B}\right)} \]
                              12. Applied rewrites49.7%

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

                              if -1.5 < F < 1.46000000000000004e-12

                              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 -inf

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + 2}} \cdot F - x}{B} \]
                                  6. lower-fma.f6450.5

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

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

                                if 1.46000000000000004e-12 < F

                                1. Initial program 59.8%

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

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

                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                4. Applied rewrites37.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{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                                6. Step-by-step derivation
                                  1. fp-cancel-sign-sub-invN/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 - \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                                  3. metadata-evalN/A

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{\left(1 - \frac{1}{2} \cdot \frac{2 + \left(x + x\right)}{F \cdot F}\right) - x}{B} \]
                                  12. lower-*.f6449.2

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

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

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

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

                                    \[\leadsto \frac{\left(1 - \frac{x}{F \cdot F}\right) - x}{B} \]
                                  3. lift-*.f6449.1

                                    \[\leadsto \frac{\left(1 - \frac{x}{F \cdot F}\right) - x}{B} \]
                                10. Applied rewrites49.1%

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

                              Alternative 21: 49.8% accurate, 4.2× speedup?

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

                                1. Initial program 59.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.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.2%

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

                                  if -1.5e11 < F < 1.46000000000000004e-12

                                  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.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 rewrites20.3%

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

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

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

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

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

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

                                        \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + 2}} \cdot F - x}{B} \]
                                      6. lower-fma.f6450.0

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

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

                                    if 1.46000000000000004e-12 < F

                                    1. Initial program 59.8%

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

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

                                        \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                    4. Applied rewrites37.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{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                                    6. Step-by-step derivation
                                      1. fp-cancel-sign-sub-invN/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 - \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                                      3. metadata-evalN/A

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

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

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

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

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

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

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

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

                                        \[\leadsto \frac{\left(1 - \frac{1}{2} \cdot \frac{2 + \left(x + x\right)}{F \cdot F}\right) - x}{B} \]
                                      12. lower-*.f6449.2

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

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

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

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

                                        \[\leadsto \frac{\left(1 - \frac{x}{F \cdot F}\right) - x}{B} \]
                                      3. lift-*.f6449.1

                                        \[\leadsto \frac{\left(1 - \frac{x}{F \cdot F}\right) - x}{B} \]
                                    10. Applied rewrites49.1%

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

                                  Alternative 22: 43.3% accurate, 4.9× speedup?

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

                                    1. Initial program 64.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 rewrites37.9%

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

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

                                      if -1.7199999999999999e-46 < F < 1.19999999999999994e-12

                                      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 rewrites51.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.f6436.1

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

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

                                      if 1.19999999999999994e-12 < F

                                      1. Initial program 59.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 rewrites37.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{\left(1 + \frac{-1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                                      6. Step-by-step derivation
                                        1. fp-cancel-sign-sub-invN/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 - \frac{1}{2} \cdot \frac{2 + 2 \cdot x}{{F}^{2}}\right) - x}{B} \]
                                        3. metadata-evalN/A

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{\left(1 - \frac{1}{2} \cdot \frac{2 + \left(x + x\right)}{F \cdot F}\right) - x}{B} \]
                                        12. lower-*.f6449.1

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

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

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

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

                                          \[\leadsto \frac{\left(1 - \frac{x}{F \cdot F}\right) - x}{B} \]
                                        3. lift-*.f6449.1

                                          \[\leadsto \frac{\left(1 - \frac{x}{F \cdot F}\right) - x}{B} \]
                                      10. Applied rewrites49.1%

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

                                    Alternative 23: 43.2% accurate, 7.9× speedup?

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

                                      1. Initial program 64.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 rewrites37.9%

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

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

                                        if -1.7199999999999999e-46 < F < 3.70000000000000017e-15

                                        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 rewrites51.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 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.f6436.2

                                            \[\leadsto \frac{-x}{B} \]
                                        7. Applied rewrites36.2%

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

                                        if 3.70000000000000017e-15 < F

                                        1. Initial program 60.2%

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

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

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

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

                                        Alternative 24: 36.1% accurate, 10.7× speedup?

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

                                          1. Initial program 64.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 rewrites37.9%

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

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

                                            if -1.7199999999999999e-46 < 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.4%

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

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

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

                                          Alternative 25: 28.9% 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.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.f6428.9

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

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

                                          Reproduce

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