VandenBroeck and Keller, Equation (23)

Percentage Accurate: 76.6% → 99.3%
Time: 7.6s
Alternatives: 23
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 23 alternatives:

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

Initial Program: 76.6% 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.3% accurate, 1.0× speedup?

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

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

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.66 \cdot 10^{+38}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\

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

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


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

    1. Initial program 54.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{-1}{\sin B} \]
      10. lift-tan.f6499.8

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

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

    if -1.66e38 < F < 0.0140000000000000003

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

    if 0.0140000000000000003 < F

    1. Initial program 58.9%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;F \leq 0.014:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, t\_0\right)\\

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


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

    1. Initial program 41.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{-1}{\sin B} \]
      10. lift-tan.f6499.8

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

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

    if -4.99999999999999989e122 < F < 0.0140000000000000003

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0140000000000000003 < F

    1. Initial program 58.9%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 91.6% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -4.2 \cdot 10^{-29}:\\ \;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\ \mathbf{elif}\;F \leq -5.5 \cdot 10^{-89}:\\ \;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}\\ \mathbf{elif}\;F \leq 0.014:\\ \;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\ \end{array} \end{array} \]
(FPCore (F B x)
 :precision binary64
 (if (<= F -4.2e-29)
   (+ (/ (- x) (tan B)) (/ -1.0 (sin B)))
   (if (<= F -5.5e-89)
     (+ (- (/ x B)) (/ (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (sin B)))
     (if (<= F 0.014)
       (+
        (- (/ (* x 1.0) (tan B)))
        (* (/ F B) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
       (/ (- 1.0 (* (cos B) x)) (sin B))))))
double code(double F, double B, double x) {
	double tmp;
	if (F <= -4.2e-29) {
		tmp = (-x / tan(B)) + (-1.0 / sin(B));
	} else if (F <= -5.5e-89) {
		tmp = -(x / B) + ((F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) / sin(B));
	} else if (F <= 0.014) {
		tmp = -((x * 1.0) / tan(B)) + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
	} else {
		tmp = (1.0 - (cos(B) * x)) / sin(B);
	}
	return tmp;
}
function code(F, B, x)
	tmp = 0.0
	if (F <= -4.2e-29)
		tmp = Float64(Float64(Float64(-x) / tan(B)) + Float64(-1.0 / sin(B)));
	elseif (F <= -5.5e-89)
		tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) / sin(B)));
	elseif (F <= 0.014)
		tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))));
	else
		tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B));
	end
	return tmp
end
code[F_, B_, x_] := If[LessEqual[F, -4.2e-29], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.5e-89], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.014], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.2 \cdot 10^{-29}:\\
\;\;\;\;\frac{-x}{\tan B} + \frac{-1}{\sin B}\\

\mathbf{elif}\;F \leq -5.5 \cdot 10^{-89}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}\\

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

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


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

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{-1}{\sin B} \]
      10. lift-tan.f6495.7

        \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{-1}{\sin B} \]
    6. Applied rewrites95.7%

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

    if -4.19999999999999979e-29 < F < -5.50000000000000012e-89

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
    3. Applied rewrites99.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. associate-*r/N/A

        \[\leadsto \left(-\frac{\color{blue}{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} \]
      2. lower-/.f6477.5

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

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

    if -5.50000000000000012e-89 < F < 0.0140000000000000003

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

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

      if 0.0140000000000000003 < F

      1. Initial program 58.9%

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 99.2% accurate, 1.3× speedup?

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

      1. Initial program 56.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 \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{-1}{\sin B}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{-1}{\sin B} \]
        10. lift-tan.f6499.8

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

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

      if -2.0000000000000001e26 < F < 0.0140000000000000003

      1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 0.0140000000000000003 < F

      1. Initial program 58.9%

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 91.5% accurate, 1.3× speedup?

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

      1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{-1}{\sin B} \]
        10. lift-tan.f6495.7

          \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{-1}{\sin B} \]
      6. Applied rewrites95.7%

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

      if -4.19999999999999979e-29 < F < -5.50000000000000012e-89

      1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
      3. Applied rewrites99.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. associate-*r/N/A

          \[\leadsto \left(-\frac{\color{blue}{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} \]
        2. lower-/.f6477.5

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

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

      if -5.50000000000000012e-89 < F < 0.0140000000000000003

      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. inv-powN/A

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

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

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

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

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

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

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

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

      if 0.0140000000000000003 < F

      1. Initial program 58.9%

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

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

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

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

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

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

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

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

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

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

    Alternative 6: 88.6% accurate, 1.4× speedup?

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

      1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{-1}{\sin B} \]
        10. lift-tan.f6495.7

          \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{-1}{\sin B} \]
      6. Applied rewrites95.7%

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

      if -4.19999999999999979e-29 < F < -2.9999999999999999e-89 or 1.2e-191 < F < 0.0140000000000000003

      1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \color{blue}{\frac{F \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}}{\sin B}} \]
      3. Applied rewrites99.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. associate-*r/N/A

          \[\leadsto \left(-\frac{\color{blue}{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} \]
        2. lower-/.f6473.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 rewrites73.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} \]

      if -2.9999999999999999e-89 < F < 1.2e-191

      1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

      if 0.0140000000000000003 < F

      1. Initial program 58.9%

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

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

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

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

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

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

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

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

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

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

    Alternative 7: 84.7% accurate, 1.5× speedup?

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

      1. Initial program 62.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 \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.f6494.7

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{-x}}{\tan B} + \frac{-1}{\sin B} \]
        10. lift-tan.f6494.7

          \[\leadsto \frac{-x}{\color{blue}{\tan B}} + \frac{-1}{\sin B} \]
      6. Applied rewrites94.7%

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

      if -4.00000000000000003e-35 < F < -5.79999999999999943e-70

      1. Initial program 99.3%

        \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
      2. 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. inv-powN/A

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

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

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

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

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

          \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
        10. lift-/.f6453.7

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

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

        \[\leadsto \sqrt{\frac{1}{2}} \cdot \frac{F}{\sin B} \]
      6. Step-by-step derivation
        1. Applied rewrites53.7%

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

        if -5.79999999999999943e-70 < F < 1.05e-74

        1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

        if 1.05e-74 < F

        1. Initial program 64.9%

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

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

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

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

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

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

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

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

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

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

      Alternative 8: 84.6% accurate, 1.5× speedup?

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

        1. Initial program 62.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.f6494.7

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

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

        if -4.00000000000000003e-35 < F < -5.79999999999999943e-70

        1. Initial program 99.3%

          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
        2. 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. inv-powN/A

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

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

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

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

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

            \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
          10. lift-/.f6453.7

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

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

          \[\leadsto \sqrt{\frac{1}{2}} \cdot \frac{F}{\sin B} \]
        6. Step-by-step derivation
          1. Applied rewrites53.7%

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

          if -5.79999999999999943e-70 < F < 1.05e-74

          1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

          if 1.05e-74 < F

          1. Initial program 64.9%

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

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

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

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

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

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

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

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

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

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

        Alternative 9: 77.9% accurate, 1.6× speedup?

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

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

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

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

            \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
          6. Step-by-step derivation
            1. associate-*r/N/A

              \[\leadsto \left(-\frac{\color{blue}{x}}{B}\right) + \frac{-1}{\sin B} \]
            2. lower-/.f6474.5

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

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

          if -2.29999999999999989e-12 < F < 1.05e-74

          1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

          if 1.05e-74 < F

          1. Initial program 64.9%

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

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

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

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

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

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

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

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

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

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

        Alternative 10: 68.3% accurate, 1.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := -\frac{\cos B \cdot x}{\sin B}\\ \mathbf{if}\;x \leq -8 \cdot 10^{-60}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 4.2 \cdot 10^{-189}:\\ \;\;\;\;\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 (- (/ (* (cos B) x) (sin B)))))
           (if (<= x -8e-60)
             t_0
             (if (<= x 4.2e-189) (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B))) t_0))))
        double code(double F, double B, double x) {
        	double t_0 = -((cos(B) * x) / sin(B));
        	double tmp;
        	if (x <= -8e-60) {
        		tmp = t_0;
        	} else if (x <= 4.2e-189) {
        		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(cos(B) * x) / sin(B)))
        	tmp = 0.0
        	if (x <= -8e-60)
        		tmp = t_0;
        	elseif (x <= 4.2e-189)
        		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[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -8e-60], t$95$0, If[LessEqual[x, 4.2e-189], 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 := -\frac{\cos B \cdot x}{\sin B}\\
        \mathbf{if}\;x \leq -8 \cdot 10^{-60}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;x \leq 4.2 \cdot 10^{-189}:\\
        \;\;\;\;\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 < -7.9999999999999998e-60 or 4.20000000000000033e-189 < x

          1. Initial program 79.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 0

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

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

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

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

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

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

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

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

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

          if -7.9999999999999998e-60 < x < 4.20000000000000033e-189

          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. 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. inv-powN/A

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

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

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

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

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

              \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
            10. lift-/.f6456.0

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

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

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

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

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

              \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
            5. lift-fma.f6456.0

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

            \[\leadsto \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 11: 56.3% accurate, 2.1× speedup?

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

          1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.29999999999999992e-5 < B < 1.35000000000000003e284

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B \cdot \left(1 + \left(B \cdot B\right) \cdot \left(\frac{1}{120} \cdot \left(B \cdot B\right) - \frac{1}{6}\right)\right)} \]
            9. lower-*.f6455.0

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

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

          if 1.35000000000000003e284 < B

          1. Initial program 90.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 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. inv-powN/A

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

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

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

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

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

              \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
            10. lift-/.f6434.0

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

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

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

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

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

              \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
            5. lift-fma.f6434.0

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

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

        Alternative 12: 56.1% accurate, 2.3× speedup?

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

          1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.29999999999999992e-5 < B < 1.35000000000000003e284

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

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

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

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

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

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

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

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

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

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

          if 1.35000000000000003e284 < B

          1. Initial program 90.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 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. inv-powN/A

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

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

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

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

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

              \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
            10. lift-/.f6434.0

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

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

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

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

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

              \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
            5. lift-fma.f6434.0

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

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

        Alternative 13: 55.4% accurate, 2.4× speedup?

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

          1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 1.29999999999999992e-5 < B < 1.35000000000000003e284

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

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

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

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

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

            if 1.35000000000000003e284 < B

            1. Initial program 90.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 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. inv-powN/A

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

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

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

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

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

                \[\leadsto \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B} \]
              10. lift-/.f6434.0

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

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

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

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

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

                \[\leadsto \sqrt{\frac{1}{F \cdot F + 2}} \cdot \frac{F}{\sin B} \]
              5. lift-fma.f6434.0

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

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

          Alternative 14: 55.0% accurate, 2.5× speedup?

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

            1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 1.29999999999999992e-5 < B < 1.31999999999999991e282

            1. Initial program 84.9%

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

              \[\leadsto \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.f6455.6

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

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

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

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

              if 1.31999999999999991e282 < B

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

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

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

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

                  \[\leadsto \frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B} \]
                3. metadata-evalN/A

                  \[\leadsto \frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B} \]
                4. metadata-evalN/A

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

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

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

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

                  \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
              10. Recombined 3 regimes into one program.
              11. Add Preprocessing

              Alternative 15: 65.3% accurate, 2.7× speedup?

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

                1. Initial program 62.2%

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

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

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

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

                  \[\leadsto \left(-\color{blue}{\frac{x}{B}}\right) + \frac{-1}{\sin B} \]
                6. Step-by-step derivation
                  1. associate-*r/N/A

                    \[\leadsto \left(-\frac{\color{blue}{x}}{B}\right) + \frac{-1}{\sin B} \]
                  2. lower-/.f6471.7

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

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

                if -4.7000000000000003e-36 < F < 0.0085000000000000006

                1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 0.0085000000000000006 < F

                1. Initial program 58.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 rewrites39.0%

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

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

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

                    \[\leadsto \frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B} \]
                  3. metadata-evalN/A

                    \[\leadsto \frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B} \]
                  4. metadata-evalN/A

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

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

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

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

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

                Alternative 16: 58.9% accurate, 2.8× speedup?

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

                  1. Initial program 29.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. inv-powN/A

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

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

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

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

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

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

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

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

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

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

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

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

                  if -3.3499999999999999e223 < F < -1.44999999999999997e125

                  1. Initial program 49.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -1.44999999999999997e125 < F < 0.0085000000000000006

                  1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 0.0085000000000000006 < F

                  1. Initial program 58.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 rewrites39.0%

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

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

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

                      \[\leadsto \frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B} \]
                    3. metadata-evalN/A

                      \[\leadsto \frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B} \]
                    4. metadata-evalN/A

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

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

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

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

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

                  Alternative 17: 47.4% accurate, 3.1× speedup?

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

                    1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 15500 < B

                    1. Initial program 85.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 rewrites3.7%

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

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

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

                        \[\leadsto \frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B} \]
                      3. metadata-evalN/A

                        \[\leadsto \frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B} \]
                      4. metadata-evalN/A

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

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

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

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

                        \[\leadsto \frac{1}{\sin \color{blue}{B}} \]
                    10. Recombined 2 regimes into one program.
                    11. Add Preprocessing

                    Alternative 18: 47.3% accurate, 3.1× speedup?

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

                      1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 0.330000000000000016 < B

                      1. Initial program 85.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 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. inv-powN/A

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 19: 50.7% accurate, 5.7× speedup?

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

                      1. Initial program 45.2%

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{\frac{-1}{6} \cdot \left(B \cdot B\right) - 1}{B} \]
                        5. lower-*.f6460.9

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

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

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

                          \[\leadsto \left(-\frac{x}{\color{blue}{B}}\right) + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B} \]
                      10. Applied rewrites50.5%

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

                      if -2.39999999999999994e102 < F < 1.3500000000000001e182

                      1. Initial program 94.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 rewrites50.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 1.3500000000000001e182 < F

                      1. Initial program 32.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 rewrites27.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1\right) - x}{B} \]
                          17. lower-*.f6452.1

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

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

                      Alternative 20: 49.7% accurate, 6.2× speedup?

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

                        1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if -4.19999999999999979e-29 < F < 2.1999999999999999e27

                          1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{F \cdot \frac{1}{-1 \cdot \sqrt{x \cdot 2}} - x}{B} \]
                            6. lower-*.f6422.8

                              \[\leadsto \frac{F \cdot \frac{1}{-1 \cdot \sqrt{x \cdot 2}} - x}{B} \]
                          10. Applied rewrites22.8%

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

                            \[\leadsto \frac{F \cdot \frac{1}{\sqrt{2 + 2 \cdot x}} - x}{B} \]
                          12. Step-by-step derivation
                            1. lower-sqrt.f64N/A

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

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

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

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

                          if 2.1999999999999999e27 < F

                          1. Initial program 55.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 rewrites38.0%

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

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

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

                          Alternative 21: 43.7% accurate, 13.6× speedup?

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

                            1. Initial program 64.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 rewrites39.3%

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

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

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

                              if -3.70000000000000002e-68 < F < 1.14999999999999999e-77

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

                                \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                              5. Taylor expanded in F around 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.f6438.3

                                  \[\leadsto \frac{-x}{B} \]
                              7. Applied rewrites38.3%

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

                              if 1.14999999999999999e-77 < F

                              1. Initial program 65.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 rewrites40.8%

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

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

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

                              Alternative 22: 35.9% accurate, 17.5× speedup?

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

                                1. Initial program 64.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 rewrites39.3%

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

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

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

                                  if -3.70000000000000002e-68 < F

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

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

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

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

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

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

                                Alternative 23: 28.8% accurate, 26.3× speedup?

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

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

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

                                    \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                4. Applied rewrites44.0%

                                  \[\leadsto \color{blue}{\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot F - x}{B}} \]
                                5. Taylor expanded in F around 0

                                  \[\leadsto \frac{-1 \cdot x}{B} \]
                                6. Step-by-step derivation
                                  1. mul-1-negN/A

                                    \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                  2. lower-neg.f6428.8

                                    \[\leadsto \frac{-x}{B} \]
                                7. Applied rewrites28.8%

                                  \[\leadsto \frac{-x}{B} \]
                                8. Add Preprocessing

                                Reproduce

                                ?
                                herbie shell --seed 2025096 
                                (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))))))