VandenBroeck and Keller, Equation (23)

Percentage Accurate: 77.1% → 99.6%
Time: 7.2s
Alternatives: 29
Speedup: 1.5×

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

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

Initial Program: 77.1% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 99.6% accurate, 0.9× speedup?

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\\


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

    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 \color{blue}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
    3. Step-by-step derivation
      1. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

    if -2.99999999999999978e30 < F < 2e17

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

    if 2e17 < F

    1. Initial program 56.4%

      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
    2. 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}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 99.6% accurate, 0.9× speedup?

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

\mathbf{elif}\;F \leq 4.2 \cdot 10^{-22}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\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 - t\_0}{\sin B}\\


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

    1. Initial program 54.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999997e32 < F < 4.20000000000000016e-22

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

    if 4.20000000000000016e-22 < F

    1. Initial program 60.5%

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.3% accurate, 1.0× speedup?

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999992e22 < F < 1.99999999999999993e118

    1. Initial program 97.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999993e118 < F

    1. Initial program 41.5%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 98.3% accurate, 1.2× speedup?

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

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

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

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

\mathbf{elif}\;F \leq 4.2 \cdot 10^{-22}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot \sqrt{0.5}\\

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


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

    1. Initial program 58.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3999999999999999 < F < 4.20000000000000016e-22

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

      if 4.20000000000000016e-22 < F

      1. Initial program 60.5%

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 98.1% accurate, 1.1× speedup?

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

      1. Initial program 55.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}{-1 \cdot \left(\frac{1}{\sin B} + \frac{x \cdot \cos B}{\sin B}\right)} \]
      3. Step-by-step derivation
        1. mul-1-negN/A

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

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

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

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

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

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

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

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

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

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

      if -5.4e16 < F < 4.20000000000000016e-22

      1. Initial program 99.4%

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

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

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

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

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

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

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

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

      if 4.20000000000000016e-22 < F

      1. Initial program 60.5%

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

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

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

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

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

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

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

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

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

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

    Alternative 6: 91.8% accurate, 1.3× speedup?

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

      1. Initial program 59.8%

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

        \[\leadsto \color{blue}{-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.f6496.7

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

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

      if -7.0000000000000001e-15 < F < 3e9

      1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 3e9 < F

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

    Alternative 7: 91.3% accurate, 1.4× speedup?

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

      1. Initial program 59.8%

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

        \[\leadsto \color{blue}{-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.f6496.7

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

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

      if -7.0000000000000001e-15 < F < 4.20000000000000016e-22

      1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 4.20000000000000016e-22 < F

      1. Initial program 60.5%

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

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

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

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

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

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

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

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

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

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

    Alternative 8: 82.6% accurate, 1.4× speedup?

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

      1. Initial program 30.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 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.f6452.7

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

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

      if -1.35000000000000003e154 < F < -1.40000000000000001e-19

      1. Initial program 90.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.40000000000000001e-19 < F < 4.20000000000000016e-22

      1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 4.20000000000000016e-22 < F

      1. Initial program 60.5%

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

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

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

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

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

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

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

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

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

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

    Alternative 9: 77.6% accurate, 1.5× speedup?

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

      1. Initial program 69.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.f6482.1

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

        \[\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. fp-cancel-sign-sub-invN/A

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B \cdot \left(1 - \frac{1}{6} \cdot {B}^{2}\right)} \]
        4. 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)} \]
        5. 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)} \]
        6. 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)} \]
        7. lower-*.f6484.6

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

        \[\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 -2.14999999999999995e-32 < x < 0.032000000000000001

      1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 0.032000000000000001 < x

      1. Initial program 87.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 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.f6498.2

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

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

    Alternative 10: 77.2% accurate, 1.5× speedup?

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

      1. Initial program 69.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.f6482.1

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

        \[\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. fp-cancel-sign-sub-invN/A

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

          \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B \cdot \left(1 - \frac{1}{6} \cdot {B}^{2}\right)} \]
        4. 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)} \]
        5. 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)} \]
        6. 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)} \]
        7. lower-*.f6484.6

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

        \[\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 -2.14999999999999995e-32 < x < 6.5000000000000001e-14

      1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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 6.5000000000000001e-14 < x

      1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 11: 76.2% accurate, 0.3× speedup?

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

        1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 77.3%

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

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

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

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

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

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

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

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

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

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

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

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

        if 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 1.0000000000000001e289

        1. Initial program 98.4%

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 23.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.f6480.5

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

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

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

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

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

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

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

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

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

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

        Alternative 12: 76.1% accurate, 0.3× speedup?

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

          1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 77.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 23.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.f6480.5

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

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

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

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

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

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

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

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

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

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

          Alternative 13: 69.7% accurate, 1.8× speedup?

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

            1. Initial program 69.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.f6477.1

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

              \[\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. fp-cancel-sign-sub-invN/A

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

                \[\leadsto \left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B \cdot \left(1 - \frac{1}{6} \cdot {B}^{2}\right)} \]
              4. 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)} \]
              5. 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)} \]
              6. 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)} \]
              7. lower-*.f6480.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 rewrites80.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 -2.4999999999999999e-49 < x < 3.8e-86

            1. Initial program 73.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

            if 3.8e-86 < x < 2.3500000000000001e-14

            1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

            if 2.3500000000000001e-14 < x

            1. Initial program 86.7%

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

              \[\leadsto \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(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{B} \]
            6. Step-by-step derivation
              1. Applied rewrites95.0%

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

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

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

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

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

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

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

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

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

            Alternative 14: 69.5% accurate, 1.9× speedup?

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

              1. Initial program 81.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.f6490.5

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

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

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

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

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

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

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

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

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

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

                if -1.94999999999999987e-33 < x < 3.8e-86

                1. Initial program 73.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

                if 3.8e-86 < x < 2.3500000000000001e-14

                1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 15: 69.5% accurate, 1.9× speedup?

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

                1. Initial program 81.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.f6490.5

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\color{blue}{\tan B}}, \frac{1}{B}\right) \]
                    10. lift-/.f6491.5

                      \[\leadsto \mathsf{fma}\left(-x, \color{blue}{\frac{1}{\tan B}}, \frac{1}{B}\right) \]
                  3. Applied rewrites91.5%

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

                  if -1.94999999999999987e-33 < x < 3.8e-86

                  1. Initial program 73.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 x around 0

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

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

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

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

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

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

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

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

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

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

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

                  if 3.8e-86 < x < 2.3500000000000001e-14

                  1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 16: 57.2% accurate, 2.2× speedup?

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

                  1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 0.17499999999999999 < B

                  1. Initial program 86.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.f6455.8

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(-x, \frac{1}{\color{blue}{\tan B}}, \frac{1}{B}\right) \]
                      10. lift-/.f6453.7

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

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

                  Alternative 17: 57.2% accurate, 2.3× speedup?

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

                    1. Initial program 59.8%

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

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

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

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

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

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

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

                      if -7.0000000000000001e-15 < F < 3e9

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 3e9 < F

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

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

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

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

                    Alternative 18: 51.0% accurate, 3.2× speedup?

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

                      1. Initial program 59.8%

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

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

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

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

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

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

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

                        if -7.0000000000000001e-15 < F < 5.2000000000000001e74

                        1. Initial program 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 5.2000000000000001e74 < F

                        1. Initial program 48.7%

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

                          \[\leadsto \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{1}{B} \]
                        6. Step-by-step derivation
                          1. Applied rewrites74.6%

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

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

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

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

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

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

                              \[\leadsto \frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot \frac{1}{3} - x}{B} + \frac{1}{B} \]
                            7. lower-*.f6451.7

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

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

                        Alternative 19: 50.9% accurate, 3.5× speedup?

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

                          1. Initial program 59.8%

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

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

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

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

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

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

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

                            if -7.0000000000000001e-15 < F < 5.2000000000000001e74

                            1. Initial program 98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if 5.2000000000000001e74 < F

                            1. Initial program 48.7%

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

                              \[\leadsto \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{1}{B} \]
                            6. Step-by-step derivation
                              1. Applied rewrites74.6%

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

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

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

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

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

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

                                  \[\leadsto \frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot \frac{1}{3} - x}{B} + \frac{1}{B} \]
                                7. lower-*.f6451.7

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

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

                            Alternative 20: 50.9% accurate, 3.5× speedup?

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

                              1. Initial program 59.8%

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

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

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

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

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

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

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

                                if -7.0000000000000001e-15 < F < 5.2000000000000001e74

                                1. Initial program 98.8%

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

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

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

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

                                if 5.2000000000000001e74 < F

                                1. Initial program 48.7%

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

                                  \[\leadsto \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{1}{B} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites74.6%

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

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

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

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

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

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

                                      \[\leadsto \frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot \frac{1}{3} - x}{B} + \frac{1}{B} \]
                                    7. lower-*.f6451.7

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

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

                                Alternative 21: 50.9% accurate, 3.7× speedup?

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

                                  1. Initial program 59.8%

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

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

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

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

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

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

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

                                    if -7.0000000000000001e-15 < F < 1.45e20

                                    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{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                    5. Step-by-step derivation
                                      1. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    if 1.45e20 < F

                                    1. Initial program 56.3%

                                      \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                    2. 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{1}{B} \]
                                    6. Step-by-step derivation
                                      1. Applied rewrites74.0%

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

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

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

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

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

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

                                          \[\leadsto \frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot \frac{1}{3} - x}{B} + \frac{1}{B} \]
                                        7. lower-*.f6451.3

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

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

                                    Alternative 22: 50.9% accurate, 3.7× speedup?

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

                                      1. Initial program 58.0%

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

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

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

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

                                        if -1.3999999999999999 < F < 1.45e20

                                        1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        if 1.45e20 < F

                                        1. Initial program 56.3%

                                          \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                        2. 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{1}{B} \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites74.0%

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

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

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

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

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

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

                                              \[\leadsto \frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot \frac{1}{3} - x}{B} + \frac{1}{B} \]
                                            7. lower-*.f6451.3

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

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

                                        Alternative 23: 50.9% accurate, 3.9× speedup?

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

                                          1. Initial program 58.0%

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

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

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

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

                                            if -1.3999999999999999 < F < 1.45e20

                                            1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            if 1.45e20 < F

                                            1. Initial program 56.3%

                                              \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                            2. 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{1}{B} \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites74.0%

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

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

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

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

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

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

                                                  \[\leadsto \frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot \frac{1}{3} - x}{B} + \frac{1}{B} \]
                                                7. lower-*.f6451.3

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

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

                                            Alternative 24: 50.9% accurate, 4.1× speedup?

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

                                              1. Initial program 58.0%

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

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

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

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

                                                if -1.3999999999999999 < F < 1.45e20

                                                1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                if 1.45e20 < F

                                                1. Initial program 56.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \frac{1}{B} - \frac{\color{blue}{x}}{B} \]
                                                8. Step-by-step derivation
                                                  1. lower-/.f6451.2

                                                    \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                                                9. Applied rewrites51.2%

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

                                              Alternative 25: 50.5% accurate, 4.2× speedup?

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

                                                1. Initial program 58.0%

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

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

                                                  \[\leadsto \frac{-1 - x}{B} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites51.5%

                                                    \[\leadsto \frac{-1 - x}{B} \]

                                                  if -1.3999999999999999 < F < 1.45e20

                                                  1. Initial program 99.4%

                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  2. Taylor expanded in B around 0

                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                  3. Step-by-step derivation
                                                    1. lower-/.f64N/A

                                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                  4. Applied rewrites51.5%

                                                    \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                  5. Taylor expanded in F around 0

                                                    \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + 2}} \cdot F - x}{B} \]
                                                  6. Step-by-step derivation
                                                    1. count-2-revN/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\left(x + x\right) + 2}} \cdot F - x}{B} \]
                                                    2. lift-+.f6450.5

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\left(x + x\right) + 2}} \cdot F - x}{B} \]
                                                  7. Applied rewrites50.5%

                                                    \[\leadsto \frac{\sqrt{\frac{1}{\left(x + x\right) + 2}} \cdot F - x}{B} \]
                                                  8. Taylor expanded in F around 0

                                                    \[\leadsto \frac{\sqrt{\frac{1}{2 + 2 \cdot x}} \cdot F - x}{B} \]
                                                  9. Step-by-step derivation
                                                    1. +-commutativeN/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{2 \cdot x + 2}} \cdot F - x}{B} \]
                                                    2. lower-fma.f6450.5

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B} \]
                                                  10. Applied rewrites50.5%

                                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B} \]

                                                  if 1.45e20 < F

                                                  1. Initial program 56.3%

                                                    \[\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)} \]
                                                  2. Taylor expanded in B around 0

                                                    \[\leadsto \color{blue}{\frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{B}} \]
                                                  3. Step-by-step derivation
                                                    1. lower-/.f64N/A

                                                      \[\leadsto \frac{F \cdot \sqrt{\frac{1}{2 + \left(2 \cdot x + {F}^{2}\right)}} - x}{\color{blue}{B}} \]
                                                  4. Applied rewrites37.7%

                                                    \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                  5. Step-by-step derivation
                                                    1. lift-/.f64N/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{\color{blue}{B}} \]
                                                    2. lift--.f64N/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B} \]
                                                    3. lift-*.f64N/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B} \]
                                                    4. lift-sqrt.f64N/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B} \]
                                                    5. lift-/.f64N/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B} \]
                                                    6. lift-+.f64N/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B} \]
                                                    7. lift-+.f64N/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B} \]
                                                    8. lift-fma.f64N/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\left(F \cdot F + \left(x + x\right)\right) + 2}} \cdot F - x}{B} \]
                                                    9. div-subN/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\left(F \cdot F + \left(x + x\right)\right) + 2}} \cdot F}{B} - \color{blue}{\frac{x}{B}} \]
                                                    10. lower--.f64N/A

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\left(F \cdot F + \left(x + x\right)\right) + 2}} \cdot F}{B} - \color{blue}{\frac{x}{B}} \]
                                                  6. Applied rewrites37.7%

                                                    \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F}{B} - \color{blue}{\frac{x}{B}} \]
                                                  7. Taylor expanded in F around inf

                                                    \[\leadsto \frac{1}{B} - \frac{\color{blue}{x}}{B} \]
                                                  8. Step-by-step derivation
                                                    1. lower-/.f6451.2

                                                      \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                                                  9. Applied rewrites51.2%

                                                    \[\leadsto \frac{1}{B} - \frac{\color{blue}{x}}{B} \]
                                                7. Recombined 3 regimes into one program.
                                                8. Add Preprocessing

                                                Alternative 26: 43.7% accurate, 6.4× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.1 \cdot 10^{-44}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-49}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{B} - \frac{x}{B}\\ \end{array} \end{array} \]
                                                (FPCore (F B x)
                                                 :precision binary64
                                                 (if (<= F -3.1e-44)
                                                   (/ (- -1.0 x) B)
                                                   (if (<= F 3.2e-49) (/ (- x) B) (- (/ 1.0 B) (/ x B)))))
                                                double code(double F, double B, double x) {
                                                	double tmp;
                                                	if (F <= -3.1e-44) {
                                                		tmp = (-1.0 - x) / B;
                                                	} else if (F <= 3.2e-49) {
                                                		tmp = -x / B;
                                                	} else {
                                                		tmp = (1.0 / B) - (x / B);
                                                	}
                                                	return tmp;
                                                }
                                                
                                                module fmin_fmax_functions
                                                    implicit none
                                                    private
                                                    public fmax
                                                    public fmin
                                                
                                                    interface fmax
                                                        module procedure fmax88
                                                        module procedure fmax44
                                                        module procedure fmax84
                                                        module procedure fmax48
                                                    end interface
                                                    interface fmin
                                                        module procedure fmin88
                                                        module procedure fmin44
                                                        module procedure fmin84
                                                        module procedure fmin48
                                                    end interface
                                                contains
                                                    real(8) function fmax88(x, y) result (res)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                    end function
                                                    real(4) function fmax44(x, y) result (res)
                                                        real(4), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmax84(x, y) result(res)
                                                        real(8), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmax48(x, y) result(res)
                                                        real(4), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin88(x, y) result (res)
                                                        real(8), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                    end function
                                                    real(4) function fmin44(x, y) result (res)
                                                        real(4), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin84(x, y) result(res)
                                                        real(8), intent (in) :: x
                                                        real(4), intent (in) :: y
                                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                    end function
                                                    real(8) function fmin48(x, y) result(res)
                                                        real(4), intent (in) :: x
                                                        real(8), intent (in) :: y
                                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                    end function
                                                end module
                                                
                                                real(8) function code(f, b, x)
                                                use fmin_fmax_functions
                                                    real(8), intent (in) :: f
                                                    real(8), intent (in) :: b
                                                    real(8), intent (in) :: x
                                                    real(8) :: tmp
                                                    if (f <= (-3.1d-44)) then
                                                        tmp = ((-1.0d0) - x) / b
                                                    else if (f <= 3.2d-49) then
                                                        tmp = -x / b
                                                    else
                                                        tmp = (1.0d0 / b) - (x / b)
                                                    end if
                                                    code = tmp
                                                end function
                                                
                                                public static double code(double F, double B, double x) {
                                                	double tmp;
                                                	if (F <= -3.1e-44) {
                                                		tmp = (-1.0 - x) / B;
                                                	} else if (F <= 3.2e-49) {
                                                		tmp = -x / B;
                                                	} else {
                                                		tmp = (1.0 / B) - (x / B);
                                                	}
                                                	return tmp;
                                                }
                                                
                                                def code(F, B, x):
                                                	tmp = 0
                                                	if F <= -3.1e-44:
                                                		tmp = (-1.0 - x) / B
                                                	elif F <= 3.2e-49:
                                                		tmp = -x / B
                                                	else:
                                                		tmp = (1.0 / B) - (x / B)
                                                	return tmp
                                                
                                                function code(F, B, x)
                                                	tmp = 0.0
                                                	if (F <= -3.1e-44)
                                                		tmp = Float64(Float64(-1.0 - x) / B);
                                                	elseif (F <= 3.2e-49)
                                                		tmp = Float64(Float64(-x) / B);
                                                	else
                                                		tmp = Float64(Float64(1.0 / B) - Float64(x / B));
                                                	end
                                                	return tmp
                                                end
                                                
                                                function tmp_2 = code(F, B, x)
                                                	tmp = 0.0;
                                                	if (F <= -3.1e-44)
                                                		tmp = (-1.0 - x) / B;
                                                	elseif (F <= 3.2e-49)
                                                		tmp = -x / B;
                                                	else
                                                		tmp = (1.0 / B) - (x / B);
                                                	end
                                                	tmp_2 = tmp;
                                                end
                                                
                                                code[F_, B_, x_] := If[LessEqual[F, -3.1e-44], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.2e-49], N[((-x) / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                \mathbf{if}\;F \leq -3.1 \cdot 10^{-44}:\\
                                                \;\;\;\;\frac{-1 - x}{B}\\
                                                
                                                \mathbf{elif}\;F \leq 3.2 \cdot 10^{-49}:\\
                                                \;\;\;\;\frac{-x}{B}\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;\frac{1}{B} - \frac{x}{B}\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 3 regimes
                                                2. if F < -3.09999999999999984e-44

                                                  1. Initial program 62.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 rewrites40.8%

                                                    \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                  5. Taylor expanded in F around -inf

                                                    \[\leadsto \frac{-1 - x}{B} \]
                                                  6. Step-by-step derivation
                                                    1. Applied rewrites47.9%

                                                      \[\leadsto \frac{-1 - x}{B} \]

                                                    if -3.09999999999999984e-44 < F < 3.20000000000000002e-49

                                                    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.4%

                                                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                    5. Taylor expanded in F around 0

                                                      \[\leadsto \frac{-1 \cdot x}{B} \]
                                                    6. Step-by-step derivation
                                                      1. mul-1-negN/A

                                                        \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                      2. lower-neg.f6437.4

                                                        \[\leadsto \frac{-x}{B} \]
                                                    7. Applied rewrites37.4%

                                                      \[\leadsto \frac{-x}{B} \]

                                                    if 3.20000000000000002e-49 < F

                                                    1. Initial program 62.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.9%

                                                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                    5. Step-by-step derivation
                                                      1. lift-/.f64N/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{\color{blue}{B}} \]
                                                      2. lift--.f64N/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B} \]
                                                      3. lift-*.f64N/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B} \]
                                                      4. lift-sqrt.f64N/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B} \]
                                                      5. lift-/.f64N/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B} \]
                                                      6. lift-+.f64N/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B} \]
                                                      7. lift-+.f64N/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B} \]
                                                      8. lift-fma.f64N/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\left(F \cdot F + \left(x + x\right)\right) + 2}} \cdot F - x}{B} \]
                                                      9. div-subN/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\left(F \cdot F + \left(x + x\right)\right) + 2}} \cdot F}{B} - \color{blue}{\frac{x}{B}} \]
                                                      10. lower--.f64N/A

                                                        \[\leadsto \frac{\sqrt{\frac{1}{\left(F \cdot F + \left(x + x\right)\right) + 2}} \cdot F}{B} - \color{blue}{\frac{x}{B}} \]
                                                    6. Applied rewrites39.9%

                                                      \[\leadsto \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F}{B} - \color{blue}{\frac{x}{B}} \]
                                                    7. Taylor expanded in F around inf

                                                      \[\leadsto \frac{1}{B} - \frac{\color{blue}{x}}{B} \]
                                                    8. Step-by-step derivation
                                                      1. lower-/.f6447.5

                                                        \[\leadsto \frac{1}{B} - \frac{x}{B} \]
                                                    9. Applied rewrites47.5%

                                                      \[\leadsto \frac{1}{B} - \frac{\color{blue}{x}}{B} \]
                                                  7. Recombined 3 regimes into one program.
                                                  8. Add Preprocessing

                                                  Alternative 27: 43.7% accurate, 7.9× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.1 \cdot 10^{-44}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{elif}\;F \leq 3.2 \cdot 10^{-49}:\\ \;\;\;\;\frac{-x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 - x}{B}\\ \end{array} \end{array} \]
                                                  (FPCore (F B x)
                                                   :precision binary64
                                                   (if (<= F -3.1e-44)
                                                     (/ (- -1.0 x) B)
                                                     (if (<= F 3.2e-49) (/ (- x) B) (/ (- 1.0 x) B))))
                                                  double code(double F, double B, double x) {
                                                  	double tmp;
                                                  	if (F <= -3.1e-44) {
                                                  		tmp = (-1.0 - x) / B;
                                                  	} else if (F <= 3.2e-49) {
                                                  		tmp = -x / B;
                                                  	} else {
                                                  		tmp = (1.0 - x) / B;
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  module fmin_fmax_functions
                                                      implicit none
                                                      private
                                                      public fmax
                                                      public fmin
                                                  
                                                      interface fmax
                                                          module procedure fmax88
                                                          module procedure fmax44
                                                          module procedure fmax84
                                                          module procedure fmax48
                                                      end interface
                                                      interface fmin
                                                          module procedure fmin88
                                                          module procedure fmin44
                                                          module procedure fmin84
                                                          module procedure fmin48
                                                      end interface
                                                  contains
                                                      real(8) function fmax88(x, y) result (res)
                                                          real(8), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                      end function
                                                      real(4) function fmax44(x, y) result (res)
                                                          real(4), intent (in) :: x
                                                          real(4), intent (in) :: y
                                                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmax84(x, y) result(res)
                                                          real(8), intent (in) :: x
                                                          real(4), intent (in) :: y
                                                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmax48(x, y) result(res)
                                                          real(4), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmin88(x, y) result (res)
                                                          real(8), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                      end function
                                                      real(4) function fmin44(x, y) result (res)
                                                          real(4), intent (in) :: x
                                                          real(4), intent (in) :: y
                                                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmin84(x, y) result(res)
                                                          real(8), intent (in) :: x
                                                          real(4), intent (in) :: y
                                                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                      end function
                                                      real(8) function fmin48(x, y) result(res)
                                                          real(4), intent (in) :: x
                                                          real(8), intent (in) :: y
                                                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                      end function
                                                  end module
                                                  
                                                  real(8) function code(f, b, x)
                                                  use fmin_fmax_functions
                                                      real(8), intent (in) :: f
                                                      real(8), intent (in) :: b
                                                      real(8), intent (in) :: x
                                                      real(8) :: tmp
                                                      if (f <= (-3.1d-44)) then
                                                          tmp = ((-1.0d0) - x) / b
                                                      else if (f <= 3.2d-49) then
                                                          tmp = -x / b
                                                      else
                                                          tmp = (1.0d0 - x) / b
                                                      end if
                                                      code = tmp
                                                  end function
                                                  
                                                  public static double code(double F, double B, double x) {
                                                  	double tmp;
                                                  	if (F <= -3.1e-44) {
                                                  		tmp = (-1.0 - x) / B;
                                                  	} else if (F <= 3.2e-49) {
                                                  		tmp = -x / B;
                                                  	} else {
                                                  		tmp = (1.0 - x) / B;
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  def code(F, B, x):
                                                  	tmp = 0
                                                  	if F <= -3.1e-44:
                                                  		tmp = (-1.0 - x) / B
                                                  	elif F <= 3.2e-49:
                                                  		tmp = -x / B
                                                  	else:
                                                  		tmp = (1.0 - x) / B
                                                  	return tmp
                                                  
                                                  function code(F, B, x)
                                                  	tmp = 0.0
                                                  	if (F <= -3.1e-44)
                                                  		tmp = Float64(Float64(-1.0 - x) / B);
                                                  	elseif (F <= 3.2e-49)
                                                  		tmp = Float64(Float64(-x) / B);
                                                  	else
                                                  		tmp = Float64(Float64(1.0 - x) / B);
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  function tmp_2 = code(F, B, x)
                                                  	tmp = 0.0;
                                                  	if (F <= -3.1e-44)
                                                  		tmp = (-1.0 - x) / B;
                                                  	elseif (F <= 3.2e-49)
                                                  		tmp = -x / B;
                                                  	else
                                                  		tmp = (1.0 - x) / B;
                                                  	end
                                                  	tmp_2 = tmp;
                                                  end
                                                  
                                                  code[F_, B_, x_] := If[LessEqual[F, -3.1e-44], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.2e-49], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  \mathbf{if}\;F \leq -3.1 \cdot 10^{-44}:\\
                                                  \;\;\;\;\frac{-1 - x}{B}\\
                                                  
                                                  \mathbf{elif}\;F \leq 3.2 \cdot 10^{-49}:\\
                                                  \;\;\;\;\frac{-x}{B}\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;\frac{1 - x}{B}\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 3 regimes
                                                  2. if F < -3.09999999999999984e-44

                                                    1. Initial program 62.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 rewrites40.8%

                                                      \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                    5. Taylor expanded in F around -inf

                                                      \[\leadsto \frac{-1 - x}{B} \]
                                                    6. Step-by-step derivation
                                                      1. Applied rewrites47.9%

                                                        \[\leadsto \frac{-1 - x}{B} \]

                                                      if -3.09999999999999984e-44 < F < 3.20000000000000002e-49

                                                      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.4%

                                                        \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                      5. Taylor expanded in F around 0

                                                        \[\leadsto \frac{-1 \cdot x}{B} \]
                                                      6. Step-by-step derivation
                                                        1. mul-1-negN/A

                                                          \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                        2. lower-neg.f6437.4

                                                          \[\leadsto \frac{-x}{B} \]
                                                      7. Applied rewrites37.4%

                                                        \[\leadsto \frac{-x}{B} \]

                                                      if 3.20000000000000002e-49 < F

                                                      1. Initial program 62.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.9%

                                                        \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                      5. Taylor expanded in F around inf

                                                        \[\leadsto \frac{1 - x}{B} \]
                                                      6. Step-by-step derivation
                                                        1. Applied rewrites47.5%

                                                          \[\leadsto \frac{1 - x}{B} \]
                                                      7. Recombined 3 regimes into one program.
                                                      8. Add Preprocessing

                                                      Alternative 28: 36.7% accurate, 10.7× speedup?

                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq -3.1 \cdot 10^{-44}:\\ \;\;\;\;\frac{-1 - x}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x}{B}\\ \end{array} \end{array} \]
                                                      (FPCore (F B x)
                                                       :precision binary64
                                                       (if (<= F -3.1e-44) (/ (- -1.0 x) B) (/ (- x) B)))
                                                      double code(double F, double B, double x) {
                                                      	double tmp;
                                                      	if (F <= -3.1e-44) {
                                                      		tmp = (-1.0 - x) / B;
                                                      	} else {
                                                      		tmp = -x / B;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      module fmin_fmax_functions
                                                          implicit none
                                                          private
                                                          public fmax
                                                          public fmin
                                                      
                                                          interface fmax
                                                              module procedure fmax88
                                                              module procedure fmax44
                                                              module procedure fmax84
                                                              module procedure fmax48
                                                          end interface
                                                          interface fmin
                                                              module procedure fmin88
                                                              module procedure fmin44
                                                              module procedure fmin84
                                                              module procedure fmin48
                                                          end interface
                                                      contains
                                                          real(8) function fmax88(x, y) result (res)
                                                              real(8), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                          end function
                                                          real(4) function fmax44(x, y) result (res)
                                                              real(4), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmax84(x, y) result(res)
                                                              real(8), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmax48(x, y) result(res)
                                                              real(4), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin88(x, y) result (res)
                                                              real(8), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                          end function
                                                          real(4) function fmin44(x, y) result (res)
                                                              real(4), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin84(x, y) result(res)
                                                              real(8), intent (in) :: x
                                                              real(4), intent (in) :: y
                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                          end function
                                                          real(8) function fmin48(x, y) result(res)
                                                              real(4), intent (in) :: x
                                                              real(8), intent (in) :: y
                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                          end function
                                                      end module
                                                      
                                                      real(8) function code(f, b, x)
                                                      use fmin_fmax_functions
                                                          real(8), intent (in) :: f
                                                          real(8), intent (in) :: b
                                                          real(8), intent (in) :: x
                                                          real(8) :: tmp
                                                          if (f <= (-3.1d-44)) then
                                                              tmp = ((-1.0d0) - x) / b
                                                          else
                                                              tmp = -x / b
                                                          end if
                                                          code = tmp
                                                      end function
                                                      
                                                      public static double code(double F, double B, double x) {
                                                      	double tmp;
                                                      	if (F <= -3.1e-44) {
                                                      		tmp = (-1.0 - x) / B;
                                                      	} else {
                                                      		tmp = -x / B;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      def code(F, B, x):
                                                      	tmp = 0
                                                      	if F <= -3.1e-44:
                                                      		tmp = (-1.0 - x) / B
                                                      	else:
                                                      		tmp = -x / B
                                                      	return tmp
                                                      
                                                      function code(F, B, x)
                                                      	tmp = 0.0
                                                      	if (F <= -3.1e-44)
                                                      		tmp = Float64(Float64(-1.0 - x) / B);
                                                      	else
                                                      		tmp = Float64(Float64(-x) / B);
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      function tmp_2 = code(F, B, x)
                                                      	tmp = 0.0;
                                                      	if (F <= -3.1e-44)
                                                      		tmp = (-1.0 - x) / B;
                                                      	else
                                                      		tmp = -x / B;
                                                      	end
                                                      	tmp_2 = tmp;
                                                      end
                                                      
                                                      code[F_, B_, x_] := If[LessEqual[F, -3.1e-44], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
                                                      
                                                      \begin{array}{l}
                                                      
                                                      \\
                                                      \begin{array}{l}
                                                      \mathbf{if}\;F \leq -3.1 \cdot 10^{-44}:\\
                                                      \;\;\;\;\frac{-1 - x}{B}\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;\frac{-x}{B}\\
                                                      
                                                      
                                                      \end{array}
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Split input into 2 regimes
                                                      2. if F < -3.09999999999999984e-44

                                                        1. Initial program 62.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 rewrites40.8%

                                                          \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                        5. Taylor expanded in F around -inf

                                                          \[\leadsto \frac{-1 - x}{B} \]
                                                        6. Step-by-step derivation
                                                          1. Applied rewrites47.9%

                                                            \[\leadsto \frac{-1 - x}{B} \]

                                                          if -3.09999999999999984e-44 < F

                                                          1. Initial program 83.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 rewrites46.4%

                                                            \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                          5. Taylor expanded in F around 0

                                                            \[\leadsto \frac{-1 \cdot x}{B} \]
                                                          6. Step-by-step derivation
                                                            1. mul-1-negN/A

                                                              \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                            2. lower-neg.f6431.8

                                                              \[\leadsto \frac{-x}{B} \]
                                                          7. Applied rewrites31.8%

                                                            \[\leadsto \frac{-x}{B} \]
                                                        7. Recombined 2 regimes into one program.
                                                        8. Add Preprocessing

                                                        Alternative 29: 30.2% accurate, 21.7× speedup?

                                                        \[\begin{array}{l} \\ \frac{-x}{B} \end{array} \]
                                                        (FPCore (F B x) :precision binary64 (/ (- x) B))
                                                        double code(double F, double B, double x) {
                                                        	return -x / B;
                                                        }
                                                        
                                                        module fmin_fmax_functions
                                                            implicit none
                                                            private
                                                            public fmax
                                                            public fmin
                                                        
                                                            interface fmax
                                                                module procedure fmax88
                                                                module procedure fmax44
                                                                module procedure fmax84
                                                                module procedure fmax48
                                                            end interface
                                                            interface fmin
                                                                module procedure fmin88
                                                                module procedure fmin44
                                                                module procedure fmin84
                                                                module procedure fmin48
                                                            end interface
                                                        contains
                                                            real(8) function fmax88(x, y) result (res)
                                                                real(8), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                            end function
                                                            real(4) function fmax44(x, y) result (res)
                                                                real(4), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmax84(x, y) result(res)
                                                                real(8), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmax48(x, y) result(res)
                                                                real(4), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin88(x, y) result (res)
                                                                real(8), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                            end function
                                                            real(4) function fmin44(x, y) result (res)
                                                                real(4), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin84(x, y) result(res)
                                                                real(8), intent (in) :: x
                                                                real(4), intent (in) :: y
                                                                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                            end function
                                                            real(8) function fmin48(x, y) result(res)
                                                                real(4), intent (in) :: x
                                                                real(8), intent (in) :: y
                                                                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                            end function
                                                        end module
                                                        
                                                        real(8) function code(f, b, x)
                                                        use fmin_fmax_functions
                                                            real(8), intent (in) :: f
                                                            real(8), intent (in) :: b
                                                            real(8), intent (in) :: x
                                                            code = -x / b
                                                        end function
                                                        
                                                        public static double code(double F, double B, double x) {
                                                        	return -x / B;
                                                        }
                                                        
                                                        def code(F, B, x):
                                                        	return -x / B
                                                        
                                                        function code(F, B, x)
                                                        	return Float64(Float64(-x) / B)
                                                        end
                                                        
                                                        function tmp = code(F, B, x)
                                                        	tmp = -x / B;
                                                        end
                                                        
                                                        code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \frac{-x}{B}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Initial program 77.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 rewrites44.7%

                                                          \[\leadsto \color{blue}{\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}} \cdot F - x}{B}} \]
                                                        5. Taylor expanded in F around 0

                                                          \[\leadsto \frac{-1 \cdot x}{B} \]
                                                        6. Step-by-step derivation
                                                          1. mul-1-negN/A

                                                            \[\leadsto \frac{\mathsf{neg}\left(x\right)}{B} \]
                                                          2. lower-neg.f6430.2

                                                            \[\leadsto \frac{-x}{B} \]
                                                        7. Applied rewrites30.2%

                                                          \[\leadsto \frac{-x}{B} \]
                                                        8. Add Preprocessing

                                                        Reproduce

                                                        ?
                                                        herbie shell --seed 2025106 
                                                        (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))))))