rsin A (should all be same)

Percentage Accurate: 77.0% → 99.5%
Time: 6.0s
Alternatives: 21
Speedup: 1.2×

Specification

?
\[\begin{array}{l} \\ \frac{r \cdot \sin b}{\cos \left(a + b\right)} \end{array} \]
(FPCore (r a b) :precision binary64 (/ (* r (sin b)) (cos (+ a b))))
double code(double r, double a, double b) {
	return (r * sin(b)) / cos((a + 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(r, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: r
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = (r * sin(b)) / cos((a + b))
end function
public static double code(double r, double a, double b) {
	return (r * Math.sin(b)) / Math.cos((a + b));
}
def code(r, a, b):
	return (r * math.sin(b)) / math.cos((a + b))
function code(r, a, b)
	return Float64(Float64(r * sin(b)) / cos(Float64(a + b)))
end
function tmp = code(r, a, b)
	tmp = (r * sin(b)) / cos((a + b));
end
code[r_, a_, b_] := N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{r \cdot \sin b}{\cos \left(a + b\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 21 alternatives:

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

Initial Program: 77.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{r \cdot \sin b}{\cos \left(a + b\right)} \end{array} \]
(FPCore (r a b) :precision binary64 (/ (* r (sin b)) (cos (+ a b))))
double code(double r, double a, double b) {
	return (r * sin(b)) / cos((a + 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(r, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: r
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = (r * sin(b)) / cos((a + b))
end function
public static double code(double r, double a, double b) {
	return (r * Math.sin(b)) / Math.cos((a + b));
}
def code(r, a, b):
	return (r * math.sin(b)) / math.cos((a + b))
function code(r, a, b)
	return Float64(Float64(r * sin(b)) / cos(Float64(a + b)))
end
function tmp = code(r, a, b)
	tmp = (r * sin(b)) / cos((a + b));
end
code[r_, a_, b_] := N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{r \cdot \sin b}{\cos \left(a + b\right)}
\end{array}

Alternative 1: 99.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \cos b\right)} \end{array} \]
(FPCore (r a b)
 :precision binary64
 (/ (* r (sin b)) (fma (sin a) (- (sin b)) (* (cos a) (cos b)))))
double code(double r, double a, double b) {
	return (r * sin(b)) / fma(sin(a), -sin(b), (cos(a) * cos(b)));
}
function code(r, a, b)
	return Float64(Float64(r * sin(b)) / fma(sin(a), Float64(-sin(b)), Float64(cos(a) * cos(b))))
end
code[r_, a_, b_] := N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[(N[Sin[a], $MachinePrecision] * (-N[Sin[b], $MachinePrecision]) + N[(N[Cos[a], $MachinePrecision] * N[Cos[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \cos b\right)}
\end{array}
Derivation
  1. Initial program 77.0%

    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
  2. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
    2. lift-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
    3. +-commutativeN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
    4. cos-sumN/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
    5. cos-neg-revN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
    6. mul-1-negN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
    7. lower--.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
    8. mul-1-negN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
    9. cos-neg-revN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
    10. lower-*.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
    11. lower-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
    12. lower-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
    13. lower-*.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
    14. lift-sin.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
    15. lower-sin.f6499.5

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
  3. Applied rewrites99.5%

    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
  4. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
    3. lift-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
    4. lift-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
    5. lift-*.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
    6. lift-sin.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
    7. lift-sin.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
    8. fp-cancel-sub-sign-invN/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}} \]
    9. lower-fma.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)}} \]
    10. lift-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
    11. lift-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
    12. lower-*.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}\right)} \]
    13. lower-neg.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(-\sin b\right)} \cdot \sin a\right)} \]
    14. lift-sin.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\color{blue}{\sin b}\right) \cdot \sin a\right)} \]
    15. lift-sin.f6499.5

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \color{blue}{\sin a}\right)} \]
  5. Applied rewrites99.5%

    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
  6. Step-by-step derivation
    1. lift-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
    2. lift-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(-\sin b\right) \cdot \sin a\right)} \]
    3. lift-fma.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(-\sin b\right) \cdot \sin a}} \]
    4. lift-*.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \color{blue}{\left(-\sin b\right) \cdot \sin a}} \]
    5. lift-neg.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right)} \cdot \sin a} \]
    6. lift-sin.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\color{blue}{\sin b}\right)\right) \cdot \sin a} \]
    7. lift-sin.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \color{blue}{\sin a}} \]
    8. +-commutativeN/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a + \cos b \cdot \cos a}} \]
    9. mul-1-negN/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\left(-1 \cdot \sin b\right)} \cdot \sin a + \cos b \cdot \cos a} \]
    10. *-commutativeN/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\sin a \cdot \left(-1 \cdot \sin b\right)} + \cos b \cdot \cos a} \]
    11. lower-fma.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\sin a, -1 \cdot \sin b, \cos b \cdot \cos a\right)}} \]
    12. lift-sin.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\sin a}, -1 \cdot \sin b, \cos b \cdot \cos a\right)} \]
    13. mul-1-negN/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \color{blue}{\mathsf{neg}\left(\sin b\right)}, \cos b \cdot \cos a\right)} \]
    14. lift-sin.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \mathsf{neg}\left(\color{blue}{\sin b}\right), \cos b \cdot \cos a\right)} \]
    15. lift-neg.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \color{blue}{-\sin b}, \cos b \cdot \cos a\right)} \]
    16. *-commutativeN/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a \cdot \cos b}\right)} \]
    17. lower-*.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a \cdot \cos b}\right)} \]
    18. lift-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a} \cdot \cos b\right)} \]
    19. lift-cos.f6499.5

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \color{blue}{\cos b}\right)} \]
  7. Applied rewrites99.5%

    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \cos b\right)}} \]
  8. Add Preprocessing

Alternative 2: 99.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \end{array} \]
(FPCore (r a b)
 :precision binary64
 (/ (* r (sin b)) (fma (cos b) (cos a) (* (- (sin b)) (sin a)))))
double code(double r, double a, double b) {
	return (r * sin(b)) / fma(cos(b), cos(a), (-sin(b) * sin(a)));
}
function code(r, a, b)
	return Float64(Float64(r * sin(b)) / fma(cos(b), cos(a), Float64(Float64(-sin(b)) * sin(a))))
end
code[r_, a_, b_] := N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[b], $MachinePrecision] * N[Cos[a], $MachinePrecision] + N[((-N[Sin[b], $MachinePrecision]) * N[Sin[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}
\end{array}
Derivation
  1. Initial program 77.0%

    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
  2. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
    2. lift-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
    3. +-commutativeN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
    4. cos-sumN/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
    5. cos-neg-revN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
    6. mul-1-negN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
    7. lower--.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
    8. mul-1-negN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
    9. cos-neg-revN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
    10. lower-*.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
    11. lower-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
    12. lower-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
    13. lower-*.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
    14. lift-sin.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
    15. lower-sin.f6499.5

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
  3. Applied rewrites99.5%

    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
  4. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
    3. lift-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
    4. lift-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
    5. lift-*.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
    6. lift-sin.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
    7. lift-sin.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
    8. fp-cancel-sub-sign-invN/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}} \]
    9. lower-fma.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)}} \]
    10. lift-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
    11. lift-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
    12. lower-*.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}\right)} \]
    13. lower-neg.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(-\sin b\right)} \cdot \sin a\right)} \]
    14. lift-sin.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\color{blue}{\sin b}\right) \cdot \sin a\right)} \]
    15. lift-sin.f6499.5

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \color{blue}{\sin a}\right)} \]
  5. Applied rewrites99.5%

    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
  6. Add Preprocessing

Alternative 3: 99.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \frac{\sin b \cdot r}{\cos b \cdot \cos a - \sin b \cdot \sin a} \end{array} \]
(FPCore (r a b)
 :precision binary64
 (/ (* (sin b) r) (- (* (cos b) (cos a)) (* (sin b) (sin a)))))
double code(double r, double a, double b) {
	return (sin(b) * r) / ((cos(b) * cos(a)) - (sin(b) * sin(a)));
}
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(r, a, b)
use fmin_fmax_functions
    real(8), intent (in) :: r
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = (sin(b) * r) / ((cos(b) * cos(a)) - (sin(b) * sin(a)))
end function
public static double code(double r, double a, double b) {
	return (Math.sin(b) * r) / ((Math.cos(b) * Math.cos(a)) - (Math.sin(b) * Math.sin(a)));
}
def code(r, a, b):
	return (math.sin(b) * r) / ((math.cos(b) * math.cos(a)) - (math.sin(b) * math.sin(a)))
function code(r, a, b)
	return Float64(Float64(sin(b) * r) / Float64(Float64(cos(b) * cos(a)) - Float64(sin(b) * sin(a))))
end
function tmp = code(r, a, b)
	tmp = (sin(b) * r) / ((cos(b) * cos(a)) - (sin(b) * sin(a)));
end
code[r_, a_, b_] := N[(N[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision] / N[(N[(N[Cos[b], $MachinePrecision] * N[Cos[a], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[b], $MachinePrecision] * N[Sin[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\sin b \cdot r}{\cos b \cdot \cos a - \sin b \cdot \sin a}
\end{array}
Derivation
  1. Initial program 77.0%

    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
  2. Step-by-step derivation
    1. lift-+.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
    2. lift-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
    3. +-commutativeN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
    4. cos-sumN/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
    5. cos-neg-revN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
    6. mul-1-negN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
    7. lower--.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
    8. mul-1-negN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
    9. cos-neg-revN/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
    10. lower-*.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
    11. lower-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
    12. lower-cos.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
    13. lower-*.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
    14. lift-sin.f64N/A

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
    15. lower-sin.f6499.5

      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
  3. Applied rewrites99.5%

    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
  4. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{r \cdot \sin b}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
    2. lift-sin.f64N/A

      \[\leadsto \frac{r \cdot \color{blue}{\sin b}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
    3. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{\sin b \cdot r}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
    4. lift-sin.f64N/A

      \[\leadsto \frac{\color{blue}{\sin b} \cdot r}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
    5. lift-*.f6499.5

      \[\leadsto \frac{\color{blue}{\sin b \cdot r}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
  5. Applied rewrites99.5%

    \[\leadsto \frac{\color{blue}{\sin b \cdot r}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
  6. Add Preprocessing

Alternative 4: 78.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := r \cdot \sin b\\ t_1 := \frac{t\_0}{\mathsf{fma}\left(\sin a, -\sin b, 1 \cdot \cos b\right)}\\ \mathbf{if}\;b \leq -105000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 4:\\ \;\;\;\;\frac{t\_0}{\mathsf{fma}\left(\cos b, \cos a, \left(\left(\mathsf{fma}\left(0.0001984126984126984 \cdot \left(b \cdot b\right) - 0.008333333333333333, b \cdot b, 0.16666666666666666\right) \cdot \left(b \cdot b\right) - 1\right) \cdot b\right) \cdot \sin a\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (r a b)
 :precision binary64
 (let* ((t_0 (* r (sin b)))
        (t_1 (/ t_0 (fma (sin a) (- (sin b)) (* 1.0 (cos b))))))
   (if (<= b -105000000000.0)
     t_1
     (if (<= b 4.0)
       (/
        t_0
        (fma
         (cos b)
         (cos a)
         (*
          (*
           (-
            (*
             (fma
              (- (* 0.0001984126984126984 (* b b)) 0.008333333333333333)
              (* b b)
              0.16666666666666666)
             (* b b))
            1.0)
           b)
          (sin a))))
       t_1))))
double code(double r, double a, double b) {
	double t_0 = r * sin(b);
	double t_1 = t_0 / fma(sin(a), -sin(b), (1.0 * cos(b)));
	double tmp;
	if (b <= -105000000000.0) {
		tmp = t_1;
	} else if (b <= 4.0) {
		tmp = t_0 / fma(cos(b), cos(a), ((((fma(((0.0001984126984126984 * (b * b)) - 0.008333333333333333), (b * b), 0.16666666666666666) * (b * b)) - 1.0) * b) * sin(a)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(r, a, b)
	t_0 = Float64(r * sin(b))
	t_1 = Float64(t_0 / fma(sin(a), Float64(-sin(b)), Float64(1.0 * cos(b))))
	tmp = 0.0
	if (b <= -105000000000.0)
		tmp = t_1;
	elseif (b <= 4.0)
		tmp = Float64(t_0 / fma(cos(b), cos(a), Float64(Float64(Float64(Float64(fma(Float64(Float64(0.0001984126984126984 * Float64(b * b)) - 0.008333333333333333), Float64(b * b), 0.16666666666666666) * Float64(b * b)) - 1.0) * b) * sin(a))));
	else
		tmp = t_1;
	end
	return tmp
end
code[r_, a_, b_] := Block[{t$95$0 = N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(N[Sin[a], $MachinePrecision] * (-N[Sin[b], $MachinePrecision]) + N[(1.0 * N[Cos[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -105000000000.0], t$95$1, If[LessEqual[b, 4.0], N[(t$95$0 / N[(N[Cos[b], $MachinePrecision] * N[Cos[a], $MachinePrecision] + N[(N[(N[(N[(N[(N[(N[(0.0001984126984126984 * N[(b * b), $MachinePrecision]), $MachinePrecision] - 0.008333333333333333), $MachinePrecision] * N[(b * b), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] * b), $MachinePrecision] * N[Sin[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := r \cdot \sin b\\
t_1 := \frac{t\_0}{\mathsf{fma}\left(\sin a, -\sin b, 1 \cdot \cos b\right)}\\
\mathbf{if}\;b \leq -105000000000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 4:\\
\;\;\;\;\frac{t\_0}{\mathsf{fma}\left(\cos b, \cos a, \left(\left(\mathsf{fma}\left(0.0001984126984126984 \cdot \left(b \cdot b\right) - 0.008333333333333333, b \cdot b, 0.16666666666666666\right) \cdot \left(b \cdot b\right) - 1\right) \cdot b\right) \cdot \sin a\right)}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.05e11 or 4 < b

    1. Initial program 77.0%

      \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
      2. lift-cos.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
      3. +-commutativeN/A

        \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
      4. cos-sumN/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
      5. cos-neg-revN/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
      6. mul-1-negN/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
      7. lower--.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
      8. mul-1-negN/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
      9. cos-neg-revN/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
      11. lower-cos.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
      12. lower-cos.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
      14. lift-sin.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
      15. lower-sin.f6499.5

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
    3. Applied rewrites99.5%

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
    4. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
      2. lift-*.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
      3. lift-cos.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
      4. lift-cos.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
      6. lift-sin.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
      7. lift-sin.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
      8. fp-cancel-sub-sign-invN/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}} \]
      9. lower-fma.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)}} \]
      10. lift-cos.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
      11. lift-cos.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}\right)} \]
      13. lower-neg.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(-\sin b\right)} \cdot \sin a\right)} \]
      14. lift-sin.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\color{blue}{\sin b}\right) \cdot \sin a\right)} \]
      15. lift-sin.f6499.5

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \color{blue}{\sin a}\right)} \]
    5. Applied rewrites99.5%

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
    6. Step-by-step derivation
      1. lift-cos.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
      2. lift-cos.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(-\sin b\right) \cdot \sin a\right)} \]
      3. lift-fma.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(-\sin b\right) \cdot \sin a}} \]
      4. lift-*.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \color{blue}{\left(-\sin b\right) \cdot \sin a}} \]
      5. lift-neg.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right)} \cdot \sin a} \]
      6. lift-sin.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\color{blue}{\sin b}\right)\right) \cdot \sin a} \]
      7. lift-sin.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \color{blue}{\sin a}} \]
      8. +-commutativeN/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a + \cos b \cdot \cos a}} \]
      9. mul-1-negN/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\left(-1 \cdot \sin b\right)} \cdot \sin a + \cos b \cdot \cos a} \]
      10. *-commutativeN/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\sin a \cdot \left(-1 \cdot \sin b\right)} + \cos b \cdot \cos a} \]
      11. lower-fma.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\sin a, -1 \cdot \sin b, \cos b \cdot \cos a\right)}} \]
      12. lift-sin.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\sin a}, -1 \cdot \sin b, \cos b \cdot \cos a\right)} \]
      13. mul-1-negN/A

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \color{blue}{\mathsf{neg}\left(\sin b\right)}, \cos b \cdot \cos a\right)} \]
      14. lift-sin.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \mathsf{neg}\left(\color{blue}{\sin b}\right), \cos b \cdot \cos a\right)} \]
      15. lift-neg.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \color{blue}{-\sin b}, \cos b \cdot \cos a\right)} \]
      16. *-commutativeN/A

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a \cdot \cos b}\right)} \]
      17. lower-*.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a \cdot \cos b}\right)} \]
      18. lift-cos.f64N/A

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a} \cdot \cos b\right)} \]
      19. lift-cos.f6499.5

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \color{blue}{\cos b}\right)} \]
    7. Applied rewrites99.5%

      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \cos b\right)}} \]
    8. Taylor expanded in a around 0

      \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{1} \cdot \cos b\right)} \]
    9. Step-by-step derivation
      1. Applied rewrites61.3%

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{1} \cdot \cos b\right)} \]

      if -1.05e11 < b < 4

      1. Initial program 77.0%

        \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
      2. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
        2. lift-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
        3. +-commutativeN/A

          \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
        4. cos-sumN/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
        5. cos-neg-revN/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
        6. mul-1-negN/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
        7. lower--.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
        8. mul-1-negN/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
        9. cos-neg-revN/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
        10. lower-*.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
        11. lower-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
        12. lower-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
        13. lower-*.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
        14. lift-sin.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
        15. lower-sin.f6499.5

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
      3. Applied rewrites99.5%

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
      4. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
        3. lift-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
        4. lift-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
        5. lift-*.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
        6. lift-sin.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
        7. lift-sin.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
        8. fp-cancel-sub-sign-invN/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}} \]
        9. lower-fma.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)}} \]
        10. lift-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
        11. lift-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
        12. lower-*.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}\right)} \]
        13. lower-neg.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(-\sin b\right)} \cdot \sin a\right)} \]
        14. lift-sin.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\color{blue}{\sin b}\right) \cdot \sin a\right)} \]
        15. lift-sin.f6499.5

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \color{blue}{\sin a}\right)} \]
      5. Applied rewrites99.5%

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
      6. Taylor expanded in b around 0

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(b \cdot \left({b}^{2} \cdot \left(\frac{1}{6} + {b}^{2} \cdot \left(\frac{1}{5040} \cdot {b}^{2} - \frac{1}{120}\right)\right) - 1\right)\right)} \cdot \sin a\right)} \]
      7. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(\left({b}^{2} \cdot \left(\frac{1}{6} + {b}^{2} \cdot \left(\frac{1}{5040} \cdot {b}^{2} - \frac{1}{120}\right)\right) - 1\right) \cdot \color{blue}{b}\right) \cdot \sin a\right)} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(\left({b}^{2} \cdot \left(\frac{1}{6} + {b}^{2} \cdot \left(\frac{1}{5040} \cdot {b}^{2} - \frac{1}{120}\right)\right) - 1\right) \cdot \color{blue}{b}\right) \cdot \sin a\right)} \]
      8. Applied rewrites54.4%

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(\left(\mathsf{fma}\left(0.0001984126984126984 \cdot \left(b \cdot b\right) - 0.008333333333333333, b \cdot b, 0.16666666666666666\right) \cdot \left(b \cdot b\right) - 1\right) \cdot b\right)} \cdot \sin a\right)} \]
    10. Recombined 2 regimes into one program.
    11. Add Preprocessing

    Alternative 5: 78.5% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, 1 \cdot \cos b\right)}\\ t_1 := \mathsf{fma}\left(\mathsf{fma}\left(b \cdot b, -0.0001984126984126984, 0.008333333333333333\right) \cdot \left(b \cdot b\right) - 0.16666666666666666, b \cdot b, 1\right) \cdot b\\ \mathbf{if}\;b \leq -0.5:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 0.62:\\ \;\;\;\;\frac{r \cdot t\_1}{\cos b \cdot \cos a - t\_1 \cdot \sin a}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (r a b)
     :precision binary64
     (let* ((t_0 (/ (* r (sin b)) (fma (sin a) (- (sin b)) (* 1.0 (cos b)))))
            (t_1
             (*
              (fma
               (-
                (*
                 (fma (* b b) -0.0001984126984126984 0.008333333333333333)
                 (* b b))
                0.16666666666666666)
               (* b b)
               1.0)
              b)))
       (if (<= b -0.5)
         t_0
         (if (<= b 0.62)
           (/ (* r t_1) (- (* (cos b) (cos a)) (* t_1 (sin a))))
           t_0))))
    double code(double r, double a, double b) {
    	double t_0 = (r * sin(b)) / fma(sin(a), -sin(b), (1.0 * cos(b)));
    	double t_1 = fma(((fma((b * b), -0.0001984126984126984, 0.008333333333333333) * (b * b)) - 0.16666666666666666), (b * b), 1.0) * b;
    	double tmp;
    	if (b <= -0.5) {
    		tmp = t_0;
    	} else if (b <= 0.62) {
    		tmp = (r * t_1) / ((cos(b) * cos(a)) - (t_1 * sin(a)));
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    function code(r, a, b)
    	t_0 = Float64(Float64(r * sin(b)) / fma(sin(a), Float64(-sin(b)), Float64(1.0 * cos(b))))
    	t_1 = Float64(fma(Float64(Float64(fma(Float64(b * b), -0.0001984126984126984, 0.008333333333333333) * Float64(b * b)) - 0.16666666666666666), Float64(b * b), 1.0) * b)
    	tmp = 0.0
    	if (b <= -0.5)
    		tmp = t_0;
    	elseif (b <= 0.62)
    		tmp = Float64(Float64(r * t_1) / Float64(Float64(cos(b) * cos(a)) - Float64(t_1 * sin(a))));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    code[r_, a_, b_] := Block[{t$95$0 = N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[(N[Sin[a], $MachinePrecision] * (-N[Sin[b], $MachinePrecision]) + N[(1.0 * N[Cos[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(N[(b * b), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * N[(b * b), $MachinePrecision] + 1.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -0.5], t$95$0, If[LessEqual[b, 0.62], N[(N[(r * t$95$1), $MachinePrecision] / N[(N[(N[Cos[b], $MachinePrecision] * N[Cos[a], $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[Sin[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, 1 \cdot \cos b\right)}\\
    t_1 := \mathsf{fma}\left(\mathsf{fma}\left(b \cdot b, -0.0001984126984126984, 0.008333333333333333\right) \cdot \left(b \cdot b\right) - 0.16666666666666666, b \cdot b, 1\right) \cdot b\\
    \mathbf{if}\;b \leq -0.5:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;b \leq 0.62:\\
    \;\;\;\;\frac{r \cdot t\_1}{\cos b \cdot \cos a - t\_1 \cdot \sin a}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < -0.5 or 0.619999999999999996 < b

      1. Initial program 77.0%

        \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
      2. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
        2. lift-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
        3. +-commutativeN/A

          \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
        4. cos-sumN/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
        5. cos-neg-revN/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
        6. mul-1-negN/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
        7. lower--.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
        8. mul-1-negN/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
        9. cos-neg-revN/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
        10. lower-*.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
        11. lower-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
        12. lower-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
        13. lower-*.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
        14. lift-sin.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
        15. lower-sin.f6499.5

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
      3. Applied rewrites99.5%

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
      4. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
        3. lift-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
        4. lift-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
        5. lift-*.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
        6. lift-sin.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
        7. lift-sin.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
        8. fp-cancel-sub-sign-invN/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}} \]
        9. lower-fma.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)}} \]
        10. lift-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
        11. lift-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
        12. lower-*.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}\right)} \]
        13. lower-neg.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(-\sin b\right)} \cdot \sin a\right)} \]
        14. lift-sin.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\color{blue}{\sin b}\right) \cdot \sin a\right)} \]
        15. lift-sin.f6499.5

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \color{blue}{\sin a}\right)} \]
      5. Applied rewrites99.5%

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
      6. Step-by-step derivation
        1. lift-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
        2. lift-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(-\sin b\right) \cdot \sin a\right)} \]
        3. lift-fma.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(-\sin b\right) \cdot \sin a}} \]
        4. lift-*.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \color{blue}{\left(-\sin b\right) \cdot \sin a}} \]
        5. lift-neg.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right)} \cdot \sin a} \]
        6. lift-sin.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\color{blue}{\sin b}\right)\right) \cdot \sin a} \]
        7. lift-sin.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \color{blue}{\sin a}} \]
        8. +-commutativeN/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a + \cos b \cdot \cos a}} \]
        9. mul-1-negN/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\left(-1 \cdot \sin b\right)} \cdot \sin a + \cos b \cdot \cos a} \]
        10. *-commutativeN/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\sin a \cdot \left(-1 \cdot \sin b\right)} + \cos b \cdot \cos a} \]
        11. lower-fma.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\sin a, -1 \cdot \sin b, \cos b \cdot \cos a\right)}} \]
        12. lift-sin.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\sin a}, -1 \cdot \sin b, \cos b \cdot \cos a\right)} \]
        13. mul-1-negN/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \color{blue}{\mathsf{neg}\left(\sin b\right)}, \cos b \cdot \cos a\right)} \]
        14. lift-sin.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \mathsf{neg}\left(\color{blue}{\sin b}\right), \cos b \cdot \cos a\right)} \]
        15. lift-neg.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \color{blue}{-\sin b}, \cos b \cdot \cos a\right)} \]
        16. *-commutativeN/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a \cdot \cos b}\right)} \]
        17. lower-*.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a \cdot \cos b}\right)} \]
        18. lift-cos.f64N/A

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a} \cdot \cos b\right)} \]
        19. lift-cos.f6499.5

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \color{blue}{\cos b}\right)} \]
      7. Applied rewrites99.5%

        \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \cos b\right)}} \]
      8. Taylor expanded in a around 0

        \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{1} \cdot \cos b\right)} \]
      9. Step-by-step derivation
        1. Applied rewrites61.3%

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{1} \cdot \cos b\right)} \]

        if -0.5 < b < 0.619999999999999996

        1. Initial program 77.0%

          \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
        2. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
          2. lift-cos.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
          3. +-commutativeN/A

            \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
          4. cos-sumN/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
          5. cos-neg-revN/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
          6. mul-1-negN/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
          7. lower--.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
          8. mul-1-negN/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
          9. cos-neg-revN/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
          10. lower-*.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
          11. lower-cos.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
          12. lower-cos.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
          13. lower-*.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
          14. lift-sin.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
          15. lower-sin.f6499.5

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
        3. Applied rewrites99.5%

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
        4. Taylor expanded in b around 0

          \[\leadsto \frac{r \cdot \color{blue}{\left(b \cdot \left(1 + {b}^{2} \cdot \left({b}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {b}^{2}\right) - \frac{1}{6}\right)\right)\right)}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
        5. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{r \cdot \left(\left(1 + {b}^{2} \cdot \left({b}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {b}^{2}\right) - \frac{1}{6}\right)\right) \cdot \color{blue}{b}\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
          2. lower-*.f64N/A

            \[\leadsto \frac{r \cdot \left(\left(1 + {b}^{2} \cdot \left({b}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {b}^{2}\right) - \frac{1}{6}\right)\right) \cdot \color{blue}{b}\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
        6. Applied rewrites52.1%

          \[\leadsto \frac{r \cdot \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(b \cdot b, -0.0001984126984126984, 0.008333333333333333\right) \cdot \left(b \cdot b\right) - 0.16666666666666666, b \cdot b, 1\right) \cdot b\right)}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
        7. Taylor expanded in b around 0

          \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(b \cdot b, \frac{-1}{5040}, \frac{1}{120}\right) \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \color{blue}{\left(b \cdot \left(1 + {b}^{2} \cdot \left({b}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {b}^{2}\right) - \frac{1}{6}\right)\right)\right)} \cdot \sin a} \]
        8. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(b \cdot b, \frac{-1}{5040}, \frac{1}{120}\right) \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\left(1 + {b}^{2} \cdot \left({b}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {b}^{2}\right) - \frac{1}{6}\right)\right) \cdot \color{blue}{b}\right) \cdot \sin a} \]
          2. lower-*.f64N/A

            \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(b \cdot b, \frac{-1}{5040}, \frac{1}{120}\right) \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\left(1 + {b}^{2} \cdot \left({b}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {b}^{2}\right) - \frac{1}{6}\right)\right) \cdot \color{blue}{b}\right) \cdot \sin a} \]
        9. Applied rewrites51.5%

          \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(b \cdot b, -0.0001984126984126984, 0.008333333333333333\right) \cdot \left(b \cdot b\right) - 0.16666666666666666, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(b \cdot b, -0.0001984126984126984, 0.008333333333333333\right) \cdot \left(b \cdot b\right) - 0.16666666666666666, b \cdot b, 1\right) \cdot b\right)} \cdot \sin a} \]
      10. Recombined 2 regimes into one program.
      11. Add Preprocessing

      Alternative 6: 78.5% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := r \cdot \sin b\\ t_1 := \frac{t\_0}{\mathsf{fma}\left(\sin a, -\sin b, 1 \cdot \cos b\right)}\\ \mathbf{if}\;b \leq -105000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 7:\\ \;\;\;\;\frac{t\_0}{\mathsf{fma}\left(\cos b, \cos a, \left(\left(\mathsf{fma}\left(-0.008333333333333333, b \cdot b, 0.16666666666666666\right) \cdot \left(b \cdot b\right) - 1\right) \cdot b\right) \cdot \sin a\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (r a b)
       :precision binary64
       (let* ((t_0 (* r (sin b)))
              (t_1 (/ t_0 (fma (sin a) (- (sin b)) (* 1.0 (cos b))))))
         (if (<= b -105000000000.0)
           t_1
           (if (<= b 7.0)
             (/
              t_0
              (fma
               (cos b)
               (cos a)
               (*
                (*
                 (-
                  (* (fma -0.008333333333333333 (* b b) 0.16666666666666666) (* b b))
                  1.0)
                 b)
                (sin a))))
             t_1))))
      double code(double r, double a, double b) {
      	double t_0 = r * sin(b);
      	double t_1 = t_0 / fma(sin(a), -sin(b), (1.0 * cos(b)));
      	double tmp;
      	if (b <= -105000000000.0) {
      		tmp = t_1;
      	} else if (b <= 7.0) {
      		tmp = t_0 / fma(cos(b), cos(a), ((((fma(-0.008333333333333333, (b * b), 0.16666666666666666) * (b * b)) - 1.0) * b) * sin(a)));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(r, a, b)
      	t_0 = Float64(r * sin(b))
      	t_1 = Float64(t_0 / fma(sin(a), Float64(-sin(b)), Float64(1.0 * cos(b))))
      	tmp = 0.0
      	if (b <= -105000000000.0)
      		tmp = t_1;
      	elseif (b <= 7.0)
      		tmp = Float64(t_0 / fma(cos(b), cos(a), Float64(Float64(Float64(Float64(fma(-0.008333333333333333, Float64(b * b), 0.16666666666666666) * Float64(b * b)) - 1.0) * b) * sin(a))));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[r_, a_, b_] := Block[{t$95$0 = N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(N[Sin[a], $MachinePrecision] * (-N[Sin[b], $MachinePrecision]) + N[(1.0 * N[Cos[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -105000000000.0], t$95$1, If[LessEqual[b, 7.0], N[(t$95$0 / N[(N[Cos[b], $MachinePrecision] * N[Cos[a], $MachinePrecision] + N[(N[(N[(N[(N[(-0.008333333333333333 * N[(b * b), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] * b), $MachinePrecision] * N[Sin[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := r \cdot \sin b\\
      t_1 := \frac{t\_0}{\mathsf{fma}\left(\sin a, -\sin b, 1 \cdot \cos b\right)}\\
      \mathbf{if}\;b \leq -105000000000:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;b \leq 7:\\
      \;\;\;\;\frac{t\_0}{\mathsf{fma}\left(\cos b, \cos a, \left(\left(\mathsf{fma}\left(-0.008333333333333333, b \cdot b, 0.16666666666666666\right) \cdot \left(b \cdot b\right) - 1\right) \cdot b\right) \cdot \sin a\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if b < -1.05e11 or 7 < b

        1. Initial program 77.0%

          \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
        2. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
          2. lift-cos.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
          3. +-commutativeN/A

            \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
          4. cos-sumN/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
          5. cos-neg-revN/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
          6. mul-1-negN/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
          7. lower--.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
          8. mul-1-negN/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
          9. cos-neg-revN/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
          10. lower-*.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
          11. lower-cos.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
          12. lower-cos.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
          13. lower-*.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
          14. lift-sin.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
          15. lower-sin.f6499.5

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
        3. Applied rewrites99.5%

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
        4. Step-by-step derivation
          1. lift--.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
          2. lift-*.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
          3. lift-cos.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
          4. lift-cos.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
          5. lift-*.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
          6. lift-sin.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
          7. lift-sin.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
          8. fp-cancel-sub-sign-invN/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}} \]
          9. lower-fma.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)}} \]
          10. lift-cos.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
          11. lift-cos.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
          12. lower-*.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}\right)} \]
          13. lower-neg.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(-\sin b\right)} \cdot \sin a\right)} \]
          14. lift-sin.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\color{blue}{\sin b}\right) \cdot \sin a\right)} \]
          15. lift-sin.f6499.5

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \color{blue}{\sin a}\right)} \]
        5. Applied rewrites99.5%

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
        6. Step-by-step derivation
          1. lift-cos.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
          2. lift-cos.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(-\sin b\right) \cdot \sin a\right)} \]
          3. lift-fma.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(-\sin b\right) \cdot \sin a}} \]
          4. lift-*.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \color{blue}{\left(-\sin b\right) \cdot \sin a}} \]
          5. lift-neg.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right)} \cdot \sin a} \]
          6. lift-sin.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\color{blue}{\sin b}\right)\right) \cdot \sin a} \]
          7. lift-sin.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \color{blue}{\sin a}} \]
          8. +-commutativeN/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a + \cos b \cdot \cos a}} \]
          9. mul-1-negN/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\left(-1 \cdot \sin b\right)} \cdot \sin a + \cos b \cdot \cos a} \]
          10. *-commutativeN/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\sin a \cdot \left(-1 \cdot \sin b\right)} + \cos b \cdot \cos a} \]
          11. lower-fma.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\sin a, -1 \cdot \sin b, \cos b \cdot \cos a\right)}} \]
          12. lift-sin.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\sin a}, -1 \cdot \sin b, \cos b \cdot \cos a\right)} \]
          13. mul-1-negN/A

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \color{blue}{\mathsf{neg}\left(\sin b\right)}, \cos b \cdot \cos a\right)} \]
          14. lift-sin.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \mathsf{neg}\left(\color{blue}{\sin b}\right), \cos b \cdot \cos a\right)} \]
          15. lift-neg.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \color{blue}{-\sin b}, \cos b \cdot \cos a\right)} \]
          16. *-commutativeN/A

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a \cdot \cos b}\right)} \]
          17. lower-*.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a \cdot \cos b}\right)} \]
          18. lift-cos.f64N/A

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a} \cdot \cos b\right)} \]
          19. lift-cos.f6499.5

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \color{blue}{\cos b}\right)} \]
        7. Applied rewrites99.5%

          \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \cos b\right)}} \]
        8. Taylor expanded in a around 0

          \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{1} \cdot \cos b\right)} \]
        9. Step-by-step derivation
          1. Applied rewrites61.3%

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{1} \cdot \cos b\right)} \]

          if -1.05e11 < b < 7

          1. Initial program 77.0%

            \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
          2. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
            2. lift-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
            3. +-commutativeN/A

              \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
            4. cos-sumN/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
            5. cos-neg-revN/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
            6. mul-1-negN/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
            7. lower--.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
            8. mul-1-negN/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
            9. cos-neg-revN/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
            10. lower-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
            11. lower-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
            12. lower-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
            13. lower-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
            14. lift-sin.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
            15. lower-sin.f6499.5

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
          3. Applied rewrites99.5%

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
          4. Step-by-step derivation
            1. lift--.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
            3. lift-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
            4. lift-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
            5. lift-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
            6. lift-sin.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
            7. lift-sin.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
            8. fp-cancel-sub-sign-invN/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}} \]
            9. lower-fma.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)}} \]
            10. lift-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
            11. lift-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
            12. lower-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}\right)} \]
            13. lower-neg.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(-\sin b\right)} \cdot \sin a\right)} \]
            14. lift-sin.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\color{blue}{\sin b}\right) \cdot \sin a\right)} \]
            15. lift-sin.f6499.5

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \color{blue}{\sin a}\right)} \]
          5. Applied rewrites99.5%

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
          6. Taylor expanded in b around 0

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(b \cdot \left({b}^{2} \cdot \left(\frac{1}{6} + \frac{-1}{120} \cdot {b}^{2}\right) - 1\right)\right)} \cdot \sin a\right)} \]
          7. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(\left({b}^{2} \cdot \left(\frac{1}{6} + \frac{-1}{120} \cdot {b}^{2}\right) - 1\right) \cdot \color{blue}{b}\right) \cdot \sin a\right)} \]
            2. lower-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(\left({b}^{2} \cdot \left(\frac{1}{6} + \frac{-1}{120} \cdot {b}^{2}\right) - 1\right) \cdot \color{blue}{b}\right) \cdot \sin a\right)} \]
            3. lower--.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(\left({b}^{2} \cdot \left(\frac{1}{6} + \frac{-1}{120} \cdot {b}^{2}\right) - 1\right) \cdot b\right) \cdot \sin a\right)} \]
            4. *-commutativeN/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(\left(\left(\frac{1}{6} + \frac{-1}{120} \cdot {b}^{2}\right) \cdot {b}^{2} - 1\right) \cdot b\right) \cdot \sin a\right)} \]
            5. lower-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(\left(\left(\frac{1}{6} + \frac{-1}{120} \cdot {b}^{2}\right) \cdot {b}^{2} - 1\right) \cdot b\right) \cdot \sin a\right)} \]
            6. +-commutativeN/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(\left(\left(\frac{-1}{120} \cdot {b}^{2} + \frac{1}{6}\right) \cdot {b}^{2} - 1\right) \cdot b\right) \cdot \sin a\right)} \]
            7. lower-fma.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(\left(\mathsf{fma}\left(\frac{-1}{120}, {b}^{2}, \frac{1}{6}\right) \cdot {b}^{2} - 1\right) \cdot b\right) \cdot \sin a\right)} \]
            8. pow2N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(\left(\mathsf{fma}\left(\frac{-1}{120}, b \cdot b, \frac{1}{6}\right) \cdot {b}^{2} - 1\right) \cdot b\right) \cdot \sin a\right)} \]
            9. lift-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(\left(\mathsf{fma}\left(\frac{-1}{120}, b \cdot b, \frac{1}{6}\right) \cdot {b}^{2} - 1\right) \cdot b\right) \cdot \sin a\right)} \]
            10. pow2N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(\left(\mathsf{fma}\left(\frac{-1}{120}, b \cdot b, \frac{1}{6}\right) \cdot \left(b \cdot b\right) - 1\right) \cdot b\right) \cdot \sin a\right)} \]
            11. lift-*.f6454.9

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(\left(\mathsf{fma}\left(-0.008333333333333333, b \cdot b, 0.16666666666666666\right) \cdot \left(b \cdot b\right) - 1\right) \cdot b\right) \cdot \sin a\right)} \]
          8. Applied rewrites54.9%

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(\left(\mathsf{fma}\left(-0.008333333333333333, b \cdot b, 0.16666666666666666\right) \cdot \left(b \cdot b\right) - 1\right) \cdot b\right)} \cdot \sin a\right)} \]
        10. Recombined 2 regimes into one program.
        11. Add Preprocessing

        Alternative 7: 78.5% accurate, 0.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, 1 \cdot \cos b\right)}\\ t_1 := \mathsf{fma}\left(0.008333333333333333 \cdot \left(b \cdot b\right) - 0.16666666666666666, b \cdot b, 1\right) \cdot b\\ \mathbf{if}\;b \leq -0.39:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 0.4:\\ \;\;\;\;\frac{r \cdot t\_1}{\mathsf{fma}\left(\cos b, \cos a, \left(-t\_1\right) \cdot \sin a\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (r a b)
         :precision binary64
         (let* ((t_0 (/ (* r (sin b)) (fma (sin a) (- (sin b)) (* 1.0 (cos b)))))
                (t_1
                 (*
                  (fma
                   (- (* 0.008333333333333333 (* b b)) 0.16666666666666666)
                   (* b b)
                   1.0)
                  b)))
           (if (<= b -0.39)
             t_0
             (if (<= b 0.4)
               (/ (* r t_1) (fma (cos b) (cos a) (* (- t_1) (sin a))))
               t_0))))
        double code(double r, double a, double b) {
        	double t_0 = (r * sin(b)) / fma(sin(a), -sin(b), (1.0 * cos(b)));
        	double t_1 = fma(((0.008333333333333333 * (b * b)) - 0.16666666666666666), (b * b), 1.0) * b;
        	double tmp;
        	if (b <= -0.39) {
        		tmp = t_0;
        	} else if (b <= 0.4) {
        		tmp = (r * t_1) / fma(cos(b), cos(a), (-t_1 * sin(a)));
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        function code(r, a, b)
        	t_0 = Float64(Float64(r * sin(b)) / fma(sin(a), Float64(-sin(b)), Float64(1.0 * cos(b))))
        	t_1 = Float64(fma(Float64(Float64(0.008333333333333333 * Float64(b * b)) - 0.16666666666666666), Float64(b * b), 1.0) * b)
        	tmp = 0.0
        	if (b <= -0.39)
        		tmp = t_0;
        	elseif (b <= 0.4)
        		tmp = Float64(Float64(r * t_1) / fma(cos(b), cos(a), Float64(Float64(-t_1) * sin(a))));
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        code[r_, a_, b_] := Block[{t$95$0 = N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[(N[Sin[a], $MachinePrecision] * (-N[Sin[b], $MachinePrecision]) + N[(1.0 * N[Cos[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(0.008333333333333333 * N[(b * b), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * N[(b * b), $MachinePrecision] + 1.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -0.39], t$95$0, If[LessEqual[b, 0.4], N[(N[(r * t$95$1), $MachinePrecision] / N[(N[Cos[b], $MachinePrecision] * N[Cos[a], $MachinePrecision] + N[((-t$95$1) * N[Sin[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, 1 \cdot \cos b\right)}\\
        t_1 := \mathsf{fma}\left(0.008333333333333333 \cdot \left(b \cdot b\right) - 0.16666666666666666, b \cdot b, 1\right) \cdot b\\
        \mathbf{if}\;b \leq -0.39:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;b \leq 0.4:\\
        \;\;\;\;\frac{r \cdot t\_1}{\mathsf{fma}\left(\cos b, \cos a, \left(-t\_1\right) \cdot \sin a\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if b < -0.39000000000000001 or 0.40000000000000002 < b

          1. Initial program 77.0%

            \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
          2. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
            2. lift-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
            3. +-commutativeN/A

              \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
            4. cos-sumN/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
            5. cos-neg-revN/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
            6. mul-1-negN/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
            7. lower--.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
            8. mul-1-negN/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
            9. cos-neg-revN/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
            10. lower-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
            11. lower-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
            12. lower-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
            13. lower-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
            14. lift-sin.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
            15. lower-sin.f6499.5

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
          3. Applied rewrites99.5%

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
          4. Step-by-step derivation
            1. lift--.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
            2. lift-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
            3. lift-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
            4. lift-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
            5. lift-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
            6. lift-sin.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
            7. lift-sin.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
            8. fp-cancel-sub-sign-invN/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}} \]
            9. lower-fma.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)}} \]
            10. lift-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
            11. lift-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
            12. lower-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}\right)} \]
            13. lower-neg.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(-\sin b\right)} \cdot \sin a\right)} \]
            14. lift-sin.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\color{blue}{\sin b}\right) \cdot \sin a\right)} \]
            15. lift-sin.f6499.5

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \color{blue}{\sin a}\right)} \]
          5. Applied rewrites99.5%

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
          6. Step-by-step derivation
            1. lift-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
            2. lift-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(-\sin b\right) \cdot \sin a\right)} \]
            3. lift-fma.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(-\sin b\right) \cdot \sin a}} \]
            4. lift-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \color{blue}{\left(-\sin b\right) \cdot \sin a}} \]
            5. lift-neg.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right)} \cdot \sin a} \]
            6. lift-sin.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\color{blue}{\sin b}\right)\right) \cdot \sin a} \]
            7. lift-sin.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \color{blue}{\sin a}} \]
            8. +-commutativeN/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a + \cos b \cdot \cos a}} \]
            9. mul-1-negN/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\left(-1 \cdot \sin b\right)} \cdot \sin a + \cos b \cdot \cos a} \]
            10. *-commutativeN/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\sin a \cdot \left(-1 \cdot \sin b\right)} + \cos b \cdot \cos a} \]
            11. lower-fma.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\sin a, -1 \cdot \sin b, \cos b \cdot \cos a\right)}} \]
            12. lift-sin.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\sin a}, -1 \cdot \sin b, \cos b \cdot \cos a\right)} \]
            13. mul-1-negN/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \color{blue}{\mathsf{neg}\left(\sin b\right)}, \cos b \cdot \cos a\right)} \]
            14. lift-sin.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \mathsf{neg}\left(\color{blue}{\sin b}\right), \cos b \cdot \cos a\right)} \]
            15. lift-neg.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \color{blue}{-\sin b}, \cos b \cdot \cos a\right)} \]
            16. *-commutativeN/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a \cdot \cos b}\right)} \]
            17. lower-*.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a \cdot \cos b}\right)} \]
            18. lift-cos.f64N/A

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a} \cdot \cos b\right)} \]
            19. lift-cos.f6499.5

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \color{blue}{\cos b}\right)} \]
          7. Applied rewrites99.5%

            \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \cos b\right)}} \]
          8. Taylor expanded in a around 0

            \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{1} \cdot \cos b\right)} \]
          9. Step-by-step derivation
            1. Applied rewrites61.3%

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{1} \cdot \cos b\right)} \]

            if -0.39000000000000001 < b < 0.40000000000000002

            1. Initial program 77.0%

              \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
            2. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
              2. lift-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
              3. +-commutativeN/A

                \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
              4. cos-sumN/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
              5. cos-neg-revN/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
              6. mul-1-negN/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
              7. lower--.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
              8. mul-1-negN/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
              9. cos-neg-revN/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
              10. lower-*.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
              11. lower-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
              12. lower-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
              13. lower-*.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
              14. lift-sin.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
              15. lower-sin.f6499.5

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
            3. Applied rewrites99.5%

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
            4. Step-by-step derivation
              1. lift--.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
              2. lift-*.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
              3. lift-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
              4. lift-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
              5. lift-*.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
              6. lift-sin.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
              7. lift-sin.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
              8. fp-cancel-sub-sign-invN/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}} \]
              9. lower-fma.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)}} \]
              10. lift-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
              11. lift-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
              12. lower-*.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}\right)} \]
              13. lower-neg.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(-\sin b\right)} \cdot \sin a\right)} \]
              14. lift-sin.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\color{blue}{\sin b}\right) \cdot \sin a\right)} \]
              15. lift-sin.f6499.5

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \color{blue}{\sin a}\right)} \]
            5. Applied rewrites99.5%

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
            6. Taylor expanded in b around 0

              \[\leadsto \frac{r \cdot \color{blue}{\left(b \cdot \left(1 + {b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right)\right)\right)}}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
            7. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \frac{r \cdot \left(\left(1 + {b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right)\right) \cdot \color{blue}{b}\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{r \cdot \left(\left(1 + {b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right)\right) \cdot \color{blue}{b}\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
              3. +-commutativeN/A

                \[\leadsto \frac{r \cdot \left(\left({b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right) + 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
              4. *-commutativeN/A

                \[\leadsto \frac{r \cdot \left(\left(\left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right) \cdot {b}^{2} + 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
              5. lower-fma.f64N/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
              6. lower--.f64N/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
              7. lower-*.f64N/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
              8. pow2N/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
              9. lift-*.f64N/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
              10. pow2N/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
              11. lift-*.f6452.1

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(0.008333333333333333 \cdot \left(b \cdot b\right) - 0.16666666666666666, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
            8. Applied rewrites52.1%

              \[\leadsto \frac{r \cdot \color{blue}{\left(\mathsf{fma}\left(0.008333333333333333 \cdot \left(b \cdot b\right) - 0.16666666666666666, b \cdot b, 1\right) \cdot b\right)}}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
            9. Taylor expanded in b around 0

              \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\color{blue}{b \cdot \left(1 + {b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right)\right)}\right) \cdot \sin a\right)} \]
            10. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\left(1 + {b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right)\right) \cdot \color{blue}{b}\right) \cdot \sin a\right)} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\left(1 + {b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right)\right) \cdot \color{blue}{b}\right) \cdot \sin a\right)} \]
              3. +-commutativeN/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\left({b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right) + 1\right) \cdot b\right) \cdot \sin a\right)} \]
              4. *-commutativeN/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\left(\left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right) \cdot {b}^{2} + 1\right) \cdot b\right) \cdot \sin a\right)} \]
              5. lower-fma.f64N/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\mathsf{fma}\left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right) \cdot \sin a\right)} \]
              6. lower--.f64N/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\mathsf{fma}\left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right) \cdot \sin a\right)} \]
              7. lower-*.f64N/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\mathsf{fma}\left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right) \cdot \sin a\right)} \]
              8. pow2N/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right) \cdot \sin a\right)} \]
              9. lift-*.f64N/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right) \cdot \sin a\right)} \]
              10. pow2N/A

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\mathsf{fma}\left(\frac{1}{120} \cdot \left(b \cdot b\right) - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right) \cdot \sin a\right)} \]
              11. lift-*.f6451.7

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(0.008333333333333333 \cdot \left(b \cdot b\right) - 0.16666666666666666, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\mathsf{fma}\left(0.008333333333333333 \cdot \left(b \cdot b\right) - 0.16666666666666666, b \cdot b, 1\right) \cdot b\right) \cdot \sin a\right)} \]
            11. Applied rewrites51.7%

              \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(0.008333333333333333 \cdot \left(b \cdot b\right) - 0.16666666666666666, b \cdot b, 1\right) \cdot b\right)}{\mathsf{fma}\left(\cos b, \cos a, \left(-\color{blue}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(b \cdot b\right) - 0.16666666666666666, b \cdot b, 1\right) \cdot b}\right) \cdot \sin a\right)} \]
          10. Recombined 2 regimes into one program.
          11. Add Preprocessing

          Alternative 8: 78.5% accurate, 0.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, 1 \cdot \cos b\right)}\\ t_1 := \mathsf{fma}\left(\left(b \cdot b\right) \cdot 0.008333333333333333 - 0.16666666666666666, b \cdot b, 1\right) \cdot b\\ \mathbf{if}\;b \leq -0.39:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 0.4:\\ \;\;\;\;\frac{r \cdot t\_1}{\cos b \cdot \cos a - t\_1 \cdot \sin a}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (r a b)
           :precision binary64
           (let* ((t_0 (/ (* r (sin b)) (fma (sin a) (- (sin b)) (* 1.0 (cos b)))))
                  (t_1
                   (*
                    (fma
                     (- (* (* b b) 0.008333333333333333) 0.16666666666666666)
                     (* b b)
                     1.0)
                    b)))
             (if (<= b -0.39)
               t_0
               (if (<= b 0.4)
                 (/ (* r t_1) (- (* (cos b) (cos a)) (* t_1 (sin a))))
                 t_0))))
          double code(double r, double a, double b) {
          	double t_0 = (r * sin(b)) / fma(sin(a), -sin(b), (1.0 * cos(b)));
          	double t_1 = fma((((b * b) * 0.008333333333333333) - 0.16666666666666666), (b * b), 1.0) * b;
          	double tmp;
          	if (b <= -0.39) {
          		tmp = t_0;
          	} else if (b <= 0.4) {
          		tmp = (r * t_1) / ((cos(b) * cos(a)) - (t_1 * sin(a)));
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          function code(r, a, b)
          	t_0 = Float64(Float64(r * sin(b)) / fma(sin(a), Float64(-sin(b)), Float64(1.0 * cos(b))))
          	t_1 = Float64(fma(Float64(Float64(Float64(b * b) * 0.008333333333333333) - 0.16666666666666666), Float64(b * b), 1.0) * b)
          	tmp = 0.0
          	if (b <= -0.39)
          		tmp = t_0;
          	elseif (b <= 0.4)
          		tmp = Float64(Float64(r * t_1) / Float64(Float64(cos(b) * cos(a)) - Float64(t_1 * sin(a))));
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          code[r_, a_, b_] := Block[{t$95$0 = N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[(N[Sin[a], $MachinePrecision] * (-N[Sin[b], $MachinePrecision]) + N[(1.0 * N[Cos[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(b * b), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * N[(b * b), $MachinePrecision] + 1.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -0.39], t$95$0, If[LessEqual[b, 0.4], N[(N[(r * t$95$1), $MachinePrecision] / N[(N[(N[Cos[b], $MachinePrecision] * N[Cos[a], $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[Sin[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, 1 \cdot \cos b\right)}\\
          t_1 := \mathsf{fma}\left(\left(b \cdot b\right) \cdot 0.008333333333333333 - 0.16666666666666666, b \cdot b, 1\right) \cdot b\\
          \mathbf{if}\;b \leq -0.39:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;b \leq 0.4:\\
          \;\;\;\;\frac{r \cdot t\_1}{\cos b \cdot \cos a - t\_1 \cdot \sin a}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if b < -0.39000000000000001 or 0.40000000000000002 < b

            1. Initial program 77.0%

              \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
            2. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
              2. lift-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
              3. +-commutativeN/A

                \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
              4. cos-sumN/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
              5. cos-neg-revN/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
              6. mul-1-negN/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
              7. lower--.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
              8. mul-1-negN/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
              9. cos-neg-revN/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
              10. lower-*.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
              11. lower-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
              12. lower-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
              13. lower-*.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
              14. lift-sin.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
              15. lower-sin.f6499.5

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
            3. Applied rewrites99.5%

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
            4. Step-by-step derivation
              1. lift--.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
              2. lift-*.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
              3. lift-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
              4. lift-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
              5. lift-*.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
              6. lift-sin.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
              7. lift-sin.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
              8. fp-cancel-sub-sign-invN/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}} \]
              9. lower-fma.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)}} \]
              10. lift-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
              11. lift-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
              12. lower-*.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}\right)} \]
              13. lower-neg.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(-\sin b\right)} \cdot \sin a\right)} \]
              14. lift-sin.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\color{blue}{\sin b}\right) \cdot \sin a\right)} \]
              15. lift-sin.f6499.5

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \color{blue}{\sin a}\right)} \]
            5. Applied rewrites99.5%

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
            6. Step-by-step derivation
              1. lift-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
              2. lift-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(-\sin b\right) \cdot \sin a\right)} \]
              3. lift-fma.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(-\sin b\right) \cdot \sin a}} \]
              4. lift-*.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \color{blue}{\left(-\sin b\right) \cdot \sin a}} \]
              5. lift-neg.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right)} \cdot \sin a} \]
              6. lift-sin.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\color{blue}{\sin b}\right)\right) \cdot \sin a} \]
              7. lift-sin.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \color{blue}{\sin a}} \]
              8. +-commutativeN/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a + \cos b \cdot \cos a}} \]
              9. mul-1-negN/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\left(-1 \cdot \sin b\right)} \cdot \sin a + \cos b \cdot \cos a} \]
              10. *-commutativeN/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\sin a \cdot \left(-1 \cdot \sin b\right)} + \cos b \cdot \cos a} \]
              11. lower-fma.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\sin a, -1 \cdot \sin b, \cos b \cdot \cos a\right)}} \]
              12. lift-sin.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\sin a}, -1 \cdot \sin b, \cos b \cdot \cos a\right)} \]
              13. mul-1-negN/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \color{blue}{\mathsf{neg}\left(\sin b\right)}, \cos b \cdot \cos a\right)} \]
              14. lift-sin.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \mathsf{neg}\left(\color{blue}{\sin b}\right), \cos b \cdot \cos a\right)} \]
              15. lift-neg.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \color{blue}{-\sin b}, \cos b \cdot \cos a\right)} \]
              16. *-commutativeN/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a \cdot \cos b}\right)} \]
              17. lower-*.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a \cdot \cos b}\right)} \]
              18. lift-cos.f64N/A

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a} \cdot \cos b\right)} \]
              19. lift-cos.f6499.5

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \color{blue}{\cos b}\right)} \]
            7. Applied rewrites99.5%

              \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \cos b\right)}} \]
            8. Taylor expanded in a around 0

              \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{1} \cdot \cos b\right)} \]
            9. Step-by-step derivation
              1. Applied rewrites61.3%

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{1} \cdot \cos b\right)} \]

              if -0.39000000000000001 < b < 0.40000000000000002

              1. Initial program 77.0%

                \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
              2. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
                2. lift-cos.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
                3. +-commutativeN/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
                4. cos-sumN/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
                5. cos-neg-revN/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
                6. mul-1-negN/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
                7. lower--.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
                8. mul-1-negN/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
                9. cos-neg-revN/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
                10. lower-*.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
                11. lower-cos.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
                12. lower-cos.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
                13. lower-*.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
                14. lift-sin.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
                15. lower-sin.f6499.5

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
              3. Applied rewrites99.5%

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
              4. Taylor expanded in b around 0

                \[\leadsto \frac{r \cdot \color{blue}{\left(b \cdot \left(1 + {b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right)\right)\right)}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
              5. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \frac{r \cdot \left(\left(1 + {b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right)\right) \cdot \color{blue}{b}\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                2. lower-*.f64N/A

                  \[\leadsto \frac{r \cdot \left(\left(1 + {b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right)\right) \cdot \color{blue}{b}\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                3. +-commutativeN/A

                  \[\leadsto \frac{r \cdot \left(\left({b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right) + 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                4. *-commutativeN/A

                  \[\leadsto \frac{r \cdot \left(\left(\left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right) \cdot {b}^{2} + 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                5. lower-fma.f64N/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                6. lower--.f64N/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                7. *-commutativeN/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left({b}^{2} \cdot \frac{1}{120} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                8. lower-*.f64N/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left({b}^{2} \cdot \frac{1}{120} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                9. unpow2N/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                10. lower-*.f64N/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                11. unpow2N/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                12. lower-*.f6452.1

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot 0.008333333333333333 - 0.16666666666666666, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
              6. Applied rewrites52.1%

                \[\leadsto \frac{r \cdot \color{blue}{\left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot 0.008333333333333333 - 0.16666666666666666, b \cdot b, 1\right) \cdot b\right)}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
              7. Taylor expanded in b around 0

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \color{blue}{\left(b \cdot \left(1 + {b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right)\right)\right)} \cdot \sin a} \]
              8. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\left(1 + {b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right)\right) \cdot \color{blue}{b}\right) \cdot \sin a} \]
                2. lower-*.f64N/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\left(1 + {b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right)\right) \cdot \color{blue}{b}\right) \cdot \sin a} \]
                3. +-commutativeN/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\left({b}^{2} \cdot \left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right) + 1\right) \cdot b\right) \cdot \sin a} \]
                4. *-commutativeN/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\left(\left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}\right) \cdot {b}^{2} + 1\right) \cdot b\right) \cdot \sin a} \]
                5. lower-fma.f64N/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\mathsf{fma}\left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right) \cdot \sin a} \]
                6. lower--.f64N/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\mathsf{fma}\left(\frac{1}{120} \cdot {b}^{2} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right) \cdot \sin a} \]
                7. *-commutativeN/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\mathsf{fma}\left({b}^{2} \cdot \frac{1}{120} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right) \cdot \sin a} \]
                8. lower-*.f64N/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\mathsf{fma}\left({b}^{2} \cdot \frac{1}{120} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right) \cdot \sin a} \]
                9. unpow2N/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right) \cdot \sin a} \]
                10. lower-*.f64N/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, {b}^{2}, 1\right) \cdot b\right) \cdot \sin a} \]
                11. unpow2N/A

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot \frac{1}{120} - \frac{1}{6}, b \cdot b, 1\right) \cdot b\right) \cdot \sin a} \]
                12. lower-*.f6451.7

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot 0.008333333333333333 - 0.16666666666666666, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot 0.008333333333333333 - 0.16666666666666666, b \cdot b, 1\right) \cdot b\right) \cdot \sin a} \]
              9. Applied rewrites51.7%

                \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot 0.008333333333333333 - 0.16666666666666666, b \cdot b, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \color{blue}{\left(\mathsf{fma}\left(\left(b \cdot b\right) \cdot 0.008333333333333333 - 0.16666666666666666, b \cdot b, 1\right) \cdot b\right)} \cdot \sin a} \]
            10. Recombined 2 regimes into one program.
            11. Add Preprocessing

            Alternative 9: 78.4% accurate, 0.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, 1 \cdot \cos b\right)}\\ t_1 := \mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\\ \mathbf{if}\;b \leq -0.28:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 0.25:\\ \;\;\;\;\frac{r \cdot t\_1}{\cos b \cdot \cos a - t\_1 \cdot \sin a}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (r a b)
             :precision binary64
             (let* ((t_0 (/ (* r (sin b)) (fma (sin a) (- (sin b)) (* 1.0 (cos b)))))
                    (t_1 (* (fma (* b b) -0.16666666666666666 1.0) b)))
               (if (<= b -0.28)
                 t_0
                 (if (<= b 0.25)
                   (/ (* r t_1) (- (* (cos b) (cos a)) (* t_1 (sin a))))
                   t_0))))
            double code(double r, double a, double b) {
            	double t_0 = (r * sin(b)) / fma(sin(a), -sin(b), (1.0 * cos(b)));
            	double t_1 = fma((b * b), -0.16666666666666666, 1.0) * b;
            	double tmp;
            	if (b <= -0.28) {
            		tmp = t_0;
            	} else if (b <= 0.25) {
            		tmp = (r * t_1) / ((cos(b) * cos(a)) - (t_1 * sin(a)));
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            function code(r, a, b)
            	t_0 = Float64(Float64(r * sin(b)) / fma(sin(a), Float64(-sin(b)), Float64(1.0 * cos(b))))
            	t_1 = Float64(fma(Float64(b * b), -0.16666666666666666, 1.0) * b)
            	tmp = 0.0
            	if (b <= -0.28)
            		tmp = t_0;
            	elseif (b <= 0.25)
            		tmp = Float64(Float64(r * t_1) / Float64(Float64(cos(b) * cos(a)) - Float64(t_1 * sin(a))));
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            code[r_, a_, b_] := Block[{t$95$0 = N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[(N[Sin[a], $MachinePrecision] * (-N[Sin[b], $MachinePrecision]) + N[(1.0 * N[Cos[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(b * b), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -0.28], t$95$0, If[LessEqual[b, 0.25], N[(N[(r * t$95$1), $MachinePrecision] / N[(N[(N[Cos[b], $MachinePrecision] * N[Cos[a], $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[Sin[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, 1 \cdot \cos b\right)}\\
            t_1 := \mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\\
            \mathbf{if}\;b \leq -0.28:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;b \leq 0.25:\\
            \;\;\;\;\frac{r \cdot t\_1}{\cos b \cdot \cos a - t\_1 \cdot \sin a}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if b < -0.28000000000000003 or 0.25 < b

              1. Initial program 77.0%

                \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
              2. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
                2. lift-cos.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
                3. +-commutativeN/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
                4. cos-sumN/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
                5. cos-neg-revN/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
                6. mul-1-negN/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
                7. lower--.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
                8. mul-1-negN/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
                9. cos-neg-revN/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
                10. lower-*.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
                11. lower-cos.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
                12. lower-cos.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
                13. lower-*.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
                14. lift-sin.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
                15. lower-sin.f6499.5

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
              3. Applied rewrites99.5%

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
              4. Step-by-step derivation
                1. lift--.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
                2. lift-*.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
                3. lift-cos.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
                4. lift-cos.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
                5. lift-*.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
                6. lift-sin.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
                7. lift-sin.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
                8. fp-cancel-sub-sign-invN/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}} \]
                9. lower-fma.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)}} \]
                10. lift-cos.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
                11. lift-cos.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a\right)} \]
                12. lower-*.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a}\right)} \]
                13. lower-neg.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \color{blue}{\left(-\sin b\right)} \cdot \sin a\right)} \]
                14. lift-sin.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\color{blue}{\sin b}\right) \cdot \sin a\right)} \]
                15. lift-sin.f6499.5

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \color{blue}{\sin a}\right)} \]
              5. Applied rewrites99.5%

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\cos b, \cos a, \left(-\sin b\right) \cdot \sin a\right)}} \]
              6. Step-by-step derivation
                1. lift-cos.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\cos b}, \cos a, \left(-\sin b\right) \cdot \sin a\right)} \]
                2. lift-cos.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\cos b, \color{blue}{\cos a}, \left(-\sin b\right) \cdot \sin a\right)} \]
                3. lift-fma.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a + \left(-\sin b\right) \cdot \sin a}} \]
                4. lift-*.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \color{blue}{\left(-\sin b\right) \cdot \sin a}} \]
                5. lift-neg.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right)} \cdot \sin a} \]
                6. lift-sin.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\color{blue}{\sin b}\right)\right) \cdot \sin a} \]
                7. lift-sin.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a + \left(\mathsf{neg}\left(\sin b\right)\right) \cdot \color{blue}{\sin a}} \]
                8. +-commutativeN/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\left(\mathsf{neg}\left(\sin b\right)\right) \cdot \sin a + \cos b \cdot \cos a}} \]
                9. mul-1-negN/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\left(-1 \cdot \sin b\right)} \cdot \sin a + \cos b \cdot \cos a} \]
                10. *-commutativeN/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\sin a \cdot \left(-1 \cdot \sin b\right)} + \cos b \cdot \cos a} \]
                11. lower-fma.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\sin a, -1 \cdot \sin b, \cos b \cdot \cos a\right)}} \]
                12. lift-sin.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\color{blue}{\sin a}, -1 \cdot \sin b, \cos b \cdot \cos a\right)} \]
                13. mul-1-negN/A

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \color{blue}{\mathsf{neg}\left(\sin b\right)}, \cos b \cdot \cos a\right)} \]
                14. lift-sin.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \mathsf{neg}\left(\color{blue}{\sin b}\right), \cos b \cdot \cos a\right)} \]
                15. lift-neg.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, \color{blue}{-\sin b}, \cos b \cdot \cos a\right)} \]
                16. *-commutativeN/A

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a \cdot \cos b}\right)} \]
                17. lower-*.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a \cdot \cos b}\right)} \]
                18. lift-cos.f64N/A

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{\cos a} \cdot \cos b\right)} \]
                19. lift-cos.f6499.5

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \color{blue}{\cos b}\right)} \]
              7. Applied rewrites99.5%

                \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\mathsf{fma}\left(\sin a, -\sin b, \cos a \cdot \cos b\right)}} \]
              8. Taylor expanded in a around 0

                \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{1} \cdot \cos b\right)} \]
              9. Step-by-step derivation
                1. Applied rewrites61.3%

                  \[\leadsto \frac{r \cdot \sin b}{\mathsf{fma}\left(\sin a, -\sin b, \color{blue}{1} \cdot \cos b\right)} \]

                if -0.28000000000000003 < b < 0.25

                1. Initial program 77.0%

                  \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
                  2. lift-cos.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
                  3. +-commutativeN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
                  4. cos-sumN/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
                  5. cos-neg-revN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
                  6. mul-1-negN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
                  7. lower--.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
                  8. mul-1-negN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
                  9. cos-neg-revN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
                  10. lower-*.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
                  11. lower-cos.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
                  12. lower-cos.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
                  13. lower-*.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
                  14. lift-sin.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
                  15. lower-sin.f6499.5

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
                3. Applied rewrites99.5%

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
                4. Taylor expanded in b around 0

                  \[\leadsto \frac{r \cdot \color{blue}{\left(b \cdot \left(1 + \frac{-1}{6} \cdot {b}^{2}\right)\right)}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                5. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \frac{r \cdot \left(\left(1 + \frac{-1}{6} \cdot {b}^{2}\right) \cdot \color{blue}{b}\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                  2. lower-*.f64N/A

                    \[\leadsto \frac{r \cdot \left(\left(1 + \frac{-1}{6} \cdot {b}^{2}\right) \cdot \color{blue}{b}\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                  3. +-commutativeN/A

                    \[\leadsto \frac{r \cdot \left(\left(\frac{-1}{6} \cdot {b}^{2} + 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                  4. *-commutativeN/A

                    \[\leadsto \frac{r \cdot \left(\left({b}^{2} \cdot \frac{-1}{6} + 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                  5. lower-fma.f64N/A

                    \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left({b}^{2}, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                  6. unpow2N/A

                    \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                  7. lower-*.f6452.0

                    \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                6. Applied rewrites52.0%

                  \[\leadsto \frac{r \cdot \color{blue}{\left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right)}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                7. Taylor expanded in b around 0

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \color{blue}{\left(b \cdot \left(1 + \frac{-1}{6} \cdot {b}^{2}\right)\right)} \cdot \sin a} \]
                8. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\left(1 + \frac{-1}{6} \cdot {b}^{2}\right) \cdot \color{blue}{b}\right) \cdot \sin a} \]
                  2. lower-*.f64N/A

                    \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\left(1 + \frac{-1}{6} \cdot {b}^{2}\right) \cdot \color{blue}{b}\right) \cdot \sin a} \]
                  3. +-commutativeN/A

                    \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\left(\frac{-1}{6} \cdot {b}^{2} + 1\right) \cdot b\right) \cdot \sin a} \]
                  4. *-commutativeN/A

                    \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\left({b}^{2} \cdot \frac{-1}{6} + 1\right) \cdot b\right) \cdot \sin a} \]
                  5. lower-fma.f64N/A

                    \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\mathsf{fma}\left({b}^{2}, \frac{-1}{6}, 1\right) \cdot b\right) \cdot \sin a} \]
                  6. unpow2N/A

                    \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right) \cdot \sin a} \]
                  7. lower-*.f6452.1

                    \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right) \cdot \sin a} \]
                9. Applied rewrites52.1%

                  \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \color{blue}{\left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right)} \cdot \sin a} \]
              10. Recombined 2 regimes into one program.
              11. Add Preprocessing

              Alternative 10: 78.4% accurate, 0.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{r \cdot \sin b}{\cos b \cdot 1 - \sin b \cdot \sin a}\\ t_1 := \mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\\ \mathbf{if}\;b \leq -0.28:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 0.25:\\ \;\;\;\;\frac{r \cdot t\_1}{\cos b \cdot \cos a - t\_1 \cdot \sin a}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
              (FPCore (r a b)
               :precision binary64
               (let* ((t_0 (/ (* r (sin b)) (- (* (cos b) 1.0) (* (sin b) (sin a)))))
                      (t_1 (* (fma (* b b) -0.16666666666666666 1.0) b)))
                 (if (<= b -0.28)
                   t_0
                   (if (<= b 0.25)
                     (/ (* r t_1) (- (* (cos b) (cos a)) (* t_1 (sin a))))
                     t_0))))
              double code(double r, double a, double b) {
              	double t_0 = (r * sin(b)) / ((cos(b) * 1.0) - (sin(b) * sin(a)));
              	double t_1 = fma((b * b), -0.16666666666666666, 1.0) * b;
              	double tmp;
              	if (b <= -0.28) {
              		tmp = t_0;
              	} else if (b <= 0.25) {
              		tmp = (r * t_1) / ((cos(b) * cos(a)) - (t_1 * sin(a)));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              function code(r, a, b)
              	t_0 = Float64(Float64(r * sin(b)) / Float64(Float64(cos(b) * 1.0) - Float64(sin(b) * sin(a))))
              	t_1 = Float64(fma(Float64(b * b), -0.16666666666666666, 1.0) * b)
              	tmp = 0.0
              	if (b <= -0.28)
              		tmp = t_0;
              	elseif (b <= 0.25)
              		tmp = Float64(Float64(r * t_1) / Float64(Float64(cos(b) * cos(a)) - Float64(t_1 * sin(a))));
              	else
              		tmp = t_0;
              	end
              	return tmp
              end
              
              code[r_, a_, b_] := Block[{t$95$0 = N[(N[(r * N[Sin[b], $MachinePrecision]), $MachinePrecision] / N[(N[(N[Cos[b], $MachinePrecision] * 1.0), $MachinePrecision] - N[(N[Sin[b], $MachinePrecision] * N[Sin[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(b * b), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -0.28], t$95$0, If[LessEqual[b, 0.25], N[(N[(r * t$95$1), $MachinePrecision] / N[(N[(N[Cos[b], $MachinePrecision] * N[Cos[a], $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[Sin[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \frac{r \cdot \sin b}{\cos b \cdot 1 - \sin b \cdot \sin a}\\
              t_1 := \mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\\
              \mathbf{if}\;b \leq -0.28:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;b \leq 0.25:\\
              \;\;\;\;\frac{r \cdot t\_1}{\cos b \cdot \cos a - t\_1 \cdot \sin a}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if b < -0.28000000000000003 or 0.25 < b

                1. Initial program 77.0%

                  \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
                  2. lift-cos.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
                  3. +-commutativeN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
                  4. cos-sumN/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
                  5. cos-neg-revN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
                  6. mul-1-negN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
                  7. lower--.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
                  8. mul-1-negN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
                  9. cos-neg-revN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
                  10. lower-*.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
                  11. lower-cos.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
                  12. lower-cos.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
                  13. lower-*.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
                  14. lift-sin.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
                  15. lower-sin.f6499.5

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
                3. Applied rewrites99.5%

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
                4. Taylor expanded in a around 0

                  \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{1} - \sin b \cdot \sin a} \]
                5. Step-by-step derivation
                  1. Applied rewrites61.3%

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{1} - \sin b \cdot \sin a} \]

                  if -0.28000000000000003 < b < 0.25

                  1. Initial program 77.0%

                    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                  2. Step-by-step derivation
                    1. lift-+.f64N/A

                      \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
                    2. lift-cos.f64N/A

                      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
                    3. +-commutativeN/A

                      \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
                    4. cos-sumN/A

                      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
                    5. cos-neg-revN/A

                      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
                    6. mul-1-negN/A

                      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
                    7. lower--.f64N/A

                      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
                    8. mul-1-negN/A

                      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
                    9. cos-neg-revN/A

                      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
                    10. lower-*.f64N/A

                      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
                    11. lower-cos.f64N/A

                      \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
                    12. lower-cos.f64N/A

                      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
                    13. lower-*.f64N/A

                      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
                    14. lift-sin.f64N/A

                      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
                    15. lower-sin.f6499.5

                      \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
                  3. Applied rewrites99.5%

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
                  4. Taylor expanded in b around 0

                    \[\leadsto \frac{r \cdot \color{blue}{\left(b \cdot \left(1 + \frac{-1}{6} \cdot {b}^{2}\right)\right)}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                  5. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \frac{r \cdot \left(\left(1 + \frac{-1}{6} \cdot {b}^{2}\right) \cdot \color{blue}{b}\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                    2. lower-*.f64N/A

                      \[\leadsto \frac{r \cdot \left(\left(1 + \frac{-1}{6} \cdot {b}^{2}\right) \cdot \color{blue}{b}\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                    3. +-commutativeN/A

                      \[\leadsto \frac{r \cdot \left(\left(\frac{-1}{6} \cdot {b}^{2} + 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                    4. *-commutativeN/A

                      \[\leadsto \frac{r \cdot \left(\left({b}^{2} \cdot \frac{-1}{6} + 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                    5. lower-fma.f64N/A

                      \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left({b}^{2}, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                    6. unpow2N/A

                      \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                    7. lower-*.f6452.0

                      \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                  6. Applied rewrites52.0%

                    \[\leadsto \frac{r \cdot \color{blue}{\left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right)}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                  7. Taylor expanded in b around 0

                    \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \color{blue}{\left(b \cdot \left(1 + \frac{-1}{6} \cdot {b}^{2}\right)\right)} \cdot \sin a} \]
                  8. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\left(1 + \frac{-1}{6} \cdot {b}^{2}\right) \cdot \color{blue}{b}\right) \cdot \sin a} \]
                    2. lower-*.f64N/A

                      \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\left(1 + \frac{-1}{6} \cdot {b}^{2}\right) \cdot \color{blue}{b}\right) \cdot \sin a} \]
                    3. +-commutativeN/A

                      \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\left(\frac{-1}{6} \cdot {b}^{2} + 1\right) \cdot b\right) \cdot \sin a} \]
                    4. *-commutativeN/A

                      \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\left({b}^{2} \cdot \frac{-1}{6} + 1\right) \cdot b\right) \cdot \sin a} \]
                    5. lower-fma.f64N/A

                      \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\mathsf{fma}\left({b}^{2}, \frac{-1}{6}, 1\right) \cdot b\right) \cdot \sin a} \]
                    6. unpow2N/A

                      \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right) \cdot \sin a} \]
                    7. lower-*.f6452.1

                      \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right) \cdot \sin a} \]
                  9. Applied rewrites52.1%

                    \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right)}{\cos b \cdot \cos a - \color{blue}{\left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right)} \cdot \sin a} \]
                6. Recombined 2 regimes into one program.
                7. Add Preprocessing

                Alternative 11: 77.0% accurate, 1.2× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan b \cdot r\\ \mathbf{if}\;b \leq -0.076:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 0.062:\\ \;\;\;\;\frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right)}{\cos \left(a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (r a b)
                 :precision binary64
                 (let* ((t_0 (* (tan b) r)))
                   (if (<= b -0.076)
                     t_0
                     (if (<= b 0.062)
                       (/ (* r (* (fma (* b b) -0.16666666666666666 1.0) b)) (cos (+ a b)))
                       t_0))))
                double code(double r, double a, double b) {
                	double t_0 = tan(b) * r;
                	double tmp;
                	if (b <= -0.076) {
                		tmp = t_0;
                	} else if (b <= 0.062) {
                		tmp = (r * (fma((b * b), -0.16666666666666666, 1.0) * b)) / cos((a + b));
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                function code(r, a, b)
                	t_0 = Float64(tan(b) * r)
                	tmp = 0.0
                	if (b <= -0.076)
                		tmp = t_0;
                	elseif (b <= 0.062)
                		tmp = Float64(Float64(r * Float64(fma(Float64(b * b), -0.16666666666666666, 1.0) * b)) / cos(Float64(a + b)));
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                code[r_, a_, b_] := Block[{t$95$0 = N[(N[Tan[b], $MachinePrecision] * r), $MachinePrecision]}, If[LessEqual[b, -0.076], t$95$0, If[LessEqual[b, 0.062], N[(N[(r * N[(N[(N[(b * b), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \tan b \cdot r\\
                \mathbf{if}\;b \leq -0.076:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;b \leq 0.062:\\
                \;\;\;\;\frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right)}{\cos \left(a + b\right)}\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if b < -0.0759999999999999981 or 0.062 < b

                  1. Initial program 77.0%

                    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                  2. Taylor expanded in a around 0

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

                      \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                    2. lower-*.f64N/A

                      \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                    3. quot-tanN/A

                      \[\leadsto r \cdot \tan b \]
                    4. lower-tan.f6460.1

                      \[\leadsto r \cdot \tan b \]
                  4. Applied rewrites60.1%

                    \[\leadsto \color{blue}{r \cdot \tan b} \]
                  5. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto r \cdot \color{blue}{\tan b} \]
                    2. lift-tan.f64N/A

                      \[\leadsto r \cdot \tan b \]
                    3. *-commutativeN/A

                      \[\leadsto \tan b \cdot \color{blue}{r} \]
                    4. lower-*.f64N/A

                      \[\leadsto \tan b \cdot \color{blue}{r} \]
                    5. lift-tan.f6460.1

                      \[\leadsto \tan b \cdot r \]
                  6. Applied rewrites60.1%

                    \[\leadsto \tan b \cdot \color{blue}{r} \]

                  if -0.0759999999999999981 < b < 0.062

                  1. Initial program 77.0%

                    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                  2. Taylor expanded in b around 0

                    \[\leadsto \frac{r \cdot \color{blue}{\left(b \cdot \left(1 + \frac{-1}{6} \cdot {b}^{2}\right)\right)}}{\cos \left(a + b\right)} \]
                  3. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \frac{r \cdot \left(\left(1 + \frac{-1}{6} \cdot {b}^{2}\right) \cdot \color{blue}{b}\right)}{\cos \left(a + b\right)} \]
                    2. lower-*.f64N/A

                      \[\leadsto \frac{r \cdot \left(\left(1 + \frac{-1}{6} \cdot {b}^{2}\right) \cdot \color{blue}{b}\right)}{\cos \left(a + b\right)} \]
                    3. +-commutativeN/A

                      \[\leadsto \frac{r \cdot \left(\left(\frac{-1}{6} \cdot {b}^{2} + 1\right) \cdot b\right)}{\cos \left(a + b\right)} \]
                    4. *-commutativeN/A

                      \[\leadsto \frac{r \cdot \left(\left({b}^{2} \cdot \frac{-1}{6} + 1\right) \cdot b\right)}{\cos \left(a + b\right)} \]
                    5. lower-fma.f64N/A

                      \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left({b}^{2}, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos \left(a + b\right)} \]
                    6. unpow2N/A

                      \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, \frac{-1}{6}, 1\right) \cdot b\right)}{\cos \left(a + b\right)} \]
                    7. lower-*.f6451.6

                      \[\leadsto \frac{r \cdot \left(\mathsf{fma}\left(b \cdot b, -0.16666666666666666, 1\right) \cdot b\right)}{\cos \left(a + b\right)} \]
                  4. Applied rewrites51.6%

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

                Alternative 12: 76.9% accurate, 1.5× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan b \cdot r\\ \mathbf{if}\;b \leq -0.076:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 1.45 \cdot 10^{-6}:\\ \;\;\;\;\frac{b \cdot r}{\cos \left(a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (r a b)
                 :precision binary64
                 (let* ((t_0 (* (tan b) r)))
                   (if (<= b -0.076) t_0 (if (<= b 1.45e-6) (/ (* b r) (cos (+ a b))) t_0))))
                double code(double r, double a, double b) {
                	double t_0 = tan(b) * r;
                	double tmp;
                	if (b <= -0.076) {
                		tmp = t_0;
                	} else if (b <= 1.45e-6) {
                		tmp = (b * r) / cos((a + b));
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(r, a, b)
                use fmin_fmax_functions
                    real(8), intent (in) :: r
                    real(8), intent (in) :: a
                    real(8), intent (in) :: b
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = tan(b) * r
                    if (b <= (-0.076d0)) then
                        tmp = t_0
                    else if (b <= 1.45d-6) then
                        tmp = (b * r) / cos((a + b))
                    else
                        tmp = t_0
                    end if
                    code = tmp
                end function
                
                public static double code(double r, double a, double b) {
                	double t_0 = Math.tan(b) * r;
                	double tmp;
                	if (b <= -0.076) {
                		tmp = t_0;
                	} else if (b <= 1.45e-6) {
                		tmp = (b * r) / Math.cos((a + b));
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                def code(r, a, b):
                	t_0 = math.tan(b) * r
                	tmp = 0
                	if b <= -0.076:
                		tmp = t_0
                	elif b <= 1.45e-6:
                		tmp = (b * r) / math.cos((a + b))
                	else:
                		tmp = t_0
                	return tmp
                
                function code(r, a, b)
                	t_0 = Float64(tan(b) * r)
                	tmp = 0.0
                	if (b <= -0.076)
                		tmp = t_0;
                	elseif (b <= 1.45e-6)
                		tmp = Float64(Float64(b * r) / cos(Float64(a + b)));
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(r, a, b)
                	t_0 = tan(b) * r;
                	tmp = 0.0;
                	if (b <= -0.076)
                		tmp = t_0;
                	elseif (b <= 1.45e-6)
                		tmp = (b * r) / cos((a + b));
                	else
                		tmp = t_0;
                	end
                	tmp_2 = tmp;
                end
                
                code[r_, a_, b_] := Block[{t$95$0 = N[(N[Tan[b], $MachinePrecision] * r), $MachinePrecision]}, If[LessEqual[b, -0.076], t$95$0, If[LessEqual[b, 1.45e-6], N[(N[(b * r), $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \tan b \cdot r\\
                \mathbf{if}\;b \leq -0.076:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;b \leq 1.45 \cdot 10^{-6}:\\
                \;\;\;\;\frac{b \cdot r}{\cos \left(a + b\right)}\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if b < -0.0759999999999999981 or 1.4500000000000001e-6 < b

                  1. Initial program 77.0%

                    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                  2. Taylor expanded in a around 0

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

                      \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                    2. lower-*.f64N/A

                      \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                    3. quot-tanN/A

                      \[\leadsto r \cdot \tan b \]
                    4. lower-tan.f6460.1

                      \[\leadsto r \cdot \tan b \]
                  4. Applied rewrites60.1%

                    \[\leadsto \color{blue}{r \cdot \tan b} \]
                  5. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto r \cdot \color{blue}{\tan b} \]
                    2. lift-tan.f64N/A

                      \[\leadsto r \cdot \tan b \]
                    3. *-commutativeN/A

                      \[\leadsto \tan b \cdot \color{blue}{r} \]
                    4. lower-*.f64N/A

                      \[\leadsto \tan b \cdot \color{blue}{r} \]
                    5. lift-tan.f6460.1

                      \[\leadsto \tan b \cdot r \]
                  6. Applied rewrites60.1%

                    \[\leadsto \tan b \cdot \color{blue}{r} \]

                  if -0.0759999999999999981 < b < 1.4500000000000001e-6

                  1. Initial program 77.0%

                    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                  2. Taylor expanded in b around 0

                    \[\leadsto \frac{\color{blue}{b \cdot r}}{\cos \left(a + b\right)} \]
                  3. Step-by-step derivation
                    1. lower-*.f6451.9

                      \[\leadsto \frac{b \cdot \color{blue}{r}}{\cos \left(a + b\right)} \]
                  4. Applied rewrites51.9%

                    \[\leadsto \frac{\color{blue}{b \cdot r}}{\cos \left(a + b\right)} \]
                3. Recombined 2 regimes into one program.
                4. Add Preprocessing

                Alternative 13: 76.8% accurate, 1.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan b \cdot r\\ \mathbf{if}\;b \leq -0.076:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 1.45 \cdot 10^{-6}:\\ \;\;\;\;b \cdot \frac{r}{\cos a}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (r a b)
                 :precision binary64
                 (let* ((t_0 (* (tan b) r)))
                   (if (<= b -0.076) t_0 (if (<= b 1.45e-6) (* b (/ r (cos a))) t_0))))
                double code(double r, double a, double b) {
                	double t_0 = tan(b) * r;
                	double tmp;
                	if (b <= -0.076) {
                		tmp = t_0;
                	} else if (b <= 1.45e-6) {
                		tmp = b * (r / cos(a));
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(r, a, b)
                use fmin_fmax_functions
                    real(8), intent (in) :: r
                    real(8), intent (in) :: a
                    real(8), intent (in) :: b
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = tan(b) * r
                    if (b <= (-0.076d0)) then
                        tmp = t_0
                    else if (b <= 1.45d-6) then
                        tmp = b * (r / cos(a))
                    else
                        tmp = t_0
                    end if
                    code = tmp
                end function
                
                public static double code(double r, double a, double b) {
                	double t_0 = Math.tan(b) * r;
                	double tmp;
                	if (b <= -0.076) {
                		tmp = t_0;
                	} else if (b <= 1.45e-6) {
                		tmp = b * (r / Math.cos(a));
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                def code(r, a, b):
                	t_0 = math.tan(b) * r
                	tmp = 0
                	if b <= -0.076:
                		tmp = t_0
                	elif b <= 1.45e-6:
                		tmp = b * (r / math.cos(a))
                	else:
                		tmp = t_0
                	return tmp
                
                function code(r, a, b)
                	t_0 = Float64(tan(b) * r)
                	tmp = 0.0
                	if (b <= -0.076)
                		tmp = t_0;
                	elseif (b <= 1.45e-6)
                		tmp = Float64(b * Float64(r / cos(a)));
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(r, a, b)
                	t_0 = tan(b) * r;
                	tmp = 0.0;
                	if (b <= -0.076)
                		tmp = t_0;
                	elseif (b <= 1.45e-6)
                		tmp = b * (r / cos(a));
                	else
                		tmp = t_0;
                	end
                	tmp_2 = tmp;
                end
                
                code[r_, a_, b_] := Block[{t$95$0 = N[(N[Tan[b], $MachinePrecision] * r), $MachinePrecision]}, If[LessEqual[b, -0.076], t$95$0, If[LessEqual[b, 1.45e-6], N[(b * N[(r / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \tan b \cdot r\\
                \mathbf{if}\;b \leq -0.076:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;b \leq 1.45 \cdot 10^{-6}:\\
                \;\;\;\;b \cdot \frac{r}{\cos a}\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if b < -0.0759999999999999981 or 1.4500000000000001e-6 < b

                  1. Initial program 77.0%

                    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                  2. Taylor expanded in a around 0

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

                      \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                    2. lower-*.f64N/A

                      \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                    3. quot-tanN/A

                      \[\leadsto r \cdot \tan b \]
                    4. lower-tan.f6460.1

                      \[\leadsto r \cdot \tan b \]
                  4. Applied rewrites60.1%

                    \[\leadsto \color{blue}{r \cdot \tan b} \]
                  5. Step-by-step derivation
                    1. lift-*.f64N/A

                      \[\leadsto r \cdot \color{blue}{\tan b} \]
                    2. lift-tan.f64N/A

                      \[\leadsto r \cdot \tan b \]
                    3. *-commutativeN/A

                      \[\leadsto \tan b \cdot \color{blue}{r} \]
                    4. lower-*.f64N/A

                      \[\leadsto \tan b \cdot \color{blue}{r} \]
                    5. lift-tan.f6460.1

                      \[\leadsto \tan b \cdot r \]
                  6. Applied rewrites60.1%

                    \[\leadsto \tan b \cdot \color{blue}{r} \]

                  if -0.0759999999999999981 < b < 1.4500000000000001e-6

                  1. Initial program 77.0%

                    \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                  2. Taylor expanded in b around 0

                    \[\leadsto \color{blue}{\frac{b \cdot r}{\cos a}} \]
                  3. Step-by-step derivation
                    1. associate-/l*N/A

                      \[\leadsto b \cdot \color{blue}{\frac{r}{\cos a}} \]
                    2. lower-*.f64N/A

                      \[\leadsto b \cdot \color{blue}{\frac{r}{\cos a}} \]
                    3. lower-/.f64N/A

                      \[\leadsto b \cdot \frac{r}{\color{blue}{\cos a}} \]
                    4. lower-cos.f6451.9

                      \[\leadsto b \cdot \frac{r}{\cos a} \]
                  4. Applied rewrites51.9%

                    \[\leadsto \color{blue}{b \cdot \frac{r}{\cos a}} \]
                3. Recombined 2 regimes into one program.
                4. Add Preprocessing

                Alternative 14: 76.7% accurate, 1.0× speedup?

                \[\begin{array}{l} \\ \frac{\sin b \cdot r}{\cos \left(a + b\right)} \end{array} \]
                (FPCore (r a b) :precision binary64 (/ (* (sin b) r) (cos (+ a b))))
                double code(double r, double a, double b) {
                	return (sin(b) * r) / cos((a + 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(r, a, b)
                use fmin_fmax_functions
                    real(8), intent (in) :: r
                    real(8), intent (in) :: a
                    real(8), intent (in) :: b
                    code = (sin(b) * r) / cos((a + b))
                end function
                
                public static double code(double r, double a, double b) {
                	return (Math.sin(b) * r) / Math.cos((a + b));
                }
                
                def code(r, a, b):
                	return (math.sin(b) * r) / math.cos((a + b))
                
                function code(r, a, b)
                	return Float64(Float64(sin(b) * r) / cos(Float64(a + b)))
                end
                
                function tmp = code(r, a, b)
                	tmp = (sin(b) * r) / cos((a + b));
                end
                
                code[r_, a_, b_] := N[(N[(N[Sin[b], $MachinePrecision] * r), $MachinePrecision] / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \frac{\sin b \cdot r}{\cos \left(a + b\right)}
                \end{array}
                
                Derivation
                1. Initial program 77.0%

                  \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                2. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \frac{\color{blue}{r \cdot \sin b}}{\cos \left(a + b\right)} \]
                  2. lift-sin.f64N/A

                    \[\leadsto \frac{r \cdot \color{blue}{\sin b}}{\cos \left(a + b\right)} \]
                  3. *-commutativeN/A

                    \[\leadsto \frac{\color{blue}{\sin b \cdot r}}{\cos \left(a + b\right)} \]
                  4. lower-*.f64N/A

                    \[\leadsto \frac{\color{blue}{\sin b \cdot r}}{\cos \left(a + b\right)} \]
                  5. lift-sin.f6477.0

                    \[\leadsto \frac{\color{blue}{\sin b} \cdot r}{\cos \left(a + b\right)} \]
                3. Applied rewrites77.0%

                  \[\leadsto \frac{\color{blue}{\sin b \cdot r}}{\cos \left(a + b\right)} \]
                4. Add Preprocessing

                Alternative 15: 76.7% accurate, 1.0× speedup?

                \[\begin{array}{l} \\ \sin b \cdot \frac{r}{\cos \left(a + b\right)} \end{array} \]
                (FPCore (r a b) :precision binary64 (* (sin b) (/ r (cos (+ a b)))))
                double code(double r, double a, double b) {
                	return sin(b) * (r / cos((a + 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(r, a, b)
                use fmin_fmax_functions
                    real(8), intent (in) :: r
                    real(8), intent (in) :: a
                    real(8), intent (in) :: b
                    code = sin(b) * (r / cos((a + b)))
                end function
                
                public static double code(double r, double a, double b) {
                	return Math.sin(b) * (r / Math.cos((a + b)));
                }
                
                def code(r, a, b):
                	return math.sin(b) * (r / math.cos((a + b)))
                
                function code(r, a, b)
                	return Float64(sin(b) * Float64(r / cos(Float64(a + b))))
                end
                
                function tmp = code(r, a, b)
                	tmp = sin(b) * (r / cos((a + b)));
                end
                
                code[r_, a_, b_] := N[(N[Sin[b], $MachinePrecision] * N[(r / N[Cos[N[(a + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \sin b \cdot \frac{r}{\cos \left(a + b\right)}
                \end{array}
                
                Derivation
                1. Initial program 77.0%

                  \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(a + b\right)}} \]
                  2. lift-cos.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos \left(a + b\right)}} \]
                  3. +-commutativeN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos \color{blue}{\left(b + a\right)}} \]
                  4. cos-sumN/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
                  5. cos-neg-revN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos \left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
                  6. mul-1-negN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(-1 \cdot a\right)} - \sin b \cdot \sin a} \]
                  7. lower--.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos \left(-1 \cdot a\right) - \sin b \cdot \sin a}} \]
                  8. mul-1-negN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos \color{blue}{\left(\mathsf{neg}\left(a\right)\right)} - \sin b \cdot \sin a} \]
                  9. cos-neg-revN/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
                  10. lower-*.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
                  11. lower-cos.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
                  12. lower-cos.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
                  13. lower-*.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
                  14. lift-sin.f64N/A

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
                  15. lower-sin.f6499.5

                    \[\leadsto \frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
                3. Applied rewrites99.5%

                  \[\leadsto \frac{r \cdot \sin b}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
                4. Step-by-step derivation
                  1. lift-/.f64N/A

                    \[\leadsto \color{blue}{\frac{r \cdot \sin b}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
                  2. lift-*.f64N/A

                    \[\leadsto \frac{\color{blue}{r \cdot \sin b}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                  3. lift-sin.f64N/A

                    \[\leadsto \frac{r \cdot \color{blue}{\sin b}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                  4. *-commutativeN/A

                    \[\leadsto \frac{\color{blue}{\sin b \cdot r}}{\cos b \cdot \cos a - \sin b \cdot \sin a} \]
                  5. lift--.f64N/A

                    \[\leadsto \frac{\sin b \cdot r}{\color{blue}{\cos b \cdot \cos a - \sin b \cdot \sin a}} \]
                  6. lift-*.f64N/A

                    \[\leadsto \frac{\sin b \cdot r}{\color{blue}{\cos b \cdot \cos a} - \sin b \cdot \sin a} \]
                  7. lift-cos.f64N/A

                    \[\leadsto \frac{\sin b \cdot r}{\color{blue}{\cos b} \cdot \cos a - \sin b \cdot \sin a} \]
                  8. lift-cos.f64N/A

                    \[\leadsto \frac{\sin b \cdot r}{\cos b \cdot \color{blue}{\cos a} - \sin b \cdot \sin a} \]
                  9. lift-*.f64N/A

                    \[\leadsto \frac{\sin b \cdot r}{\cos b \cdot \cos a - \color{blue}{\sin b \cdot \sin a}} \]
                  10. lift-sin.f64N/A

                    \[\leadsto \frac{\sin b \cdot r}{\cos b \cdot \cos a - \color{blue}{\sin b} \cdot \sin a} \]
                  11. lift-sin.f64N/A

                    \[\leadsto \frac{\sin b \cdot r}{\cos b \cdot \cos a - \sin b \cdot \color{blue}{\sin a}} \]
                  12. cos-sum-revN/A

                    \[\leadsto \frac{\sin b \cdot r}{\color{blue}{\cos \left(b + a\right)}} \]
                  13. +-commutativeN/A

                    \[\leadsto \frac{\sin b \cdot r}{\cos \color{blue}{\left(a + b\right)}} \]
                  14. associate-/l*N/A

                    \[\leadsto \color{blue}{\sin b \cdot \frac{r}{\cos \left(a + b\right)}} \]
                  15. lower-*.f64N/A

                    \[\leadsto \color{blue}{\sin b \cdot \frac{r}{\cos \left(a + b\right)}} \]
                  16. lift-sin.f64N/A

                    \[\leadsto \color{blue}{\sin b} \cdot \frac{r}{\cos \left(a + b\right)} \]
                  17. lower-/.f64N/A

                    \[\leadsto \sin b \cdot \color{blue}{\frac{r}{\cos \left(a + b\right)}} \]
                  18. lift-cos.f64N/A

                    \[\leadsto \sin b \cdot \frac{r}{\color{blue}{\cos \left(a + b\right)}} \]
                  19. lift-+.f6476.9

                    \[\leadsto \sin b \cdot \frac{r}{\cos \color{blue}{\left(a + b\right)}} \]
                5. Applied rewrites76.9%

                  \[\leadsto \color{blue}{\sin b \cdot \frac{r}{\cos \left(a + b\right)}} \]
                6. Add Preprocessing

                Alternative 16: 60.1% accurate, 1.9× speedup?

                \[\begin{array}{l} \\ \tan b \cdot r \end{array} \]
                (FPCore (r a b) :precision binary64 (* (tan b) r))
                double code(double r, double a, double b) {
                	return tan(b) * r;
                }
                
                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(r, a, b)
                use fmin_fmax_functions
                    real(8), intent (in) :: r
                    real(8), intent (in) :: a
                    real(8), intent (in) :: b
                    code = tan(b) * r
                end function
                
                public static double code(double r, double a, double b) {
                	return Math.tan(b) * r;
                }
                
                def code(r, a, b):
                	return math.tan(b) * r
                
                function code(r, a, b)
                	return Float64(tan(b) * r)
                end
                
                function tmp = code(r, a, b)
                	tmp = tan(b) * r;
                end
                
                code[r_, a_, b_] := N[(N[Tan[b], $MachinePrecision] * r), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \tan b \cdot r
                \end{array}
                
                Derivation
                1. Initial program 77.0%

                  \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                2. Taylor expanded in a around 0

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

                    \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                  2. lower-*.f64N/A

                    \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                  3. quot-tanN/A

                    \[\leadsto r \cdot \tan b \]
                  4. lower-tan.f6460.1

                    \[\leadsto r \cdot \tan b \]
                4. Applied rewrites60.1%

                  \[\leadsto \color{blue}{r \cdot \tan b} \]
                5. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto r \cdot \color{blue}{\tan b} \]
                  2. lift-tan.f64N/A

                    \[\leadsto r \cdot \tan b \]
                  3. *-commutativeN/A

                    \[\leadsto \tan b \cdot \color{blue}{r} \]
                  4. lower-*.f64N/A

                    \[\leadsto \tan b \cdot \color{blue}{r} \]
                  5. lift-tan.f6460.1

                    \[\leadsto \tan b \cdot r \]
                6. Applied rewrites60.1%

                  \[\leadsto \tan b \cdot \color{blue}{r} \]
                7. Add Preprocessing

                Alternative 17: 34.8% accurate, 4.1× speedup?

                \[\begin{array}{l} \\ \mathsf{fma}\left(r, b, \left(\left(\left(b \cdot b\right) \cdot r\right) \cdot 0.3333333333333333\right) \cdot b\right) \end{array} \]
                (FPCore (r a b)
                 :precision binary64
                 (fma r b (* (* (* (* b b) r) 0.3333333333333333) b)))
                double code(double r, double a, double b) {
                	return fma(r, b, ((((b * b) * r) * 0.3333333333333333) * b));
                }
                
                function code(r, a, b)
                	return fma(r, b, Float64(Float64(Float64(Float64(b * b) * r) * 0.3333333333333333) * b))
                end
                
                code[r_, a_, b_] := N[(r * b + N[(N[(N[(N[(b * b), $MachinePrecision] * r), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \mathsf{fma}\left(r, b, \left(\left(\left(b \cdot b\right) \cdot r\right) \cdot 0.3333333333333333\right) \cdot b\right)
                \end{array}
                
                Derivation
                1. Initial program 77.0%

                  \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                2. Taylor expanded in a around 0

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

                    \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                  2. lower-*.f64N/A

                    \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                  3. quot-tanN/A

                    \[\leadsto r \cdot \tan b \]
                  4. lower-tan.f6460.1

                    \[\leadsto r \cdot \tan b \]
                4. Applied rewrites60.1%

                  \[\leadsto \color{blue}{r \cdot \tan b} \]
                5. Taylor expanded in b around 0

                  \[\leadsto b \cdot \color{blue}{\left(r + \frac{1}{3} \cdot \left({b}^{2} \cdot r\right)\right)} \]
                6. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, {b}^{2} \cdot r, r\right) \cdot b \]
                  5. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, {b}^{2} \cdot r, r\right) \cdot b \]
                  6. unpow2N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                  7. lower-*.f6434.8

                    \[\leadsto \mathsf{fma}\left(0.3333333333333333, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                7. Applied rewrites34.8%

                  \[\leadsto \mathsf{fma}\left(0.3333333333333333, \left(b \cdot b\right) \cdot r, r\right) \cdot \color{blue}{b} \]
                8. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                  2. lift-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                  3. lift-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                  4. pow2N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, {b}^{2} \cdot r, r\right) \cdot b \]
                  5. lower-fma.f64N/A

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

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

                    \[\leadsto b \cdot \left(r + \color{blue}{\frac{1}{3} \cdot \left({b}^{2} \cdot r\right)}\right) \]
                  8. distribute-rgt-inN/A

                    \[\leadsto r \cdot b + \left(\frac{1}{3} \cdot \left({b}^{2} \cdot r\right)\right) \cdot \color{blue}{b} \]
                  9. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(r, b, \left(\frac{1}{3} \cdot \left({b}^{2} \cdot r\right)\right) \cdot b\right) \]
                  10. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(r, b, \left(\frac{1}{3} \cdot \left({b}^{2} \cdot r\right)\right) \cdot b\right) \]
                  11. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(r, b, \left(\left({b}^{2} \cdot r\right) \cdot \frac{1}{3}\right) \cdot b\right) \]
                  12. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(r, b, \left(\left({b}^{2} \cdot r\right) \cdot \frac{1}{3}\right) \cdot b\right) \]
                  13. pow2N/A

                    \[\leadsto \mathsf{fma}\left(r, b, \left(\left(\left(b \cdot b\right) \cdot r\right) \cdot \frac{1}{3}\right) \cdot b\right) \]
                  14. lift-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(r, b, \left(\left(\left(b \cdot b\right) \cdot r\right) \cdot \frac{1}{3}\right) \cdot b\right) \]
                  15. lift-*.f6434.8

                    \[\leadsto \mathsf{fma}\left(r, b, \left(\left(\left(b \cdot b\right) \cdot r\right) \cdot 0.3333333333333333\right) \cdot b\right) \]
                9. Applied rewrites34.8%

                  \[\leadsto \mathsf{fma}\left(r, b, \left(\left(\left(b \cdot b\right) \cdot r\right) \cdot 0.3333333333333333\right) \cdot b\right) \]
                10. Add Preprocessing

                Alternative 18: 34.8% accurate, 5.0× speedup?

                \[\begin{array}{l} \\ \mathsf{fma}\left(0.3333333333333333, b \cdot \left(b \cdot r\right), r\right) \cdot b \end{array} \]
                (FPCore (r a b)
                 :precision binary64
                 (* (fma 0.3333333333333333 (* b (* b r)) r) b))
                double code(double r, double a, double b) {
                	return fma(0.3333333333333333, (b * (b * r)), r) * b;
                }
                
                function code(r, a, b)
                	return Float64(fma(0.3333333333333333, Float64(b * Float64(b * r)), r) * b)
                end
                
                code[r_, a_, b_] := N[(N[(0.3333333333333333 * N[(b * N[(b * r), $MachinePrecision]), $MachinePrecision] + r), $MachinePrecision] * b), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \mathsf{fma}\left(0.3333333333333333, b \cdot \left(b \cdot r\right), r\right) \cdot b
                \end{array}
                
                Derivation
                1. Initial program 77.0%

                  \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                2. Taylor expanded in a around 0

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

                    \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                  2. lower-*.f64N/A

                    \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                  3. quot-tanN/A

                    \[\leadsto r \cdot \tan b \]
                  4. lower-tan.f6460.1

                    \[\leadsto r \cdot \tan b \]
                4. Applied rewrites60.1%

                  \[\leadsto \color{blue}{r \cdot \tan b} \]
                5. Taylor expanded in b around 0

                  \[\leadsto b \cdot \color{blue}{\left(r + \frac{1}{3} \cdot \left({b}^{2} \cdot r\right)\right)} \]
                6. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, {b}^{2} \cdot r, r\right) \cdot b \]
                  5. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, {b}^{2} \cdot r, r\right) \cdot b \]
                  6. unpow2N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                  7. lower-*.f6434.8

                    \[\leadsto \mathsf{fma}\left(0.3333333333333333, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                7. Applied rewrites34.8%

                  \[\leadsto \mathsf{fma}\left(0.3333333333333333, \left(b \cdot b\right) \cdot r, r\right) \cdot \color{blue}{b} \]
                8. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                  2. lift-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                  3. associate-*l*N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, b \cdot \left(b \cdot r\right), r\right) \cdot b \]
                  4. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, b \cdot \left(b \cdot r\right), r\right) \cdot b \]
                  5. lower-*.f6434.8

                    \[\leadsto \mathsf{fma}\left(0.3333333333333333, b \cdot \left(b \cdot r\right), r\right) \cdot b \]
                9. Applied rewrites34.8%

                  \[\leadsto \mathsf{fma}\left(0.3333333333333333, b \cdot \left(b \cdot r\right), r\right) \cdot b \]
                10. Add Preprocessing

                Alternative 19: 34.8% accurate, 5.0× speedup?

                \[\begin{array}{l} \\ \left(\mathsf{fma}\left(b \cdot b, 0.3333333333333333, 1\right) \cdot r\right) \cdot b \end{array} \]
                (FPCore (r a b)
                 :precision binary64
                 (* (* (fma (* b b) 0.3333333333333333 1.0) r) b))
                double code(double r, double a, double b) {
                	return (fma((b * b), 0.3333333333333333, 1.0) * r) * b;
                }
                
                function code(r, a, b)
                	return Float64(Float64(fma(Float64(b * b), 0.3333333333333333, 1.0) * r) * b)
                end
                
                code[r_, a_, b_] := N[(N[(N[(N[(b * b), $MachinePrecision] * 0.3333333333333333 + 1.0), $MachinePrecision] * r), $MachinePrecision] * b), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \left(\mathsf{fma}\left(b \cdot b, 0.3333333333333333, 1\right) \cdot r\right) \cdot b
                \end{array}
                
                Derivation
                1. Initial program 77.0%

                  \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                2. Taylor expanded in a around 0

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

                    \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                  2. lower-*.f64N/A

                    \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                  3. quot-tanN/A

                    \[\leadsto r \cdot \tan b \]
                  4. lower-tan.f6460.1

                    \[\leadsto r \cdot \tan b \]
                4. Applied rewrites60.1%

                  \[\leadsto \color{blue}{r \cdot \tan b} \]
                5. Taylor expanded in b around 0

                  \[\leadsto b \cdot \color{blue}{\left(r + \frac{1}{3} \cdot \left({b}^{2} \cdot r\right)\right)} \]
                6. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, {b}^{2} \cdot r, r\right) \cdot b \]
                  5. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, {b}^{2} \cdot r, r\right) \cdot b \]
                  6. unpow2N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                  7. lower-*.f6434.8

                    \[\leadsto \mathsf{fma}\left(0.3333333333333333, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                7. Applied rewrites34.8%

                  \[\leadsto \mathsf{fma}\left(0.3333333333333333, \left(b \cdot b\right) \cdot r, r\right) \cdot \color{blue}{b} \]
                8. Taylor expanded in r around 0

                  \[\leadsto \left(r \cdot \left(1 + \frac{1}{3} \cdot {b}^{2}\right)\right) \cdot b \]
                9. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

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

                    \[\leadsto \left(\mathsf{fma}\left({b}^{2}, \frac{1}{3}, 1\right) \cdot r\right) \cdot b \]
                  6. pow2N/A

                    \[\leadsto \left(\mathsf{fma}\left(b \cdot b, \frac{1}{3}, 1\right) \cdot r\right) \cdot b \]
                  7. lift-*.f6434.8

                    \[\leadsto \left(\mathsf{fma}\left(b \cdot b, 0.3333333333333333, 1\right) \cdot r\right) \cdot b \]
                10. Applied rewrites34.8%

                  \[\leadsto \left(\mathsf{fma}\left(b \cdot b, 0.3333333333333333, 1\right) \cdot r\right) \cdot b \]
                11. Add Preprocessing

                Alternative 20: 15.7% accurate, 5.7× speedup?

                \[\begin{array}{l} \\ \left(\left(b \cdot b\right) \cdot \left(b \cdot r\right)\right) \cdot 0.3333333333333333 \end{array} \]
                (FPCore (r a b) :precision binary64 (* (* (* b b) (* b r)) 0.3333333333333333))
                double code(double r, double a, double b) {
                	return ((b * b) * (b * r)) * 0.3333333333333333;
                }
                
                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(r, a, b)
                use fmin_fmax_functions
                    real(8), intent (in) :: r
                    real(8), intent (in) :: a
                    real(8), intent (in) :: b
                    code = ((b * b) * (b * r)) * 0.3333333333333333d0
                end function
                
                public static double code(double r, double a, double b) {
                	return ((b * b) * (b * r)) * 0.3333333333333333;
                }
                
                def code(r, a, b):
                	return ((b * b) * (b * r)) * 0.3333333333333333
                
                function code(r, a, b)
                	return Float64(Float64(Float64(b * b) * Float64(b * r)) * 0.3333333333333333)
                end
                
                function tmp = code(r, a, b)
                	tmp = ((b * b) * (b * r)) * 0.3333333333333333;
                end
                
                code[r_, a_, b_] := N[(N[(N[(b * b), $MachinePrecision] * N[(b * r), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \left(\left(b \cdot b\right) \cdot \left(b \cdot r\right)\right) \cdot 0.3333333333333333
                \end{array}
                
                Derivation
                1. Initial program 77.0%

                  \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                2. Taylor expanded in a around 0

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

                    \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                  2. lower-*.f64N/A

                    \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                  3. quot-tanN/A

                    \[\leadsto r \cdot \tan b \]
                  4. lower-tan.f6460.1

                    \[\leadsto r \cdot \tan b \]
                4. Applied rewrites60.1%

                  \[\leadsto \color{blue}{r \cdot \tan b} \]
                5. Taylor expanded in b around 0

                  \[\leadsto b \cdot \color{blue}{\left(r + \frac{1}{3} \cdot \left({b}^{2} \cdot r\right)\right)} \]
                6. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, {b}^{2} \cdot r, r\right) \cdot b \]
                  5. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, {b}^{2} \cdot r, r\right) \cdot b \]
                  6. unpow2N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                  7. lower-*.f6434.8

                    \[\leadsto \mathsf{fma}\left(0.3333333333333333, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                7. Applied rewrites34.8%

                  \[\leadsto \mathsf{fma}\left(0.3333333333333333, \left(b \cdot b\right) \cdot r, r\right) \cdot \color{blue}{b} \]
                8. Taylor expanded in b around inf

                  \[\leadsto \frac{1}{3} \cdot \left({b}^{3} \cdot \color{blue}{r}\right) \]
                9. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \left({b}^{3} \cdot r\right) \cdot \frac{1}{3} \]
                  2. lower-*.f64N/A

                    \[\leadsto \left({b}^{3} \cdot r\right) \cdot \frac{1}{3} \]
                  3. lower-*.f64N/A

                    \[\leadsto \left({b}^{3} \cdot r\right) \cdot \frac{1}{3} \]
                  4. unpow3N/A

                    \[\leadsto \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \cdot \frac{1}{3} \]
                  5. pow2N/A

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

                    \[\leadsto \left(\left({b}^{2} \cdot b\right) \cdot r\right) \cdot \frac{1}{3} \]
                  7. pow2N/A

                    \[\leadsto \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \cdot \frac{1}{3} \]
                  8. lift-*.f6415.7

                    \[\leadsto \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \cdot 0.3333333333333333 \]
                10. Applied rewrites15.7%

                  \[\leadsto \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \cdot 0.3333333333333333 \]
                11. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \cdot \frac{1}{3} \]
                  2. lift-*.f64N/A

                    \[\leadsto \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \cdot \frac{1}{3} \]
                  3. pow2N/A

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

                    \[\leadsto \left(\left({b}^{2} \cdot b\right) \cdot r\right) \cdot \frac{1}{3} \]
                  5. associate-*l*N/A

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

                    \[\leadsto \left({b}^{2} \cdot \left(b \cdot r\right)\right) \cdot \frac{1}{3} \]
                  7. pow2N/A

                    \[\leadsto \left(\left(b \cdot b\right) \cdot \left(b \cdot r\right)\right) \cdot \frac{1}{3} \]
                  8. lift-*.f64N/A

                    \[\leadsto \left(\left(b \cdot b\right) \cdot \left(b \cdot r\right)\right) \cdot \frac{1}{3} \]
                  9. lift-*.f6415.7

                    \[\leadsto \left(\left(b \cdot b\right) \cdot \left(b \cdot r\right)\right) \cdot 0.3333333333333333 \]
                12. Applied rewrites15.7%

                  \[\leadsto \left(\left(b \cdot b\right) \cdot \left(b \cdot r\right)\right) \cdot 0.3333333333333333 \]
                13. Add Preprocessing

                Alternative 21: 15.7% accurate, 5.7× speedup?

                \[\begin{array}{l} \\ \left(0.3333333333333333 \cdot \left(\left(b \cdot b\right) \cdot b\right)\right) \cdot r \end{array} \]
                (FPCore (r a b) :precision binary64 (* (* 0.3333333333333333 (* (* b b) b)) r))
                double code(double r, double a, double b) {
                	return (0.3333333333333333 * ((b * b) * b)) * r;
                }
                
                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(r, a, b)
                use fmin_fmax_functions
                    real(8), intent (in) :: r
                    real(8), intent (in) :: a
                    real(8), intent (in) :: b
                    code = (0.3333333333333333d0 * ((b * b) * b)) * r
                end function
                
                public static double code(double r, double a, double b) {
                	return (0.3333333333333333 * ((b * b) * b)) * r;
                }
                
                def code(r, a, b):
                	return (0.3333333333333333 * ((b * b) * b)) * r
                
                function code(r, a, b)
                	return Float64(Float64(0.3333333333333333 * Float64(Float64(b * b) * b)) * r)
                end
                
                function tmp = code(r, a, b)
                	tmp = (0.3333333333333333 * ((b * b) * b)) * r;
                end
                
                code[r_, a_, b_] := N[(N[(0.3333333333333333 * N[(N[(b * b), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] * r), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \left(0.3333333333333333 \cdot \left(\left(b \cdot b\right) \cdot b\right)\right) \cdot r
                \end{array}
                
                Derivation
                1. Initial program 77.0%

                  \[\frac{r \cdot \sin b}{\cos \left(a + b\right)} \]
                2. Taylor expanded in a around 0

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

                    \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                  2. lower-*.f64N/A

                    \[\leadsto r \cdot \color{blue}{\frac{\sin b}{\cos b}} \]
                  3. quot-tanN/A

                    \[\leadsto r \cdot \tan b \]
                  4. lower-tan.f6460.1

                    \[\leadsto r \cdot \tan b \]
                4. Applied rewrites60.1%

                  \[\leadsto \color{blue}{r \cdot \tan b} \]
                5. Taylor expanded in b around 0

                  \[\leadsto b \cdot \color{blue}{\left(r + \frac{1}{3} \cdot \left({b}^{2} \cdot r\right)\right)} \]
                6. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, {b}^{2} \cdot r, r\right) \cdot b \]
                  5. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, {b}^{2} \cdot r, r\right) \cdot b \]
                  6. unpow2N/A

                    \[\leadsto \mathsf{fma}\left(\frac{1}{3}, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                  7. lower-*.f6434.8

                    \[\leadsto \mathsf{fma}\left(0.3333333333333333, \left(b \cdot b\right) \cdot r, r\right) \cdot b \]
                7. Applied rewrites34.8%

                  \[\leadsto \mathsf{fma}\left(0.3333333333333333, \left(b \cdot b\right) \cdot r, r\right) \cdot \color{blue}{b} \]
                8. Taylor expanded in b around inf

                  \[\leadsto \frac{1}{3} \cdot \left({b}^{3} \cdot \color{blue}{r}\right) \]
                9. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \left({b}^{3} \cdot r\right) \cdot \frac{1}{3} \]
                  2. lower-*.f64N/A

                    \[\leadsto \left({b}^{3} \cdot r\right) \cdot \frac{1}{3} \]
                  3. lower-*.f64N/A

                    \[\leadsto \left({b}^{3} \cdot r\right) \cdot \frac{1}{3} \]
                  4. unpow3N/A

                    \[\leadsto \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \cdot \frac{1}{3} \]
                  5. pow2N/A

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

                    \[\leadsto \left(\left({b}^{2} \cdot b\right) \cdot r\right) \cdot \frac{1}{3} \]
                  7. pow2N/A

                    \[\leadsto \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \cdot \frac{1}{3} \]
                  8. lift-*.f6415.7

                    \[\leadsto \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \cdot 0.3333333333333333 \]
                10. Applied rewrites15.7%

                  \[\leadsto \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \cdot 0.3333333333333333 \]
                11. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \cdot \frac{1}{3} \]
                  2. lift-*.f64N/A

                    \[\leadsto \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \cdot \frac{1}{3} \]
                  3. lift-*.f64N/A

                    \[\leadsto \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \cdot \frac{1}{3} \]
                  4. lift-*.f64N/A

                    \[\leadsto \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \cdot \frac{1}{3} \]
                  5. *-commutativeN/A

                    \[\leadsto \frac{1}{3} \cdot \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot r\right) \]
                  6. associate-*r*N/A

                    \[\leadsto \left(\frac{1}{3} \cdot \left(\left(b \cdot b\right) \cdot b\right)\right) \cdot r \]
                  7. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{3} \cdot \left(\left(b \cdot b\right) \cdot b\right)\right) \cdot r \]
                  8. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{3} \cdot \left(\left(b \cdot b\right) \cdot b\right)\right) \cdot r \]
                  9. lift-*.f64N/A

                    \[\leadsto \left(\frac{1}{3} \cdot \left(\left(b \cdot b\right) \cdot b\right)\right) \cdot r \]
                  10. lift-*.f6415.7

                    \[\leadsto \left(0.3333333333333333 \cdot \left(\left(b \cdot b\right) \cdot b\right)\right) \cdot r \]
                12. Applied rewrites15.7%

                  \[\leadsto \left(0.3333333333333333 \cdot \left(\left(b \cdot b\right) \cdot b\right)\right) \cdot r \]
                13. Add Preprocessing

                Reproduce

                ?
                herbie shell --seed 2025128 
                (FPCore (r a b)
                  :name "rsin A (should all be same)"
                  :precision binary64
                  (/ (* r (sin b)) (cos (+ a b))))