tan-example (used to crash)

Percentage Accurate: 79.1% → 99.7%
Time: 11.3s
Alternatives: 18
Speedup: 1.0×

Specification

?
\[\left(\left(\left(x = 0 \lor 0.5884142 \leq x \land x \leq 505.5909\right) \land \left(-1.796658 \cdot 10^{+308} \leq y \land y \leq -9.425585 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \leq y \land y \leq 1.751224 \cdot 10^{+308}\right)\right) \land \left(-1.776707 \cdot 10^{+308} \leq z \land z \leq -8.599796 \cdot 10^{-310} \lor 3.293145 \cdot 10^{-311} \leq z \land z \leq 1.725154 \cdot 10^{+308}\right)\right) \land \left(-1.796658 \cdot 10^{+308} \leq a \land a \leq -9.425585 \cdot 10^{-310} \lor 1.284938 \cdot 10^{-309} \leq a \land a \leq 1.751224 \cdot 10^{+308}\right)\]
\[\begin{array}{l} \\ x + \left(\tan \left(y + z\right) - \tan a\right) \end{array} \]
(FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
double code(double x, double y, double z, double a) {
	return x + (tan((y + z)) - tan(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(x, y, z, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: a
    code = x + (tan((y + z)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
	return x + (Math.tan((y + z)) - Math.tan(a));
}
def code(x, y, z, a):
	return x + (math.tan((y + z)) - math.tan(a))
function code(x, y, z, a)
	return Float64(x + Float64(tan(Float64(y + z)) - tan(a)))
end
function tmp = code(x, y, z, a)
	tmp = x + (tan((y + z)) - tan(a));
end
code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(\tan \left(y + z\right) - \tan a\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 18 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: 79.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(\tan \left(y + z\right) - \tan a\right) \end{array} \]
(FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
double code(double x, double y, double z, double a) {
	return x + (tan((y + z)) - tan(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(x, y, z, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: a
    code = x + (tan((y + z)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
	return x + (Math.tan((y + z)) - Math.tan(a));
}
def code(x, y, z, a):
	return x + (math.tan((y + z)) - math.tan(a))
function code(x, y, z, a)
	return Float64(x + Float64(tan(Float64(y + z)) - tan(a)))
end
function tmp = code(x, y, z, a)
	tmp = x + (tan((y + z)) - tan(a));
end
code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(\tan \left(y + z\right) - \tan a\right)
\end{array}

Alternative 1: 99.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)\\ x + \left(\left(\frac{\sin z \cdot \cos y}{t\_0} + \frac{\cos z \cdot \sin y}{t\_0}\right) - \tan a\right) \end{array} \end{array} \]
(FPCore (x y z a)
 :precision binary64
 (let* ((t_0 (fma (cos z) (cos y) (* (sin z) (sin (- y))))))
   (+
    x
    (- (+ (/ (* (sin z) (cos y)) t_0) (/ (* (cos z) (sin y)) t_0)) (tan a)))))
double code(double x, double y, double z, double a) {
	double t_0 = fma(cos(z), cos(y), (sin(z) * sin(-y)));
	return x + ((((sin(z) * cos(y)) / t_0) + ((cos(z) * sin(y)) / t_0)) - tan(a));
}
function code(x, y, z, a)
	t_0 = fma(cos(z), cos(y), Float64(sin(z) * sin(Float64(-y))))
	return Float64(x + Float64(Float64(Float64(Float64(sin(z) * cos(y)) / t_0) + Float64(Float64(cos(z) * sin(y)) / t_0)) - tan(a)))
end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Cos[z], $MachinePrecision] * N[Cos[y], $MachinePrecision] + N[(N[Sin[z], $MachinePrecision] * N[Sin[(-y)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x + N[(N[(N[(N[(N[Sin[z], $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(N[(N[Cos[z], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)\\
x + \left(\left(\frac{\sin z \cdot \cos y}{t\_0} + \frac{\cos z \cdot \sin y}{t\_0}\right) - \tan a\right)
\end{array}
\end{array}
Derivation
  1. Initial program 79.1%

    \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
  2. Step-by-step derivation
    1. lift-tan.f64N/A

      \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
    2. tan-quotN/A

      \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
    3. lift-+.f64N/A

      \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
    4. +-commutativeN/A

      \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
    5. sin-sumN/A

      \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
    6. div-addN/A

      \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
    7. *-commutativeN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    8. lower-+.f64N/A

      \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
    9. lower-/.f64N/A

      \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    10. lower-*.f64N/A

      \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    11. lower-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    12. lower-cos.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    13. lower-cos.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    14. lift-+.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    15. +-commutativeN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    16. lower-+.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    17. lower-/.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
  3. Applied rewrites79.6%

    \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
  4. Step-by-step derivation
    1. lift-cos.f64N/A

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

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    3. add-flipN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    4. cos-diffN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    5. cos-neg-revN/A

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

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

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    8. lower-fma.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    9. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    10. lower-*.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    11. lower-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    12. lower-neg.f6480.4

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
  5. Applied rewrites80.4%

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

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
    2. lift-+.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
    3. add-flipN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
    4. cos-diffN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
    5. cos-neg-revN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
    6. lift-cos.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
    7. lift-cos.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
    8. lower-fma.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
    9. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
    10. lower-*.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
    11. lower-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
    12. lower-neg.f6499.7

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
  7. Applied rewrites99.7%

    \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}}\right) - \tan a\right) \]
  8. Add Preprocessing

Alternative 2: 99.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos z \cdot \cos y - \sin y \cdot \sin z\\ x + \left(\left(\frac{\sin z \cdot \cos y}{t\_0} + \frac{\cos z \cdot \sin y}{t\_0}\right) - \tan a\right) \end{array} \end{array} \]
(FPCore (x y z a)
 :precision binary64
 (let* ((t_0 (- (* (cos z) (cos y)) (* (sin y) (sin z)))))
   (+
    x
    (- (+ (/ (* (sin z) (cos y)) t_0) (/ (* (cos z) (sin y)) t_0)) (tan a)))))
double code(double x, double y, double z, double a) {
	double t_0 = (cos(z) * cos(y)) - (sin(y) * sin(z));
	return x + ((((sin(z) * cos(y)) / t_0) + ((cos(z) * sin(y)) / t_0)) - tan(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(x, y, z, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: a
    real(8) :: t_0
    t_0 = (cos(z) * cos(y)) - (sin(y) * sin(z))
    code = x + ((((sin(z) * cos(y)) / t_0) + ((cos(z) * sin(y)) / t_0)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
	double t_0 = (Math.cos(z) * Math.cos(y)) - (Math.sin(y) * Math.sin(z));
	return x + ((((Math.sin(z) * Math.cos(y)) / t_0) + ((Math.cos(z) * Math.sin(y)) / t_0)) - Math.tan(a));
}
def code(x, y, z, a):
	t_0 = (math.cos(z) * math.cos(y)) - (math.sin(y) * math.sin(z))
	return x + ((((math.sin(z) * math.cos(y)) / t_0) + ((math.cos(z) * math.sin(y)) / t_0)) - math.tan(a))
function code(x, y, z, a)
	t_0 = Float64(Float64(cos(z) * cos(y)) - Float64(sin(y) * sin(z)))
	return Float64(x + Float64(Float64(Float64(Float64(sin(z) * cos(y)) / t_0) + Float64(Float64(cos(z) * sin(y)) / t_0)) - tan(a)))
end
function tmp = code(x, y, z, a)
	t_0 = (cos(z) * cos(y)) - (sin(y) * sin(z));
	tmp = x + ((((sin(z) * cos(y)) / t_0) + ((cos(z) * sin(y)) / t_0)) - tan(a));
end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[(N[Cos[z], $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] * N[Sin[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x + N[(N[(N[(N[(N[Sin[z], $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(N[(N[Cos[z], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \cos z \cdot \cos y - \sin y \cdot \sin z\\
x + \left(\left(\frac{\sin z \cdot \cos y}{t\_0} + \frac{\cos z \cdot \sin y}{t\_0}\right) - \tan a\right)
\end{array}
\end{array}
Derivation
  1. Initial program 79.1%

    \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
  2. Step-by-step derivation
    1. lift-tan.f64N/A

      \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
    2. tan-quotN/A

      \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
    3. lift-+.f64N/A

      \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
    4. +-commutativeN/A

      \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
    5. sin-sumN/A

      \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
    6. div-addN/A

      \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
    7. *-commutativeN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    8. lower-+.f64N/A

      \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
    9. lower-/.f64N/A

      \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    10. lower-*.f64N/A

      \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    11. lower-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    12. lower-cos.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    13. lower-cos.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    14. lift-+.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    15. +-commutativeN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    16. lower-+.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
    17. lower-/.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
  3. Applied rewrites79.6%

    \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
  4. Step-by-step derivation
    1. lift-cos.f64N/A

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

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    3. cos-sumN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos y - \sin z \cdot \sin y}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    4. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \color{blue}{\sin z} \cdot \sin y} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    5. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin z \cdot \color{blue}{\sin y}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    6. *-commutativeN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \color{blue}{\sin y \cdot \sin z}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    7. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \color{blue}{\sin y} \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    8. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \color{blue}{\sin z}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    9. lower--.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos y - \sin y \cdot \sin z}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    10. lift-cos.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z} \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    11. lift-cos.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    12. lower-*.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos y} - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    13. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \color{blue}{\sin y} \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    14. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \color{blue}{\sin z}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    15. lower-*.f6480.4

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \color{blue}{\sin y \cdot \sin z}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
  5. Applied rewrites80.4%

    \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos y - \sin y \cdot \sin z}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
  6. Step-by-step derivation
    1. lift-cos.f64N/A

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

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
    3. cos-sumN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos y - \sin z \cdot \sin y}}\right) - \tan a\right) \]
    4. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos z \cdot \cos y - \color{blue}{\sin z} \cdot \sin y}\right) - \tan a\right) \]
    5. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos z \cdot \cos y - \sin z \cdot \color{blue}{\sin y}}\right) - \tan a\right) \]
    6. *-commutativeN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos z \cdot \cos y - \color{blue}{\sin y \cdot \sin z}}\right) - \tan a\right) \]
    7. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos z \cdot \cos y - \color{blue}{\sin y} \cdot \sin z}\right) - \tan a\right) \]
    8. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos z \cdot \cos y - \sin y \cdot \color{blue}{\sin z}}\right) - \tan a\right) \]
    9. lower--.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos y - \sin y \cdot \sin z}}\right) - \tan a\right) \]
    10. lift-cos.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y - \sin y \cdot \sin z}\right) - \tan a\right) \]
    11. lift-cos.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} - \sin y \cdot \sin z}\right) - \tan a\right) \]
    12. lower-*.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos y} - \sin y \cdot \sin z}\right) - \tan a\right) \]
    13. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos z \cdot \cos y - \color{blue}{\sin y} \cdot \sin z}\right) - \tan a\right) \]
    14. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos z \cdot \cos y - \sin y \cdot \color{blue}{\sin z}}\right) - \tan a\right) \]
    15. lower-*.f6499.7

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos z \cdot \cos y - \color{blue}{\sin y \cdot \sin z}}\right) - \tan a\right) \]
  7. Applied rewrites99.7%

    \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos y - \sin y \cdot \sin z}}\right) - \tan a\right) \]
  8. Add Preprocessing

Alternative 3: 88.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(y + z\right)\\ t_1 := \mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)\\ t_2 := \frac{\sin z \cdot \cos y}{t\_1}\\ t_3 := \frac{\cos z \cdot \sin y}{t\_1}\\ \mathbf{if}\;\tan a \leq -0.0005:\\ \;\;\;\;x + \left(\left(t\_2 + \frac{\sin y \cdot \cos z}{t\_0}\right) - \tan a\right)\\ \mathbf{elif}\;\tan a \leq 5 \cdot 10^{-70}:\\ \;\;\;\;x + \left(\left(t\_2 + t\_3\right) - a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(\frac{\cos y \cdot \sin z}{t\_0} + t\_3\right) - \tan a\right)\\ \end{array} \end{array} \]
(FPCore (x y z a)
 :precision binary64
 (let* ((t_0 (cos (+ y z)))
        (t_1 (fma (cos z) (cos y) (* (sin z) (sin (- y)))))
        (t_2 (/ (* (sin z) (cos y)) t_1))
        (t_3 (/ (* (cos z) (sin y)) t_1)))
   (if (<= (tan a) -0.0005)
     (+ x (- (+ t_2 (/ (* (sin y) (cos z)) t_0)) (tan a)))
     (if (<= (tan a) 5e-70)
       (+ x (- (+ t_2 t_3) a))
       (+ x (- (+ (/ (* (cos y) (sin z)) t_0) t_3) (tan a)))))))
double code(double x, double y, double z, double a) {
	double t_0 = cos((y + z));
	double t_1 = fma(cos(z), cos(y), (sin(z) * sin(-y)));
	double t_2 = (sin(z) * cos(y)) / t_1;
	double t_3 = (cos(z) * sin(y)) / t_1;
	double tmp;
	if (tan(a) <= -0.0005) {
		tmp = x + ((t_2 + ((sin(y) * cos(z)) / t_0)) - tan(a));
	} else if (tan(a) <= 5e-70) {
		tmp = x + ((t_2 + t_3) - a);
	} else {
		tmp = x + ((((cos(y) * sin(z)) / t_0) + t_3) - tan(a));
	}
	return tmp;
}
function code(x, y, z, a)
	t_0 = cos(Float64(y + z))
	t_1 = fma(cos(z), cos(y), Float64(sin(z) * sin(Float64(-y))))
	t_2 = Float64(Float64(sin(z) * cos(y)) / t_1)
	t_3 = Float64(Float64(cos(z) * sin(y)) / t_1)
	tmp = 0.0
	if (tan(a) <= -0.0005)
		tmp = Float64(x + Float64(Float64(t_2 + Float64(Float64(sin(y) * cos(z)) / t_0)) - tan(a)));
	elseif (tan(a) <= 5e-70)
		tmp = Float64(x + Float64(Float64(t_2 + t_3) - a));
	else
		tmp = Float64(x + Float64(Float64(Float64(Float64(cos(y) * sin(z)) / t_0) + t_3) - tan(a)));
	end
	return tmp
end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[z], $MachinePrecision] * N[Cos[y], $MachinePrecision] + N[(N[Sin[z], $MachinePrecision] * N[Sin[(-y)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Sin[z], $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[Cos[z], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.0005], N[(x + N[(N[(t$95$2 + N[(N[(N[Sin[y], $MachinePrecision] * N[Cos[z], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 5e-70], N[(x + N[(N[(t$95$2 + t$95$3), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(N[(N[Cos[y], $MachinePrecision] * N[Sin[z], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + t$95$3), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \cos \left(y + z\right)\\
t_1 := \mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)\\
t_2 := \frac{\sin z \cdot \cos y}{t\_1}\\
t_3 := \frac{\cos z \cdot \sin y}{t\_1}\\
\mathbf{if}\;\tan a \leq -0.0005:\\
\;\;\;\;x + \left(\left(t\_2 + \frac{\sin y \cdot \cos z}{t\_0}\right) - \tan a\right)\\

\mathbf{elif}\;\tan a \leq 5 \cdot 10^{-70}:\\
\;\;\;\;x + \left(\left(t\_2 + t\_3\right) - a\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(\left(\frac{\cos y \cdot \sin z}{t\_0} + t\_3\right) - \tan a\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (tan.f64 a) < -5.0000000000000001e-4

    1. Initial program 79.1%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Step-by-step derivation
      1. lift-tan.f64N/A

        \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
      2. tan-quotN/A

        \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
      3. lift-+.f64N/A

        \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
      4. +-commutativeN/A

        \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
      5. sin-sumN/A

        \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
      6. div-addN/A

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
      7. *-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      8. lower-+.f64N/A

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
      9. lower-/.f64N/A

        \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      10. lower-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      11. lower-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      12. lower-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      13. lower-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      14. lift-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      15. +-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      16. lower-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      17. lower-/.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
    3. Applied rewrites79.6%

      \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
    4. Step-by-step derivation
      1. lift-cos.f64N/A

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

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      3. add-flipN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      4. cos-diffN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      5. cos-neg-revN/A

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

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

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      8. lower-fma.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      9. lift-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      10. lower-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      11. lower-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      12. lower-neg.f6480.4

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    5. Applied rewrites80.4%

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

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
      2. lift-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
      3. add-flipN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
      4. cos-diffN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
      5. cos-neg-revN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
      6. lift-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
      7. lift-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
      8. lower-fma.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
      9. lift-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
      10. lower-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
      11. lower-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
      12. lower-neg.f6499.7

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
    7. Applied rewrites99.7%

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}}\right) - \tan a\right) \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\color{blue}{\cos z \cdot \sin y}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      2. *-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      3. lower-*.f6499.7

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos z \cdot \cos y + \sin z \cdot \sin \left(-y\right)}}\right) - \tan a\right) \]
      5. lift-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
      6. lift-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
      7. cos-neg-revN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \color{blue}{\cos \left(\mathsf{neg}\left(y\right)\right)} + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
      8. lift-neg.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \color{blue}{\left(-y\right)} + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
      9. lift-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z \cdot \sin \left(-y\right)}}\right) - \tan a\right) \]
      10. lift-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z} \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
      11. lift-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \left(-y\right) + \sin z \cdot \color{blue}{\sin \left(-y\right)}}\right) - \tan a\right) \]
      12. cos-diff-revN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos \left(z - \left(-y\right)\right)}}\right) - \tan a\right) \]
      13. lift-neg.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \left(z - \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
      14. add-flipN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
      15. +-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \color{blue}{\left(y + z\right)}}\right) - \tan a\right) \]
      16. lift-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \color{blue}{\left(y + z\right)}}\right) - \tan a\right) \]
      17. lift-cos.f6480.4

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
    9. Applied rewrites80.4%

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]

    if -5.0000000000000001e-4 < (tan.f64 a) < 4.9999999999999998e-70

    1. Initial program 79.1%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Step-by-step derivation
      1. lift-tan.f64N/A

        \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
      2. tan-quotN/A

        \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
      3. lift-+.f64N/A

        \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
      4. +-commutativeN/A

        \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
      5. sin-sumN/A

        \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
      6. div-addN/A

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
      7. *-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      8. lower-+.f64N/A

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
      9. lower-/.f64N/A

        \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      10. lower-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      11. lower-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      12. lower-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      13. lower-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      14. lift-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      15. +-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      16. lower-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      17. lower-/.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
    3. Applied rewrites79.6%

      \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
    4. Step-by-step derivation
      1. lift-cos.f64N/A

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

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      3. add-flipN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      4. cos-diffN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      5. cos-neg-revN/A

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

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

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      8. lower-fma.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      9. lift-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      10. lower-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      11. lower-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      12. lower-neg.f6480.4

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    5. Applied rewrites80.4%

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

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
      2. lift-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
      3. add-flipN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
      4. cos-diffN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
      5. cos-neg-revN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
      6. lift-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
      7. lift-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
      8. lower-fma.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
      9. lift-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
      10. lower-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
      11. lower-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
      12. lower-neg.f6499.7

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
    7. Applied rewrites99.7%

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

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \color{blue}{a}\right) \]
    9. Step-by-step derivation
      1. Applied rewrites50.6%

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \color{blue}{a}\right) \]

      if 4.9999999999999998e-70 < (tan.f64 a)

      1. Initial program 79.1%

        \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
      2. Step-by-step derivation
        1. lift-tan.f64N/A

          \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
        2. tan-quotN/A

          \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
        3. lift-+.f64N/A

          \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
        4. +-commutativeN/A

          \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
        5. sin-sumN/A

          \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
        6. div-addN/A

          \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
        7. *-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        8. lower-+.f64N/A

          \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
        9. lower-/.f64N/A

          \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        12. lower-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        13. lower-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        14. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        15. +-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        16. lower-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        17. lower-/.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
      3. Applied rewrites79.6%

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
      4. Step-by-step derivation
        1. lift-cos.f64N/A

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        3. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        4. cos-diffN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        5. cos-neg-revN/A

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

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        9. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        12. lower-neg.f6480.4

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      5. Applied rewrites80.4%

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
        2. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
        3. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
        4. cos-diffN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
        5. cos-neg-revN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        6. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        7. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
        9. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        12. lower-neg.f6499.7

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
      7. Applied rewrites99.7%

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}}\right) - \tan a\right) \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        2. *-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\cos y \cdot \sin z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        3. lower-*.f6499.7

          \[\leadsto x + \left(\left(\frac{\color{blue}{\cos y \cdot \sin z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        4. lift-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos z \cdot \cos y + \sin z \cdot \sin \left(-y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        5. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        6. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        7. cos-neg-revN/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \color{blue}{\cos \left(\mathsf{neg}\left(y\right)\right)} + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        8. lift-neg.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \color{blue}{\left(-y\right)} + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        9. lift-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z \cdot \sin \left(-y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        10. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z} \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        11. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \left(-y\right) + \sin z \cdot \color{blue}{\sin \left(-y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        12. cos-diff-revN/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos \left(z - \left(-y\right)\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        13. lift-neg.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \left(z - \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        14. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        15. +-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \color{blue}{\left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        16. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \color{blue}{\left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        17. lift-cos.f6480.3

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos \left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      9. Applied rewrites80.3%

        \[\leadsto x + \left(\left(\color{blue}{\frac{\cos y \cdot \sin z}{\cos \left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
    10. Recombined 3 regimes into one program.
    11. Add Preprocessing

    Alternative 4: 88.5% accurate, 0.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin z \cdot \sin \left(-y\right)\\ t_1 := \mathsf{fma}\left(\cos z, \cos y, t\_0\right)\\ t_2 := \cos y \cdot \sin z\\ t_3 := \cos z \cdot \sin y\\ t_4 := \cos \left(y + z\right)\\ t_5 := \mathsf{fma}\left(\cos y, \cos z, t\_0\right)\\ \mathbf{if}\;\tan a \leq -0.02:\\ \;\;\;\;x + \left(\left(\frac{\sin z \cdot \cos y}{t\_1} + \frac{\sin y \cdot \cos z}{t\_4}\right) - \tan a\right)\\ \mathbf{elif}\;\tan a \leq 5 \cdot 10^{-70}:\\ \;\;\;\;x + \mathsf{fma}\left(a, -0.3333333333333333 \cdot {a}^{2} - 1, \frac{t\_2}{t\_5} + \frac{t\_3}{t\_5}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(\frac{t\_2}{t\_4} + \frac{t\_3}{t\_1}\right) - \tan a\right)\\ \end{array} \end{array} \]
    (FPCore (x y z a)
     :precision binary64
     (let* ((t_0 (* (sin z) (sin (- y))))
            (t_1 (fma (cos z) (cos y) t_0))
            (t_2 (* (cos y) (sin z)))
            (t_3 (* (cos z) (sin y)))
            (t_4 (cos (+ y z)))
            (t_5 (fma (cos y) (cos z) t_0)))
       (if (<= (tan a) -0.02)
         (+
          x
          (- (+ (/ (* (sin z) (cos y)) t_1) (/ (* (sin y) (cos z)) t_4)) (tan a)))
         (if (<= (tan a) 5e-70)
           (+
            x
            (fma
             a
             (- (* -0.3333333333333333 (pow a 2.0)) 1.0)
             (+ (/ t_2 t_5) (/ t_3 t_5))))
           (+ x (- (+ (/ t_2 t_4) (/ t_3 t_1)) (tan a)))))))
    double code(double x, double y, double z, double a) {
    	double t_0 = sin(z) * sin(-y);
    	double t_1 = fma(cos(z), cos(y), t_0);
    	double t_2 = cos(y) * sin(z);
    	double t_3 = cos(z) * sin(y);
    	double t_4 = cos((y + z));
    	double t_5 = fma(cos(y), cos(z), t_0);
    	double tmp;
    	if (tan(a) <= -0.02) {
    		tmp = x + ((((sin(z) * cos(y)) / t_1) + ((sin(y) * cos(z)) / t_4)) - tan(a));
    	} else if (tan(a) <= 5e-70) {
    		tmp = x + fma(a, ((-0.3333333333333333 * pow(a, 2.0)) - 1.0), ((t_2 / t_5) + (t_3 / t_5)));
    	} else {
    		tmp = x + (((t_2 / t_4) + (t_3 / t_1)) - tan(a));
    	}
    	return tmp;
    }
    
    function code(x, y, z, a)
    	t_0 = Float64(sin(z) * sin(Float64(-y)))
    	t_1 = fma(cos(z), cos(y), t_0)
    	t_2 = Float64(cos(y) * sin(z))
    	t_3 = Float64(cos(z) * sin(y))
    	t_4 = cos(Float64(y + z))
    	t_5 = fma(cos(y), cos(z), t_0)
    	tmp = 0.0
    	if (tan(a) <= -0.02)
    		tmp = Float64(x + Float64(Float64(Float64(Float64(sin(z) * cos(y)) / t_1) + Float64(Float64(sin(y) * cos(z)) / t_4)) - tan(a)));
    	elseif (tan(a) <= 5e-70)
    		tmp = Float64(x + fma(a, Float64(Float64(-0.3333333333333333 * (a ^ 2.0)) - 1.0), Float64(Float64(t_2 / t_5) + Float64(t_3 / t_5))));
    	else
    		tmp = Float64(x + Float64(Float64(Float64(t_2 / t_4) + Float64(t_3 / t_1)) - tan(a)));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Sin[z], $MachinePrecision] * N[Sin[(-y)], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[z], $MachinePrecision] * N[Cos[y], $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[y], $MachinePrecision] * N[Sin[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Cos[z], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[Cos[y], $MachinePrecision] * N[Cos[z], $MachinePrecision] + t$95$0), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.02], N[(x + N[(N[(N[(N[(N[Sin[z], $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(N[Sin[y], $MachinePrecision] * N[Cos[z], $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 5e-70], N[(x + N[(a * N[(N[(-0.3333333333333333 * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] + N[(N[(t$95$2 / t$95$5), $MachinePrecision] + N[(t$95$3 / t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t$95$2 / t$95$4), $MachinePrecision] + N[(t$95$3 / t$95$1), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \sin z \cdot \sin \left(-y\right)\\
    t_1 := \mathsf{fma}\left(\cos z, \cos y, t\_0\right)\\
    t_2 := \cos y \cdot \sin z\\
    t_3 := \cos z \cdot \sin y\\
    t_4 := \cos \left(y + z\right)\\
    t_5 := \mathsf{fma}\left(\cos y, \cos z, t\_0\right)\\
    \mathbf{if}\;\tan a \leq -0.02:\\
    \;\;\;\;x + \left(\left(\frac{\sin z \cdot \cos y}{t\_1} + \frac{\sin y \cdot \cos z}{t\_4}\right) - \tan a\right)\\
    
    \mathbf{elif}\;\tan a \leq 5 \cdot 10^{-70}:\\
    \;\;\;\;x + \mathsf{fma}\left(a, -0.3333333333333333 \cdot {a}^{2} - 1, \frac{t\_2}{t\_5} + \frac{t\_3}{t\_5}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;x + \left(\left(\frac{t\_2}{t\_4} + \frac{t\_3}{t\_1}\right) - \tan a\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (tan.f64 a) < -0.0200000000000000004

      1. Initial program 79.1%

        \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
      2. Step-by-step derivation
        1. lift-tan.f64N/A

          \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
        2. tan-quotN/A

          \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
        3. lift-+.f64N/A

          \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
        4. +-commutativeN/A

          \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
        5. sin-sumN/A

          \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
        6. div-addN/A

          \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
        7. *-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        8. lower-+.f64N/A

          \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
        9. lower-/.f64N/A

          \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        12. lower-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        13. lower-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        14. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        15. +-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        16. lower-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        17. lower-/.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
      3. Applied rewrites79.6%

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
      4. Step-by-step derivation
        1. lift-cos.f64N/A

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        3. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        4. cos-diffN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        5. cos-neg-revN/A

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

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        9. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        12. lower-neg.f6480.4

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      5. Applied rewrites80.4%

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
        2. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
        3. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
        4. cos-diffN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
        5. cos-neg-revN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        6. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        7. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
        9. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        12. lower-neg.f6499.7

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
      7. Applied rewrites99.7%

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}}\right) - \tan a\right) \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\color{blue}{\cos z \cdot \sin y}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        2. *-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        3. lower-*.f6499.7

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        4. lift-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos z \cdot \cos y + \sin z \cdot \sin \left(-y\right)}}\right) - \tan a\right) \]
        5. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
        6. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
        7. cos-neg-revN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \color{blue}{\cos \left(\mathsf{neg}\left(y\right)\right)} + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
        8. lift-neg.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \color{blue}{\left(-y\right)} + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
        9. lift-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z \cdot \sin \left(-y\right)}}\right) - \tan a\right) \]
        10. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z} \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
        11. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \left(-y\right) + \sin z \cdot \color{blue}{\sin \left(-y\right)}}\right) - \tan a\right) \]
        12. cos-diff-revN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos \left(z - \left(-y\right)\right)}}\right) - \tan a\right) \]
        13. lift-neg.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \left(z - \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        14. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
        15. +-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \color{blue}{\left(y + z\right)}}\right) - \tan a\right) \]
        16. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \color{blue}{\left(y + z\right)}}\right) - \tan a\right) \]
        17. lift-cos.f6480.4

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
      9. Applied rewrites80.4%

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]

      if -0.0200000000000000004 < (tan.f64 a) < 4.9999999999999998e-70

      1. Initial program 79.1%

        \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
      2. Step-by-step derivation
        1. lift-tan.f64N/A

          \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
        2. tan-quotN/A

          \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
        3. lift-+.f64N/A

          \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
        4. +-commutativeN/A

          \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
        5. sin-sumN/A

          \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
        6. div-addN/A

          \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
        7. *-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        8. lower-+.f64N/A

          \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
        9. lower-/.f64N/A

          \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        12. lower-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        13. lower-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        14. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        15. +-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        16. lower-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        17. lower-/.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
      3. Applied rewrites79.6%

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
      4. Step-by-step derivation
        1. lift-cos.f64N/A

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        3. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        4. cos-diffN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        5. cos-neg-revN/A

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

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        9. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        12. lower-neg.f6480.4

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      5. Applied rewrites80.4%

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
        2. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
        3. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
        4. cos-diffN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
        5. cos-neg-revN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        6. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        7. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
        9. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        12. lower-neg.f6499.7

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
      7. Applied rewrites99.7%

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

        \[\leadsto x + \color{blue}{\left(a \cdot \left(\frac{-1}{3} \cdot {a}^{2} - 1\right) + \left(\frac{\cos y \cdot \sin z}{\cos y \cdot \cos z + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos y \cdot \cos z + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)\right)} \]
      9. Step-by-step derivation
        1. lower-fma.f64N/A

          \[\leadsto x + \mathsf{fma}\left(a, \color{blue}{\frac{-1}{3} \cdot {a}^{2} - 1}, \frac{\cos y \cdot \sin z}{\cos y \cdot \cos z + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos y \cdot \cos z + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) \]
        2. lower--.f64N/A

          \[\leadsto x + \mathsf{fma}\left(a, \frac{-1}{3} \cdot {a}^{2} - \color{blue}{1}, \frac{\cos y \cdot \sin z}{\cos y \cdot \cos z + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos y \cdot \cos z + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) \]
        3. lower-*.f64N/A

          \[\leadsto x + \mathsf{fma}\left(a, \frac{-1}{3} \cdot {a}^{2} - 1, \frac{\cos y \cdot \sin z}{\cos y \cdot \cos z + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos y \cdot \cos z + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) \]
        4. lower-pow.f64N/A

          \[\leadsto x + \mathsf{fma}\left(a, \frac{-1}{3} \cdot {a}^{2} - 1, \frac{\cos y \cdot \sin z}{\cos y \cdot \cos z + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos y \cdot \cos z + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) \]
      10. Applied rewrites50.3%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(a, -0.3333333333333333 \cdot {a}^{2} - 1, \frac{\cos y \cdot \sin z}{\mathsf{fma}\left(\cos y, \cos z, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos y, \cos z, \sin z \cdot \sin \left(-y\right)\right)}\right)} \]

      if 4.9999999999999998e-70 < (tan.f64 a)

      1. Initial program 79.1%

        \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
      2. Step-by-step derivation
        1. lift-tan.f64N/A

          \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
        2. tan-quotN/A

          \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
        3. lift-+.f64N/A

          \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
        4. +-commutativeN/A

          \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
        5. sin-sumN/A

          \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
        6. div-addN/A

          \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
        7. *-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        8. lower-+.f64N/A

          \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
        9. lower-/.f64N/A

          \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        12. lower-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        13. lower-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        14. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        15. +-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        16. lower-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        17. lower-/.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
      3. Applied rewrites79.6%

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
      4. Step-by-step derivation
        1. lift-cos.f64N/A

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        3. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        4. cos-diffN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        5. cos-neg-revN/A

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

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        9. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        12. lower-neg.f6480.4

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      5. Applied rewrites80.4%

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
        2. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
        3. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
        4. cos-diffN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
        5. cos-neg-revN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        6. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        7. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
        9. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        12. lower-neg.f6499.7

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
      7. Applied rewrites99.7%

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}}\right) - \tan a\right) \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        2. *-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\cos y \cdot \sin z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        3. lower-*.f6499.7

          \[\leadsto x + \left(\left(\frac{\color{blue}{\cos y \cdot \sin z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        4. lift-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos z \cdot \cos y + \sin z \cdot \sin \left(-y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        5. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        6. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        7. cos-neg-revN/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \color{blue}{\cos \left(\mathsf{neg}\left(y\right)\right)} + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        8. lift-neg.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \color{blue}{\left(-y\right)} + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        9. lift-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z \cdot \sin \left(-y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        10. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z} \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        11. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \left(-y\right) + \sin z \cdot \color{blue}{\sin \left(-y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        12. cos-diff-revN/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos \left(z - \left(-y\right)\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        13. lift-neg.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \left(z - \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        14. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        15. +-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \color{blue}{\left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        16. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \color{blue}{\left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        17. lift-cos.f6480.3

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos \left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      9. Applied rewrites80.3%

        \[\leadsto x + \left(\left(\color{blue}{\frac{\cos y \cdot \sin z}{\cos \left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 5: 88.4% accurate, 0.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin z \cdot \sin \left(-y\right)\\ t_1 := \mathsf{fma}\left(\cos y, \cos z, t\_0\right)\\ t_2 := \cos z \cdot \sin y\\ t_3 := \cos \left(y + z\right)\\ t_4 := \mathsf{fma}\left(\cos z, \cos y, t\_0\right)\\ t_5 := \cos y \cdot \sin z\\ \mathbf{if}\;\tan a \leq -5 \cdot 10^{-8}:\\ \;\;\;\;x + \left(\left(\frac{\sin z \cdot \cos y}{t\_4} + \frac{\sin y \cdot \cos z}{t\_3}\right) - \tan a\right)\\ \mathbf{elif}\;\tan a \leq 5 \cdot 10^{-70}:\\ \;\;\;\;x + \left(\frac{t\_5}{t\_1} + \frac{t\_2}{t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(\frac{t\_5}{t\_3} + \frac{t\_2}{t\_4}\right) - \tan a\right)\\ \end{array} \end{array} \]
    (FPCore (x y z a)
     :precision binary64
     (let* ((t_0 (* (sin z) (sin (- y))))
            (t_1 (fma (cos y) (cos z) t_0))
            (t_2 (* (cos z) (sin y)))
            (t_3 (cos (+ y z)))
            (t_4 (fma (cos z) (cos y) t_0))
            (t_5 (* (cos y) (sin z))))
       (if (<= (tan a) -5e-8)
         (+
          x
          (- (+ (/ (* (sin z) (cos y)) t_4) (/ (* (sin y) (cos z)) t_3)) (tan a)))
         (if (<= (tan a) 5e-70)
           (+ x (+ (/ t_5 t_1) (/ t_2 t_1)))
           (+ x (- (+ (/ t_5 t_3) (/ t_2 t_4)) (tan a)))))))
    double code(double x, double y, double z, double a) {
    	double t_0 = sin(z) * sin(-y);
    	double t_1 = fma(cos(y), cos(z), t_0);
    	double t_2 = cos(z) * sin(y);
    	double t_3 = cos((y + z));
    	double t_4 = fma(cos(z), cos(y), t_0);
    	double t_5 = cos(y) * sin(z);
    	double tmp;
    	if (tan(a) <= -5e-8) {
    		tmp = x + ((((sin(z) * cos(y)) / t_4) + ((sin(y) * cos(z)) / t_3)) - tan(a));
    	} else if (tan(a) <= 5e-70) {
    		tmp = x + ((t_5 / t_1) + (t_2 / t_1));
    	} else {
    		tmp = x + (((t_5 / t_3) + (t_2 / t_4)) - tan(a));
    	}
    	return tmp;
    }
    
    function code(x, y, z, a)
    	t_0 = Float64(sin(z) * sin(Float64(-y)))
    	t_1 = fma(cos(y), cos(z), t_0)
    	t_2 = Float64(cos(z) * sin(y))
    	t_3 = cos(Float64(y + z))
    	t_4 = fma(cos(z), cos(y), t_0)
    	t_5 = Float64(cos(y) * sin(z))
    	tmp = 0.0
    	if (tan(a) <= -5e-8)
    		tmp = Float64(x + Float64(Float64(Float64(Float64(sin(z) * cos(y)) / t_4) + Float64(Float64(sin(y) * cos(z)) / t_3)) - tan(a)));
    	elseif (tan(a) <= 5e-70)
    		tmp = Float64(x + Float64(Float64(t_5 / t_1) + Float64(t_2 / t_1)));
    	else
    		tmp = Float64(x + Float64(Float64(Float64(t_5 / t_3) + Float64(t_2 / t_4)) - tan(a)));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Sin[z], $MachinePrecision] * N[Sin[(-y)], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[y], $MachinePrecision] * N[Cos[z], $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[z], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[Cos[z], $MachinePrecision] * N[Cos[y], $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$5 = N[(N[Cos[y], $MachinePrecision] * N[Sin[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -5e-8], N[(x + N[(N[(N[(N[(N[Sin[z], $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision] + N[(N[(N[Sin[y], $MachinePrecision] * N[Cos[z], $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 5e-70], N[(x + N[(N[(t$95$5 / t$95$1), $MachinePrecision] + N[(t$95$2 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t$95$5 / t$95$3), $MachinePrecision] + N[(t$95$2 / t$95$4), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \sin z \cdot \sin \left(-y\right)\\
    t_1 := \mathsf{fma}\left(\cos y, \cos z, t\_0\right)\\
    t_2 := \cos z \cdot \sin y\\
    t_3 := \cos \left(y + z\right)\\
    t_4 := \mathsf{fma}\left(\cos z, \cos y, t\_0\right)\\
    t_5 := \cos y \cdot \sin z\\
    \mathbf{if}\;\tan a \leq -5 \cdot 10^{-8}:\\
    \;\;\;\;x + \left(\left(\frac{\sin z \cdot \cos y}{t\_4} + \frac{\sin y \cdot \cos z}{t\_3}\right) - \tan a\right)\\
    
    \mathbf{elif}\;\tan a \leq 5 \cdot 10^{-70}:\\
    \;\;\;\;x + \left(\frac{t\_5}{t\_1} + \frac{t\_2}{t\_1}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;x + \left(\left(\frac{t\_5}{t\_3} + \frac{t\_2}{t\_4}\right) - \tan a\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (tan.f64 a) < -4.9999999999999998e-8

      1. Initial program 79.1%

        \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
      2. Step-by-step derivation
        1. lift-tan.f64N/A

          \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
        2. tan-quotN/A

          \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
        3. lift-+.f64N/A

          \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
        4. +-commutativeN/A

          \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
        5. sin-sumN/A

          \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
        6. div-addN/A

          \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
        7. *-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        8. lower-+.f64N/A

          \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
        9. lower-/.f64N/A

          \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        12. lower-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        13. lower-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        14. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        15. +-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        16. lower-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        17. lower-/.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
      3. Applied rewrites79.6%

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
      4. Step-by-step derivation
        1. lift-cos.f64N/A

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        3. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        4. cos-diffN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        5. cos-neg-revN/A

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

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        9. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        12. lower-neg.f6480.4

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      5. Applied rewrites80.4%

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
        2. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
        3. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
        4. cos-diffN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
        5. cos-neg-revN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        6. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        7. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
        9. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        12. lower-neg.f6499.7

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
      7. Applied rewrites99.7%

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}}\right) - \tan a\right) \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\color{blue}{\cos z \cdot \sin y}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        2. *-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        3. lower-*.f6499.7

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        4. lift-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos z \cdot \cos y + \sin z \cdot \sin \left(-y\right)}}\right) - \tan a\right) \]
        5. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
        6. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
        7. cos-neg-revN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \color{blue}{\cos \left(\mathsf{neg}\left(y\right)\right)} + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
        8. lift-neg.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \color{blue}{\left(-y\right)} + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
        9. lift-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z \cdot \sin \left(-y\right)}}\right) - \tan a\right) \]
        10. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z} \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
        11. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \left(-y\right) + \sin z \cdot \color{blue}{\sin \left(-y\right)}}\right) - \tan a\right) \]
        12. cos-diff-revN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos \left(z - \left(-y\right)\right)}}\right) - \tan a\right) \]
        13. lift-neg.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \left(z - \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        14. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
        15. +-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \color{blue}{\left(y + z\right)}}\right) - \tan a\right) \]
        16. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \color{blue}{\left(y + z\right)}}\right) - \tan a\right) \]
        17. lift-cos.f6480.4

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
      9. Applied rewrites80.4%

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]

      if -4.9999999999999998e-8 < (tan.f64 a) < 4.9999999999999998e-70

      1. Initial program 79.1%

        \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
      2. Step-by-step derivation
        1. lift-tan.f64N/A

          \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
        2. tan-quotN/A

          \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
        3. lift-+.f64N/A

          \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
        4. +-commutativeN/A

          \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
        5. sin-sumN/A

          \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
        6. div-addN/A

          \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
        7. *-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        8. lower-+.f64N/A

          \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
        9. lower-/.f64N/A

          \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        12. lower-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        13. lower-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        14. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        15. +-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        16. lower-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        17. lower-/.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
      3. Applied rewrites79.6%

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
      4. Step-by-step derivation
        1. lift-cos.f64N/A

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        3. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        4. cos-diffN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        5. cos-neg-revN/A

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

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        9. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        12. lower-neg.f6480.4

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      5. Applied rewrites80.4%

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
        2. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
        3. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
        4. cos-diffN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
        5. cos-neg-revN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        6. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        7. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
        9. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        12. lower-neg.f6499.7

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
      7. Applied rewrites99.7%

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

        \[\leadsto \color{blue}{x + \left(\frac{\cos y \cdot \sin z}{\cos y \cdot \cos z + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos y \cdot \cos z + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} \]
      9. Step-by-step derivation
        1. lower-+.f64N/A

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

          \[\leadsto x + \left(\frac{\cos y \cdot \sin z}{\cos y \cdot \cos z + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \color{blue}{\frac{\cos z \cdot \sin y}{\cos y \cdot \cos z + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) \]
      10. Applied rewrites60.5%

        \[\leadsto \color{blue}{x + \left(\frac{\cos y \cdot \sin z}{\mathsf{fma}\left(\cos y, \cos z, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos y, \cos z, \sin z \cdot \sin \left(-y\right)\right)}\right)} \]

      if 4.9999999999999998e-70 < (tan.f64 a)

      1. Initial program 79.1%

        \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
      2. Step-by-step derivation
        1. lift-tan.f64N/A

          \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
        2. tan-quotN/A

          \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
        3. lift-+.f64N/A

          \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
        4. +-commutativeN/A

          \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
        5. sin-sumN/A

          \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
        6. div-addN/A

          \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
        7. *-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        8. lower-+.f64N/A

          \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
        9. lower-/.f64N/A

          \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        12. lower-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        13. lower-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        14. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        15. +-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        16. lower-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
        17. lower-/.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
      3. Applied rewrites79.6%

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
      4. Step-by-step derivation
        1. lift-cos.f64N/A

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        3. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        4. cos-diffN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        5. cos-neg-revN/A

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

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        9. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
        12. lower-neg.f6480.4

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      5. Applied rewrites80.4%

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

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
        2. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
        3. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
        4. cos-diffN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
        5. cos-neg-revN/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        6. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        7. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
        9. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
        10. lower-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        11. lower-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
        12. lower-neg.f6499.7

          \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
      7. Applied rewrites99.7%

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}}\right) - \tan a\right) \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        2. *-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\color{blue}{\cos y \cdot \sin z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        3. lower-*.f6499.7

          \[\leadsto x + \left(\left(\frac{\color{blue}{\cos y \cdot \sin z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        4. lift-fma.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos z \cdot \cos y + \sin z \cdot \sin \left(-y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        5. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        6. lift-cos.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        7. cos-neg-revN/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \color{blue}{\cos \left(\mathsf{neg}\left(y\right)\right)} + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        8. lift-neg.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \color{blue}{\left(-y\right)} + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        9. lift-*.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z \cdot \sin \left(-y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        10. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z} \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        11. lift-sin.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \left(-y\right) + \sin z \cdot \color{blue}{\sin \left(-y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        12. cos-diff-revN/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos \left(z - \left(-y\right)\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        13. lift-neg.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \left(z - \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        14. add-flipN/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        15. +-commutativeN/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \color{blue}{\left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        16. lift-+.f64N/A

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \color{blue}{\left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
        17. lift-cos.f6480.3

          \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos \left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      9. Applied rewrites80.3%

        \[\leadsto x + \left(\left(\color{blue}{\frac{\cos y \cdot \sin z}{\cos \left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 6: 80.4% accurate, 0.2× speedup?

    \[\begin{array}{l} \\ x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \end{array} \]
    (FPCore (x y z a)
     :precision binary64
     (+
      x
      (-
       (+
        (/ (* (sin z) (cos y)) (fma (cos z) (cos y) (* (sin z) (sin (- y)))))
        (/ (* (sin y) (cos z)) (cos (+ y z))))
       (tan a))))
    double code(double x, double y, double z, double a) {
    	return x + ((((sin(z) * cos(y)) / fma(cos(z), cos(y), (sin(z) * sin(-y)))) + ((sin(y) * cos(z)) / cos((y + z)))) - tan(a));
    }
    
    function code(x, y, z, a)
    	return Float64(x + Float64(Float64(Float64(Float64(sin(z) * cos(y)) / fma(cos(z), cos(y), Float64(sin(z) * sin(Float64(-y))))) + Float64(Float64(sin(y) * cos(z)) / cos(Float64(y + z)))) - tan(a)))
    end
    
    code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[(N[Sin[z], $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[z], $MachinePrecision] * N[Cos[y], $MachinePrecision] + N[(N[Sin[z], $MachinePrecision] * N[Sin[(-y)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sin[y], $MachinePrecision] * N[Cos[z], $MachinePrecision]), $MachinePrecision] / N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right)
    \end{array}
    
    Derivation
    1. Initial program 79.1%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Step-by-step derivation
      1. lift-tan.f64N/A

        \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
      2. tan-quotN/A

        \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
      3. lift-+.f64N/A

        \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
      4. +-commutativeN/A

        \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
      5. sin-sumN/A

        \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
      6. div-addN/A

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
      7. *-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      8. lower-+.f64N/A

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
      9. lower-/.f64N/A

        \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      10. lower-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      11. lower-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      12. lower-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      13. lower-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      14. lift-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      15. +-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      16. lower-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      17. lower-/.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
    3. Applied rewrites79.6%

      \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
    4. Step-by-step derivation
      1. lift-cos.f64N/A

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

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      3. add-flipN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      4. cos-diffN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      5. cos-neg-revN/A

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

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

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      8. lower-fma.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      9. lift-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      10. lower-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      11. lower-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      12. lower-neg.f6480.4

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    5. Applied rewrites80.4%

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

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
      2. lift-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
      3. add-flipN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
      4. cos-diffN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
      5. cos-neg-revN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
      6. lift-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
      7. lift-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
      8. lower-fma.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
      9. lift-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
      10. lower-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
      11. lower-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
      12. lower-neg.f6499.7

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
    7. Applied rewrites99.7%

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}}\right) - \tan a\right) \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\color{blue}{\cos z \cdot \sin y}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      2. *-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      3. lower-*.f6499.7

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos z \cdot \cos y + \sin z \cdot \sin \left(-y\right)}}\right) - \tan a\right) \]
      5. lift-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
      6. lift-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
      7. cos-neg-revN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \color{blue}{\cos \left(\mathsf{neg}\left(y\right)\right)} + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
      8. lift-neg.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \color{blue}{\left(-y\right)} + \sin z \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
      9. lift-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z \cdot \sin \left(-y\right)}}\right) - \tan a\right) \]
      10. lift-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z} \cdot \sin \left(-y\right)}\right) - \tan a\right) \]
      11. lift-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos z \cdot \cos \left(-y\right) + \sin z \cdot \color{blue}{\sin \left(-y\right)}}\right) - \tan a\right) \]
      12. cos-diff-revN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos \left(z - \left(-y\right)\right)}}\right) - \tan a\right) \]
      13. lift-neg.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \left(z - \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
      14. add-flipN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
      15. +-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \color{blue}{\left(y + z\right)}}\right) - \tan a\right) \]
      16. lift-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \color{blue}{\left(y + z\right)}}\right) - \tan a\right) \]
      17. lift-cos.f6480.4

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
    9. Applied rewrites80.4%

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
    10. Add Preprocessing

    Alternative 7: 80.3% accurate, 0.2× speedup?

    \[\begin{array}{l} \\ x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \end{array} \]
    (FPCore (x y z a)
     :precision binary64
     (+
      x
      (-
       (+
        (/ (* (cos y) (sin z)) (cos (+ y z)))
        (/ (* (cos z) (sin y)) (fma (cos z) (cos y) (* (sin z) (sin (- y))))))
       (tan a))))
    double code(double x, double y, double z, double a) {
    	return x + ((((cos(y) * sin(z)) / cos((y + z))) + ((cos(z) * sin(y)) / fma(cos(z), cos(y), (sin(z) * sin(-y))))) - tan(a));
    }
    
    function code(x, y, z, a)
    	return Float64(x + Float64(Float64(Float64(Float64(cos(y) * sin(z)) / cos(Float64(y + z))) + Float64(Float64(cos(z) * sin(y)) / fma(cos(z), cos(y), Float64(sin(z) * sin(Float64(-y)))))) - tan(a)))
    end
    
    code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[(N[Cos[y], $MachinePrecision] * N[Sin[z], $MachinePrecision]), $MachinePrecision] / N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Cos[z], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision] / N[(N[Cos[z], $MachinePrecision] * N[Cos[y], $MachinePrecision] + N[(N[Sin[z], $MachinePrecision] * N[Sin[(-y)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right)
    \end{array}
    
    Derivation
    1. Initial program 79.1%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Step-by-step derivation
      1. lift-tan.f64N/A

        \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
      2. tan-quotN/A

        \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
      3. lift-+.f64N/A

        \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
      4. +-commutativeN/A

        \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
      5. sin-sumN/A

        \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
      6. div-addN/A

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
      7. *-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      8. lower-+.f64N/A

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
      9. lower-/.f64N/A

        \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      10. lower-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      11. lower-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      12. lower-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      13. lower-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      14. lift-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      15. +-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      16. lower-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      17. lower-/.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
    3. Applied rewrites79.6%

      \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
    4. Step-by-step derivation
      1. lift-cos.f64N/A

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

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      3. add-flipN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      4. cos-diffN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      5. cos-neg-revN/A

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

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

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      8. lower-fma.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      9. lift-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      10. lower-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      11. lower-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      12. lower-neg.f6480.4

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    5. Applied rewrites80.4%

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

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
      2. lift-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
      3. add-flipN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
      4. cos-diffN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
      5. cos-neg-revN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
      6. lift-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
      7. lift-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
      8. lower-fma.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
      9. lift-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
      10. lower-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
      11. lower-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
      12. lower-neg.f6499.7

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
    7. Applied rewrites99.7%

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}}\right) - \tan a\right) \]
    8. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      2. *-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\color{blue}{\cos y \cdot \sin z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      3. lower-*.f6499.7

        \[\leadsto x + \left(\left(\frac{\color{blue}{\cos y \cdot \sin z}}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      4. lift-fma.f64N/A

        \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos z \cdot \cos y + \sin z \cdot \sin \left(-y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      5. lift-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      6. lift-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      7. cos-neg-revN/A

        \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \color{blue}{\cos \left(\mathsf{neg}\left(y\right)\right)} + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      8. lift-neg.f64N/A

        \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \color{blue}{\left(-y\right)} + \sin z \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      9. lift-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z \cdot \sin \left(-y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      10. lift-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \left(-y\right) + \color{blue}{\sin z} \cdot \sin \left(-y\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      11. lift-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos z \cdot \cos \left(-y\right) + \sin z \cdot \color{blue}{\sin \left(-y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      12. cos-diff-revN/A

        \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos \left(z - \left(-y\right)\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      13. lift-neg.f64N/A

        \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \left(z - \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      14. add-flipN/A

        \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      15. +-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \color{blue}{\left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      16. lift-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\cos \color{blue}{\left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
      17. lift-cos.f6480.3

        \[\leadsto x + \left(\left(\frac{\cos y \cdot \sin z}{\color{blue}{\cos \left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
    9. Applied rewrites80.3%

      \[\leadsto x + \left(\left(\color{blue}{\frac{\cos y \cdot \sin z}{\cos \left(y + z\right)}} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
    10. Add Preprocessing

    Alternative 8: 79.6% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ x + \left(\frac{\mathsf{fma}\left(-\sin z, \cos y, \left(-\cos z\right) \cdot \sin y\right)}{-\cos \left(y + z\right)} - \tan a\right) \end{array} \]
    (FPCore (x y z a)
     :precision binary64
     (+
      x
      (-
       (/ (fma (- (sin z)) (cos y) (* (- (cos z)) (sin y))) (- (cos (+ y z))))
       (tan a))))
    double code(double x, double y, double z, double a) {
    	return x + ((fma(-sin(z), cos(y), (-cos(z) * sin(y))) / -cos((y + z))) - tan(a));
    }
    
    function code(x, y, z, a)
    	return Float64(x + Float64(Float64(fma(Float64(-sin(z)), cos(y), Float64(Float64(-cos(z)) * sin(y))) / Float64(-cos(Float64(y + z)))) - tan(a)))
    end
    
    code[x_, y_, z_, a_] := N[(x + N[(N[(N[((-N[Sin[z], $MachinePrecision]) * N[Cos[y], $MachinePrecision] + N[((-N[Cos[z], $MachinePrecision]) * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    x + \left(\frac{\mathsf{fma}\left(-\sin z, \cos y, \left(-\cos z\right) \cdot \sin y\right)}{-\cos \left(y + z\right)} - \tan a\right)
    \end{array}
    
    Derivation
    1. Initial program 79.1%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Step-by-step derivation
      1. lift-tan.f64N/A

        \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
      2. tan-quotN/A

        \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
      3. lift-+.f64N/A

        \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
      4. +-commutativeN/A

        \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
      5. sin-sumN/A

        \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
      6. div-addN/A

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
      7. *-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      8. lower-+.f64N/A

        \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
      9. lower-/.f64N/A

        \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      10. lower-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      11. lower-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      12. lower-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      13. lower-cos.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      14. lift-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      15. +-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      16. lower-+.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
      17. lower-/.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
    3. Applied rewrites79.6%

      \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
    4. Step-by-step derivation
      1. lift-+.f64N/A

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

        \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
      3. frac-2negN/A

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

        \[\leadsto x + \left(\left(\frac{\mathsf{neg}\left(\sin z \cdot \cos y\right)}{\mathsf{neg}\left(\cos \left(z + y\right)\right)} + \color{blue}{\frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
      5. frac-2negN/A

        \[\leadsto x + \left(\left(\frac{\mathsf{neg}\left(\sin z \cdot \cos y\right)}{\mathsf{neg}\left(\cos \left(z + y\right)\right)} + \color{blue}{\frac{\mathsf{neg}\left(\cos z \cdot \sin y\right)}{\mathsf{neg}\left(\cos \left(z + y\right)\right)}}\right) - \tan a\right) \]
      6. div-add-revN/A

        \[\leadsto x + \left(\color{blue}{\frac{\left(\mathsf{neg}\left(\sin z \cdot \cos y\right)\right) + \left(\mathsf{neg}\left(\cos z \cdot \sin y\right)\right)}{\mathsf{neg}\left(\cos \left(z + y\right)\right)}} - \tan a\right) \]
      7. lower-/.f64N/A

        \[\leadsto x + \left(\color{blue}{\frac{\left(\mathsf{neg}\left(\sin z \cdot \cos y\right)\right) + \left(\mathsf{neg}\left(\cos z \cdot \sin y\right)\right)}{\mathsf{neg}\left(\cos \left(z + y\right)\right)}} - \tan a\right) \]
    5. Applied rewrites79.6%

      \[\leadsto x + \left(\color{blue}{\frac{\mathsf{fma}\left(-\sin z, \cos y, \left(-\cos z\right) \cdot \sin y\right)}{-\cos \left(y + z\right)}} - \tan a\right) \]
    6. Add Preprocessing

    Alternative 9: 79.1% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ x - \left(\tan a - \tan \left(z + y\right)\right) \end{array} \]
    (FPCore (x y z a) :precision binary64 (- x (- (tan a) (tan (+ z y)))))
    double code(double x, double y, double z, double a) {
    	return x - (tan(a) - tan((z + y)));
    }
    
    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(x, y, z, a)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: a
        code = x - (tan(a) - tan((z + y)))
    end function
    
    public static double code(double x, double y, double z, double a) {
    	return x - (Math.tan(a) - Math.tan((z + y)));
    }
    
    def code(x, y, z, a):
    	return x - (math.tan(a) - math.tan((z + y)))
    
    function code(x, y, z, a)
    	return Float64(x - Float64(tan(a) - tan(Float64(z + y))))
    end
    
    function tmp = code(x, y, z, a)
    	tmp = x - (tan(a) - tan((z + y)));
    end
    
    code[x_, y_, z_, a_] := N[(x - N[(N[Tan[a], $MachinePrecision] - N[Tan[N[(z + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    x - \left(\tan a - \tan \left(z + y\right)\right)
    \end{array}
    
    Derivation
    1. Initial program 79.1%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{x + \left(\tan \left(y + z\right) - \tan a\right)} \]
      2. add-flipN/A

        \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\tan \left(y + z\right) - \tan a\right)\right)\right)} \]
      3. lower--.f64N/A

        \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\tan \left(y + z\right) - \tan a\right)\right)\right)} \]
      4. lift--.f64N/A

        \[\leadsto x - \left(\mathsf{neg}\left(\color{blue}{\left(\tan \left(y + z\right) - \tan a\right)}\right)\right) \]
      5. sub-negate-revN/A

        \[\leadsto x - \color{blue}{\left(\tan a - \tan \left(y + z\right)\right)} \]
      6. lower--.f6479.1

        \[\leadsto x - \color{blue}{\left(\tan a - \tan \left(y + z\right)\right)} \]
      7. lift-+.f64N/A

        \[\leadsto x - \left(\tan a - \tan \color{blue}{\left(y + z\right)}\right) \]
      8. +-commutativeN/A

        \[\leadsto x - \left(\tan a - \tan \color{blue}{\left(z + y\right)}\right) \]
      9. lower-+.f6479.1

        \[\leadsto x - \left(\tan a - \tan \color{blue}{\left(z + y\right)}\right) \]
    3. Applied rewrites79.1%

      \[\leadsto \color{blue}{x - \left(\tan a - \tan \left(z + y\right)\right)} \]
    4. Add Preprocessing

    Alternative 10: 60.3% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y + z \leq -0.005:\\ \;\;\;\;x + \mathsf{fma}\left(\sin a, -1, \tan \left(z + y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\tan z - \tan a\right)\\ \end{array} \end{array} \]
    (FPCore (x y z a)
     :precision binary64
     (if (<= (+ y z) -0.005)
       (+ x (fma (sin a) -1.0 (tan (+ z y))))
       (+ x (- (tan z) (tan a)))))
    double code(double x, double y, double z, double a) {
    	double tmp;
    	if ((y + z) <= -0.005) {
    		tmp = x + fma(sin(a), -1.0, tan((z + y)));
    	} else {
    		tmp = x + (tan(z) - tan(a));
    	}
    	return tmp;
    }
    
    function code(x, y, z, a)
    	tmp = 0.0
    	if (Float64(y + z) <= -0.005)
    		tmp = Float64(x + fma(sin(a), -1.0, tan(Float64(z + y))));
    	else
    		tmp = Float64(x + Float64(tan(z) - tan(a)));
    	end
    	return tmp
    end
    
    code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -0.005], N[(x + N[(N[Sin[a], $MachinePrecision] * -1.0 + N[Tan[N[(z + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[z], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y + z \leq -0.005:\\
    \;\;\;\;x + \mathsf{fma}\left(\sin a, -1, \tan \left(z + y\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;x + \left(\tan z - \tan a\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (+.f64 y z) < -0.0050000000000000001

      1. Initial program 79.1%

        \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
      2. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto x + \color{blue}{\left(\tan \left(y + z\right) - \tan a\right)} \]
        2. sub-flipN/A

          \[\leadsto x + \color{blue}{\left(\tan \left(y + z\right) + \left(\mathsf{neg}\left(\tan a\right)\right)\right)} \]
        3. +-commutativeN/A

          \[\leadsto x + \color{blue}{\left(\left(\mathsf{neg}\left(\tan a\right)\right) + \tan \left(y + z\right)\right)} \]
        4. lift-tan.f64N/A

          \[\leadsto x + \left(\left(\mathsf{neg}\left(\color{blue}{\tan a}\right)\right) + \tan \left(y + z\right)\right) \]
        5. tan-quotN/A

          \[\leadsto x + \left(\left(\mathsf{neg}\left(\color{blue}{\frac{\sin a}{\cos a}}\right)\right) + \tan \left(y + z\right)\right) \]
        6. distribute-neg-frac2N/A

          \[\leadsto x + \left(\color{blue}{\frac{\sin a}{\mathsf{neg}\left(\cos a\right)}} + \tan \left(y + z\right)\right) \]
        7. mult-flipN/A

          \[\leadsto x + \left(\color{blue}{\sin a \cdot \frac{1}{\mathsf{neg}\left(\cos a\right)}} + \tan \left(y + z\right)\right) \]
        8. lower-fma.f64N/A

          \[\leadsto x + \color{blue}{\mathsf{fma}\left(\sin a, \frac{1}{\mathsf{neg}\left(\cos a\right)}, \tan \left(y + z\right)\right)} \]
        9. lower-sin.f64N/A

          \[\leadsto x + \mathsf{fma}\left(\color{blue}{\sin a}, \frac{1}{\mathsf{neg}\left(\cos a\right)}, \tan \left(y + z\right)\right) \]
        10. lower-/.f64N/A

          \[\leadsto x + \mathsf{fma}\left(\sin a, \color{blue}{\frac{1}{\mathsf{neg}\left(\cos a\right)}}, \tan \left(y + z\right)\right) \]
        11. lower-neg.f64N/A

          \[\leadsto x + \mathsf{fma}\left(\sin a, \frac{1}{\color{blue}{-\cos a}}, \tan \left(y + z\right)\right) \]
        12. lower-cos.f6479.1

          \[\leadsto x + \mathsf{fma}\left(\sin a, \frac{1}{-\color{blue}{\cos a}}, \tan \left(y + z\right)\right) \]
        13. lift-+.f64N/A

          \[\leadsto x + \mathsf{fma}\left(\sin a, \frac{1}{-\cos a}, \tan \color{blue}{\left(y + z\right)}\right) \]
        14. +-commutativeN/A

          \[\leadsto x + \mathsf{fma}\left(\sin a, \frac{1}{-\cos a}, \tan \color{blue}{\left(z + y\right)}\right) \]
        15. lower-+.f6479.1

          \[\leadsto x + \mathsf{fma}\left(\sin a, \frac{1}{-\cos a}, \tan \color{blue}{\left(z + y\right)}\right) \]
      3. Applied rewrites79.1%

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(\sin a, \frac{1}{-\cos a}, \tan \left(z + y\right)\right)} \]
      4. Taylor expanded in a around 0

        \[\leadsto x + \mathsf{fma}\left(\sin a, \color{blue}{-1}, \tan \left(z + y\right)\right) \]
      5. Step-by-step derivation
        1. Applied rewrites51.1%

          \[\leadsto x + \mathsf{fma}\left(\sin a, \color{blue}{-1}, \tan \left(z + y\right)\right) \]

        if -0.0050000000000000001 < (+.f64 y z)

        1. Initial program 79.1%

          \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
        2. Taylor expanded in y around 0

          \[\leadsto x + \left(\tan \color{blue}{z} - \tan a\right) \]
        3. Step-by-step derivation
          1. Applied rewrites60.3%

            \[\leadsto x + \left(\tan \color{blue}{z} - \tan a\right) \]
        4. Recombined 2 regimes into one program.
        5. Add Preprocessing

        Alternative 11: 60.0% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y + z \leq -0.005:\\ \;\;\;\;x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}\\ \mathbf{else}:\\ \;\;\;\;x + \left(\tan z - \tan a\right)\\ \end{array} \end{array} \]
        (FPCore (x y z a)
         :precision binary64
         (if (<= (+ y z) -0.005)
           (+ x (/ (sin (+ y z)) (cos (+ y z))))
           (+ x (- (tan z) (tan a)))))
        double code(double x, double y, double z, double a) {
        	double tmp;
        	if ((y + z) <= -0.005) {
        		tmp = x + (sin((y + z)) / cos((y + z)));
        	} else {
        		tmp = x + (tan(z) - tan(a));
        	}
        	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(x, y, z, a)
        use fmin_fmax_functions
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: a
            real(8) :: tmp
            if ((y + z) <= (-0.005d0)) then
                tmp = x + (sin((y + z)) / cos((y + z)))
            else
                tmp = x + (tan(z) - tan(a))
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double a) {
        	double tmp;
        	if ((y + z) <= -0.005) {
        		tmp = x + (Math.sin((y + z)) / Math.cos((y + z)));
        	} else {
        		tmp = x + (Math.tan(z) - Math.tan(a));
        	}
        	return tmp;
        }
        
        def code(x, y, z, a):
        	tmp = 0
        	if (y + z) <= -0.005:
        		tmp = x + (math.sin((y + z)) / math.cos((y + z)))
        	else:
        		tmp = x + (math.tan(z) - math.tan(a))
        	return tmp
        
        function code(x, y, z, a)
        	tmp = 0.0
        	if (Float64(y + z) <= -0.005)
        		tmp = Float64(x + Float64(sin(Float64(y + z)) / cos(Float64(y + z))));
        	else
        		tmp = Float64(x + Float64(tan(z) - tan(a)));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, a)
        	tmp = 0.0;
        	if ((y + z) <= -0.005)
        		tmp = x + (sin((y + z)) / cos((y + z)));
        	else
        		tmp = x + (tan(z) - tan(a));
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -0.005], N[(x + N[(N[Sin[N[(y + z), $MachinePrecision]], $MachinePrecision] / N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[z], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y + z \leq -0.005:\\
        \;\;\;\;x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;x + \left(\tan z - \tan a\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (+.f64 y z) < -0.0050000000000000001

          1. Initial program 79.1%

            \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
          2. Taylor expanded in a around 0

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

              \[\leadsto x + \color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} \]
            2. lower-/.f64N/A

              \[\leadsto x + \frac{\sin \left(y + z\right)}{\color{blue}{\cos \left(y + z\right)}} \]
            3. lower-sin.f64N/A

              \[\leadsto x + \frac{\sin \left(y + z\right)}{\cos \color{blue}{\left(y + z\right)}} \]
            4. lower-+.f64N/A

              \[\leadsto x + \frac{\sin \left(y + z\right)}{\cos \left(\color{blue}{y} + z\right)} \]
            5. lower-cos.f64N/A

              \[\leadsto x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} \]
            6. lower-+.f6450.1

              \[\leadsto x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} \]
          4. Applied rewrites50.1%

            \[\leadsto \color{blue}{x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} \]

          if -0.0050000000000000001 < (+.f64 y z)

          1. Initial program 79.1%

            \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
          2. Taylor expanded in y around 0

            \[\leadsto x + \left(\tan \color{blue}{z} - \tan a\right) \]
          3. Step-by-step derivation
            1. Applied rewrites60.3%

              \[\leadsto x + \left(\tan \color{blue}{z} - \tan a\right) \]
          4. Recombined 2 regimes into one program.
          5. Add Preprocessing

          Alternative 12: 59.9% accurate, 0.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan \left(y + z\right)\\ t_1 := x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}\\ \mathbf{if}\;t\_0 \leq -0.005:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 0.002:\\ \;\;\;\;x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)\right) - \tan a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z a)
           :precision binary64
           (let* ((t_0 (tan (+ y z))) (t_1 (+ x (/ (sin (+ y z)) (cos (+ y z))))))
             (if (<= t_0 -0.005)
               t_1
               (if (<= t_0 0.002)
                 (+
                  x
                  (- (+ y (* z (+ 1.0 (* z (+ y (* 0.3333333333333333 z)))))) (tan a)))
                 t_1))))
          double code(double x, double y, double z, double a) {
          	double t_0 = tan((y + z));
          	double t_1 = x + (sin((y + z)) / cos((y + z)));
          	double tmp;
          	if (t_0 <= -0.005) {
          		tmp = t_1;
          	} else if (t_0 <= 0.002) {
          		tmp = x + ((y + (z * (1.0 + (z * (y + (0.3333333333333333 * z)))))) - tan(a));
          	} else {
          		tmp = t_1;
          	}
          	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(x, y, z, a)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: a
              real(8) :: t_0
              real(8) :: t_1
              real(8) :: tmp
              t_0 = tan((y + z))
              t_1 = x + (sin((y + z)) / cos((y + z)))
              if (t_0 <= (-0.005d0)) then
                  tmp = t_1
              else if (t_0 <= 0.002d0) then
                  tmp = x + ((y + (z * (1.0d0 + (z * (y + (0.3333333333333333d0 * z)))))) - tan(a))
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double a) {
          	double t_0 = Math.tan((y + z));
          	double t_1 = x + (Math.sin((y + z)) / Math.cos((y + z)));
          	double tmp;
          	if (t_0 <= -0.005) {
          		tmp = t_1;
          	} else if (t_0 <= 0.002) {
          		tmp = x + ((y + (z * (1.0 + (z * (y + (0.3333333333333333 * z)))))) - Math.tan(a));
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, a):
          	t_0 = math.tan((y + z))
          	t_1 = x + (math.sin((y + z)) / math.cos((y + z)))
          	tmp = 0
          	if t_0 <= -0.005:
          		tmp = t_1
          	elif t_0 <= 0.002:
          		tmp = x + ((y + (z * (1.0 + (z * (y + (0.3333333333333333 * z)))))) - math.tan(a))
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, a)
          	t_0 = tan(Float64(y + z))
          	t_1 = Float64(x + Float64(sin(Float64(y + z)) / cos(Float64(y + z))))
          	tmp = 0.0
          	if (t_0 <= -0.005)
          		tmp = t_1;
          	elseif (t_0 <= 0.002)
          		tmp = Float64(x + Float64(Float64(y + Float64(z * Float64(1.0 + Float64(z * Float64(y + Float64(0.3333333333333333 * z)))))) - tan(a)));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, a)
          	t_0 = tan((y + z));
          	t_1 = x + (sin((y + z)) / cos((y + z)));
          	tmp = 0.0;
          	if (t_0 <= -0.005)
          		tmp = t_1;
          	elseif (t_0 <= 0.002)
          		tmp = x + ((y + (z * (1.0 + (z * (y + (0.3333333333333333 * z)))))) - tan(a));
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, a_] := Block[{t$95$0 = N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(N[Sin[N[(y + z), $MachinePrecision]], $MachinePrecision] / N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.005], t$95$1, If[LessEqual[t$95$0, 0.002], N[(x + N[(N[(y + N[(z * N[(1.0 + N[(z * N[(y + N[(0.3333333333333333 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \tan \left(y + z\right)\\
          t_1 := x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}\\
          \mathbf{if}\;t\_0 \leq -0.005:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;t\_0 \leq 0.002:\\
          \;\;\;\;x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)\right) - \tan a\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (tan.f64 (+.f64 y z)) < -0.0050000000000000001 or 2e-3 < (tan.f64 (+.f64 y z))

            1. Initial program 79.1%

              \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
            2. Taylor expanded in a around 0

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

                \[\leadsto x + \color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} \]
              2. lower-/.f64N/A

                \[\leadsto x + \frac{\sin \left(y + z\right)}{\color{blue}{\cos \left(y + z\right)}} \]
              3. lower-sin.f64N/A

                \[\leadsto x + \frac{\sin \left(y + z\right)}{\cos \color{blue}{\left(y + z\right)}} \]
              4. lower-+.f64N/A

                \[\leadsto x + \frac{\sin \left(y + z\right)}{\cos \left(\color{blue}{y} + z\right)} \]
              5. lower-cos.f64N/A

                \[\leadsto x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} \]
              6. lower-+.f6450.1

                \[\leadsto x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} \]
            4. Applied rewrites50.1%

              \[\leadsto \color{blue}{x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} \]

            if -0.0050000000000000001 < (tan.f64 (+.f64 y z)) < 2e-3

            1. Initial program 79.1%

              \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
            2. Step-by-step derivation
              1. lift-tan.f64N/A

                \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
              2. tan-quotN/A

                \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
              3. lift-+.f64N/A

                \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
              4. +-commutativeN/A

                \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
              5. sin-sumN/A

                \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
              6. div-addN/A

                \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
              7. *-commutativeN/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              8. lower-+.f64N/A

                \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
              9. lower-/.f64N/A

                \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              10. lower-*.f64N/A

                \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              11. lower-sin.f64N/A

                \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              12. lower-cos.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              13. lower-cos.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              14. lift-+.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              15. +-commutativeN/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              16. lower-+.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              17. lower-/.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
            3. Applied rewrites79.6%

              \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
            4. Step-by-step derivation
              1. lift-cos.f64N/A

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

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              3. add-flipN/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              4. cos-diffN/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              5. cos-neg-revN/A

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

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

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              8. lower-fma.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              9. lift-sin.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              10. lower-*.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              11. lower-sin.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              12. lower-neg.f6480.4

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
            5. Applied rewrites80.4%

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

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
              2. lift-+.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
              3. add-flipN/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
              4. cos-diffN/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
              5. cos-neg-revN/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
              6. lift-cos.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
              7. lift-cos.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
              8. lower-fma.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
              9. lift-sin.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
              10. lower-*.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
              11. lower-sin.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
              12. lower-neg.f6499.7

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
            7. Applied rewrites99.7%

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

              \[\leadsto x + \left(\color{blue}{\left(y \cdot \left(1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}\right) + \frac{\sin z}{\cos z}\right)} - \tan a\right) \]
            9. Step-by-step derivation
              1. lower-fma.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, \color{blue}{1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              2. lower--.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - \color{blue}{-1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              3. lower-*.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \color{blue}{\frac{{\sin z}^{2}}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              4. lower-/.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{\color{blue}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              5. lower-pow.f64N/A

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

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos \color{blue}{z}}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              7. lower-pow.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{\color{blue}{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              8. lower-cos.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              9. lower-/.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              10. lower-sin.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              11. lower-cos.f6451.1

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
            10. Applied rewrites51.1%

              \[\leadsto x + \left(\color{blue}{\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right)} - \tan a\right) \]
            11. Taylor expanded in z around 0

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

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

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

                \[\leadsto x + \left(\left(y + z \cdot \left(1 + z \cdot \color{blue}{\left(y + \frac{1}{3} \cdot z\right)}\right)\right) - \tan a\right) \]
              4. lower-*.f64N/A

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

                \[\leadsto x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + \frac{1}{3} \cdot \color{blue}{z}\right)\right)\right) - \tan a\right) \]
              6. lower-*.f6427.2

                \[\leadsto x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)\right) - \tan a\right) \]
            13. Applied rewrites27.2%

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

          Alternative 13: 51.6% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -72000:\\ \;\;\;\;x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)\right) - \tan a\right)\\ \mathbf{elif}\;a \leq 1.6:\\ \;\;\;\;x + \left(\tan \left(y + z\right) - a \cdot \left(1 + 0.3333333333333333 \cdot {a}^{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1\\ \end{array} \end{array} \]
          (FPCore (x y z a)
           :precision binary64
           (if (<= a -72000.0)
             (+ x (- (+ y (* z (+ 1.0 (* z (+ y (* 0.3333333333333333 z)))))) (tan a)))
             (if (<= a 1.6)
               (+ x (- (tan (+ y z)) (* a (+ 1.0 (* 0.3333333333333333 (pow a 2.0))))))
               (* x 1.0))))
          double code(double x, double y, double z, double a) {
          	double tmp;
          	if (a <= -72000.0) {
          		tmp = x + ((y + (z * (1.0 + (z * (y + (0.3333333333333333 * z)))))) - tan(a));
          	} else if (a <= 1.6) {
          		tmp = x + (tan((y + z)) - (a * (1.0 + (0.3333333333333333 * pow(a, 2.0)))));
          	} else {
          		tmp = x * 1.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(x, y, z, a)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: a
              real(8) :: tmp
              if (a <= (-72000.0d0)) then
                  tmp = x + ((y + (z * (1.0d0 + (z * (y + (0.3333333333333333d0 * z)))))) - tan(a))
              else if (a <= 1.6d0) then
                  tmp = x + (tan((y + z)) - (a * (1.0d0 + (0.3333333333333333d0 * (a ** 2.0d0)))))
              else
                  tmp = x * 1.0d0
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double a) {
          	double tmp;
          	if (a <= -72000.0) {
          		tmp = x + ((y + (z * (1.0 + (z * (y + (0.3333333333333333 * z)))))) - Math.tan(a));
          	} else if (a <= 1.6) {
          		tmp = x + (Math.tan((y + z)) - (a * (1.0 + (0.3333333333333333 * Math.pow(a, 2.0)))));
          	} else {
          		tmp = x * 1.0;
          	}
          	return tmp;
          }
          
          def code(x, y, z, a):
          	tmp = 0
          	if a <= -72000.0:
          		tmp = x + ((y + (z * (1.0 + (z * (y + (0.3333333333333333 * z)))))) - math.tan(a))
          	elif a <= 1.6:
          		tmp = x + (math.tan((y + z)) - (a * (1.0 + (0.3333333333333333 * math.pow(a, 2.0)))))
          	else:
          		tmp = x * 1.0
          	return tmp
          
          function code(x, y, z, a)
          	tmp = 0.0
          	if (a <= -72000.0)
          		tmp = Float64(x + Float64(Float64(y + Float64(z * Float64(1.0 + Float64(z * Float64(y + Float64(0.3333333333333333 * z)))))) - tan(a)));
          	elseif (a <= 1.6)
          		tmp = Float64(x + Float64(tan(Float64(y + z)) - Float64(a * Float64(1.0 + Float64(0.3333333333333333 * (a ^ 2.0))))));
          	else
          		tmp = Float64(x * 1.0);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, a)
          	tmp = 0.0;
          	if (a <= -72000.0)
          		tmp = x + ((y + (z * (1.0 + (z * (y + (0.3333333333333333 * z)))))) - tan(a));
          	elseif (a <= 1.6)
          		tmp = x + (tan((y + z)) - (a * (1.0 + (0.3333333333333333 * (a ^ 2.0)))));
          	else
          		tmp = x * 1.0;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, a_] := If[LessEqual[a, -72000.0], N[(x + N[(N[(y + N[(z * N[(1.0 + N[(z * N[(y + N[(0.3333333333333333 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[(a * N[(1.0 + N[(0.3333333333333333 * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 1.0), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;a \leq -72000:\\
          \;\;\;\;x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)\right) - \tan a\right)\\
          
          \mathbf{elif}\;a \leq 1.6:\\
          \;\;\;\;x + \left(\tan \left(y + z\right) - a \cdot \left(1 + 0.3333333333333333 \cdot {a}^{2}\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;x \cdot 1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if a < -72000

            1. Initial program 79.1%

              \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
            2. Step-by-step derivation
              1. lift-tan.f64N/A

                \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
              2. tan-quotN/A

                \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
              3. lift-+.f64N/A

                \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
              4. +-commutativeN/A

                \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
              5. sin-sumN/A

                \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
              6. div-addN/A

                \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
              7. *-commutativeN/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              8. lower-+.f64N/A

                \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
              9. lower-/.f64N/A

                \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              10. lower-*.f64N/A

                \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              11. lower-sin.f64N/A

                \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              12. lower-cos.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              13. lower-cos.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              14. lift-+.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              15. +-commutativeN/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              16. lower-+.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
              17. lower-/.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
            3. Applied rewrites79.6%

              \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
            4. Step-by-step derivation
              1. lift-cos.f64N/A

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

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              3. add-flipN/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              4. cos-diffN/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              5. cos-neg-revN/A

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

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

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              8. lower-fma.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              9. lift-sin.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              10. lower-*.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              11. lower-sin.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              12. lower-neg.f6480.4

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
            5. Applied rewrites80.4%

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

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
              2. lift-+.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
              3. add-flipN/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
              4. cos-diffN/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
              5. cos-neg-revN/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
              6. lift-cos.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
              7. lift-cos.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
              8. lower-fma.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
              9. lift-sin.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
              10. lower-*.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
              11. lower-sin.f64N/A

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
              12. lower-neg.f6499.7

                \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
            7. Applied rewrites99.7%

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

              \[\leadsto x + \left(\color{blue}{\left(y \cdot \left(1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}\right) + \frac{\sin z}{\cos z}\right)} - \tan a\right) \]
            9. Step-by-step derivation
              1. lower-fma.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, \color{blue}{1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              2. lower--.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - \color{blue}{-1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              3. lower-*.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \color{blue}{\frac{{\sin z}^{2}}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              4. lower-/.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{\color{blue}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              5. lower-pow.f64N/A

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

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos \color{blue}{z}}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              7. lower-pow.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{\color{blue}{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              8. lower-cos.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              9. lower-/.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              10. lower-sin.f64N/A

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              11. lower-cos.f6451.1

                \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
            10. Applied rewrites51.1%

              \[\leadsto x + \left(\color{blue}{\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right)} - \tan a\right) \]
            11. Taylor expanded in z around 0

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

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

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

                \[\leadsto x + \left(\left(y + z \cdot \left(1 + z \cdot \color{blue}{\left(y + \frac{1}{3} \cdot z\right)}\right)\right) - \tan a\right) \]
              4. lower-*.f64N/A

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

                \[\leadsto x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + \frac{1}{3} \cdot \color{blue}{z}\right)\right)\right) - \tan a\right) \]
              6. lower-*.f6427.2

                \[\leadsto x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)\right) - \tan a\right) \]
            13. Applied rewrites27.2%

              \[\leadsto x + \left(\left(y + \color{blue}{z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)}\right) - \tan a\right) \]

            if -72000 < a < 1.6000000000000001

            1. Initial program 79.1%

              \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
            2. Taylor expanded in a around 0

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

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

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

                \[\leadsto x + \left(\tan \left(y + z\right) - a \cdot \left(1 + \frac{1}{3} \cdot \color{blue}{{a}^{2}}\right)\right) \]
              4. lower-pow.f6440.1

                \[\leadsto x + \left(\tan \left(y + z\right) - a \cdot \left(1 + 0.3333333333333333 \cdot {a}^{\color{blue}{2}}\right)\right) \]
            4. Applied rewrites40.1%

              \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a \cdot \left(1 + 0.3333333333333333 \cdot {a}^{2}\right)}\right) \]

            if 1.6000000000000001 < a

            1. Initial program 79.1%

              \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
            2. Taylor expanded in x around inf

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

                \[\leadsto x \cdot \color{blue}{\left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right)} \]
              2. lower--.f64N/A

                \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \color{blue}{\frac{\sin a}{x \cdot \cos a}}\right) \]
              3. lower-+.f64N/A

                \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\color{blue}{\sin a}}{x \cdot \cos a}\right) \]
              4. lower-/.f64N/A

                \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
              5. lower-sin.f64N/A

                \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
              6. lower-+.f64N/A

                \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
              7. lower-*.f64N/A

                \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
              8. lower-cos.f64N/A

                \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
              9. lower-+.f64N/A

                \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
              10. lower-/.f64N/A

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

                \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{\color{blue}{x} \cdot \cos a}\right) \]
              12. lower-*.f64N/A

                \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \color{blue}{\cos a}}\right) \]
              13. lower-cos.f6478.8

                \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
            4. Applied rewrites78.8%

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

              \[\leadsto x \cdot 1 \]
            6. Step-by-step derivation
              1. Applied rewrites31.8%

                \[\leadsto x \cdot 1 \]
            7. Recombined 3 regimes into one program.
            8. Add Preprocessing

            Alternative 14: 51.5% accurate, 1.3× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -72000:\\ \;\;\;\;x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)\right) - \tan a\right)\\ \mathbf{elif}\;a \leq 1.6:\\ \;\;\;\;x - \left(a - \tan \left(y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1\\ \end{array} \end{array} \]
            (FPCore (x y z a)
             :precision binary64
             (if (<= a -72000.0)
               (+ x (- (+ y (* z (+ 1.0 (* z (+ y (* 0.3333333333333333 z)))))) (tan a)))
               (if (<= a 1.6) (- x (- a (tan (+ y z)))) (* x 1.0))))
            double code(double x, double y, double z, double a) {
            	double tmp;
            	if (a <= -72000.0) {
            		tmp = x + ((y + (z * (1.0 + (z * (y + (0.3333333333333333 * z)))))) - tan(a));
            	} else if (a <= 1.6) {
            		tmp = x - (a - tan((y + z)));
            	} else {
            		tmp = x * 1.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(x, y, z, a)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: a
                real(8) :: tmp
                if (a <= (-72000.0d0)) then
                    tmp = x + ((y + (z * (1.0d0 + (z * (y + (0.3333333333333333d0 * z)))))) - tan(a))
                else if (a <= 1.6d0) then
                    tmp = x - (a - tan((y + z)))
                else
                    tmp = x * 1.0d0
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z, double a) {
            	double tmp;
            	if (a <= -72000.0) {
            		tmp = x + ((y + (z * (1.0 + (z * (y + (0.3333333333333333 * z)))))) - Math.tan(a));
            	} else if (a <= 1.6) {
            		tmp = x - (a - Math.tan((y + z)));
            	} else {
            		tmp = x * 1.0;
            	}
            	return tmp;
            }
            
            def code(x, y, z, a):
            	tmp = 0
            	if a <= -72000.0:
            		tmp = x + ((y + (z * (1.0 + (z * (y + (0.3333333333333333 * z)))))) - math.tan(a))
            	elif a <= 1.6:
            		tmp = x - (a - math.tan((y + z)))
            	else:
            		tmp = x * 1.0
            	return tmp
            
            function code(x, y, z, a)
            	tmp = 0.0
            	if (a <= -72000.0)
            		tmp = Float64(x + Float64(Float64(y + Float64(z * Float64(1.0 + Float64(z * Float64(y + Float64(0.3333333333333333 * z)))))) - tan(a)));
            	elseif (a <= 1.6)
            		tmp = Float64(x - Float64(a - tan(Float64(y + z))));
            	else
            		tmp = Float64(x * 1.0);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z, a)
            	tmp = 0.0;
            	if (a <= -72000.0)
            		tmp = x + ((y + (z * (1.0 + (z * (y + (0.3333333333333333 * z)))))) - tan(a));
            	elseif (a <= 1.6)
            		tmp = x - (a - tan((y + z)));
            	else
            		tmp = x * 1.0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_, a_] := If[LessEqual[a, -72000.0], N[(x + N[(N[(y + N[(z * N[(1.0 + N[(z * N[(y + N[(0.3333333333333333 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6], N[(x - N[(a - N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 1.0), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;a \leq -72000:\\
            \;\;\;\;x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)\right) - \tan a\right)\\
            
            \mathbf{elif}\;a \leq 1.6:\\
            \;\;\;\;x - \left(a - \tan \left(y + z\right)\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;x \cdot 1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if a < -72000

              1. Initial program 79.1%

                \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
              2. Step-by-step derivation
                1. lift-tan.f64N/A

                  \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
                2. tan-quotN/A

                  \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
                3. lift-+.f64N/A

                  \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
                4. +-commutativeN/A

                  \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
                5. sin-sumN/A

                  \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
                6. div-addN/A

                  \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
                7. *-commutativeN/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                8. lower-+.f64N/A

                  \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
                9. lower-/.f64N/A

                  \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                10. lower-*.f64N/A

                  \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                11. lower-sin.f64N/A

                  \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                12. lower-cos.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                13. lower-cos.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                14. lift-+.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                15. +-commutativeN/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                16. lower-+.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                17. lower-/.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
              3. Applied rewrites79.6%

                \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
              4. Step-by-step derivation
                1. lift-cos.f64N/A

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

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                3. add-flipN/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                4. cos-diffN/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                5. cos-neg-revN/A

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

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

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                8. lower-fma.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                9. lift-sin.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                10. lower-*.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                11. lower-sin.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                12. lower-neg.f6480.4

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
              5. Applied rewrites80.4%

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

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
                2. lift-+.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
                3. add-flipN/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
                4. cos-diffN/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
                5. cos-neg-revN/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
                6. lift-cos.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
                7. lift-cos.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
                8. lower-fma.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
                9. lift-sin.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
                10. lower-*.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
                11. lower-sin.f64N/A

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
                12. lower-neg.f6499.7

                  \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
              7. Applied rewrites99.7%

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

                \[\leadsto x + \left(\color{blue}{\left(y \cdot \left(1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}\right) + \frac{\sin z}{\cos z}\right)} - \tan a\right) \]
              9. Step-by-step derivation
                1. lower-fma.f64N/A

                  \[\leadsto x + \left(\mathsf{fma}\left(y, \color{blue}{1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                2. lower--.f64N/A

                  \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - \color{blue}{-1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                3. lower-*.f64N/A

                  \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \color{blue}{\frac{{\sin z}^{2}}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                4. lower-/.f64N/A

                  \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{\color{blue}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                5. lower-pow.f64N/A

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

                  \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos \color{blue}{z}}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                7. lower-pow.f64N/A

                  \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{\color{blue}{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                8. lower-cos.f64N/A

                  \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                9. lower-/.f64N/A

                  \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                10. lower-sin.f64N/A

                  \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                11. lower-cos.f6451.1

                  \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
              10. Applied rewrites51.1%

                \[\leadsto x + \left(\color{blue}{\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right)} - \tan a\right) \]
              11. Taylor expanded in z around 0

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

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

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

                  \[\leadsto x + \left(\left(y + z \cdot \left(1 + z \cdot \color{blue}{\left(y + \frac{1}{3} \cdot z\right)}\right)\right) - \tan a\right) \]
                4. lower-*.f64N/A

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

                  \[\leadsto x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + \frac{1}{3} \cdot \color{blue}{z}\right)\right)\right) - \tan a\right) \]
                6. lower-*.f6427.2

                  \[\leadsto x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)\right) - \tan a\right) \]
              13. Applied rewrites27.2%

                \[\leadsto x + \left(\left(y + \color{blue}{z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)}\right) - \tan a\right) \]

              if -72000 < a < 1.6000000000000001

              1. Initial program 79.1%

                \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
              2. Taylor expanded in a around 0

                \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a}\right) \]
              3. Step-by-step derivation
                1. Applied rewrites40.5%

                  \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a}\right) \]
                2. Step-by-step derivation
                  1. lift-+.f64N/A

                    \[\leadsto \color{blue}{x + \left(\tan \left(y + z\right) - a\right)} \]
                  2. add-flipN/A

                    \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\tan \left(y + z\right) - a\right)\right)\right)} \]
                  3. lower--.f64N/A

                    \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\tan \left(y + z\right) - a\right)\right)\right)} \]
                  4. lift--.f64N/A

                    \[\leadsto x - \left(\mathsf{neg}\left(\color{blue}{\left(\tan \left(y + z\right) - a\right)}\right)\right) \]
                  5. sub-negate-revN/A

                    \[\leadsto x - \color{blue}{\left(a - \tan \left(y + z\right)\right)} \]
                  6. lower--.f6440.5

                    \[\leadsto x - \color{blue}{\left(a - \tan \left(y + z\right)\right)} \]
                3. Applied rewrites40.5%

                  \[\leadsto \color{blue}{x - \left(a - \tan \left(y + z\right)\right)} \]

                if 1.6000000000000001 < a

                1. Initial program 79.1%

                  \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                2. Taylor expanded in x around inf

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

                    \[\leadsto x \cdot \color{blue}{\left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right)} \]
                  2. lower--.f64N/A

                    \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \color{blue}{\frac{\sin a}{x \cdot \cos a}}\right) \]
                  3. lower-+.f64N/A

                    \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\color{blue}{\sin a}}{x \cdot \cos a}\right) \]
                  4. lower-/.f64N/A

                    \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                  5. lower-sin.f64N/A

                    \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                  6. lower-+.f64N/A

                    \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                  7. lower-*.f64N/A

                    \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                  8. lower-cos.f64N/A

                    \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                  9. lower-+.f64N/A

                    \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                  10. lower-/.f64N/A

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

                    \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{\color{blue}{x} \cdot \cos a}\right) \]
                  12. lower-*.f64N/A

                    \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \color{blue}{\cos a}}\right) \]
                  13. lower-cos.f6478.8

                    \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                4. Applied rewrites78.8%

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

                  \[\leadsto x \cdot 1 \]
                6. Step-by-step derivation
                  1. Applied rewrites31.8%

                    \[\leadsto x \cdot 1 \]
                7. Recombined 3 regimes into one program.
                8. Add Preprocessing

                Alternative 15: 51.5% accurate, 1.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -72000:\\ \;\;\;\;x + \left(\left(y + z \cdot \left(1 + y \cdot z\right)\right) - \tan a\right)\\ \mathbf{elif}\;a \leq 1.6:\\ \;\;\;\;x - \left(a - \tan \left(y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1\\ \end{array} \end{array} \]
                (FPCore (x y z a)
                 :precision binary64
                 (if (<= a -72000.0)
                   (+ x (- (+ y (* z (+ 1.0 (* y z)))) (tan a)))
                   (if (<= a 1.6) (- x (- a (tan (+ y z)))) (* x 1.0))))
                double code(double x, double y, double z, double a) {
                	double tmp;
                	if (a <= -72000.0) {
                		tmp = x + ((y + (z * (1.0 + (y * z)))) - tan(a));
                	} else if (a <= 1.6) {
                		tmp = x - (a - tan((y + z)));
                	} else {
                		tmp = x * 1.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(x, y, z, a)
                use fmin_fmax_functions
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: a
                    real(8) :: tmp
                    if (a <= (-72000.0d0)) then
                        tmp = x + ((y + (z * (1.0d0 + (y * z)))) - tan(a))
                    else if (a <= 1.6d0) then
                        tmp = x - (a - tan((y + z)))
                    else
                        tmp = x * 1.0d0
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z, double a) {
                	double tmp;
                	if (a <= -72000.0) {
                		tmp = x + ((y + (z * (1.0 + (y * z)))) - Math.tan(a));
                	} else if (a <= 1.6) {
                		tmp = x - (a - Math.tan((y + z)));
                	} else {
                		tmp = x * 1.0;
                	}
                	return tmp;
                }
                
                def code(x, y, z, a):
                	tmp = 0
                	if a <= -72000.0:
                		tmp = x + ((y + (z * (1.0 + (y * z)))) - math.tan(a))
                	elif a <= 1.6:
                		tmp = x - (a - math.tan((y + z)))
                	else:
                		tmp = x * 1.0
                	return tmp
                
                function code(x, y, z, a)
                	tmp = 0.0
                	if (a <= -72000.0)
                		tmp = Float64(x + Float64(Float64(y + Float64(z * Float64(1.0 + Float64(y * z)))) - tan(a)));
                	elseif (a <= 1.6)
                		tmp = Float64(x - Float64(a - tan(Float64(y + z))));
                	else
                		tmp = Float64(x * 1.0);
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, a)
                	tmp = 0.0;
                	if (a <= -72000.0)
                		tmp = x + ((y + (z * (1.0 + (y * z)))) - tan(a));
                	elseif (a <= 1.6)
                		tmp = x - (a - tan((y + z)));
                	else
                		tmp = x * 1.0;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_, a_] := If[LessEqual[a, -72000.0], N[(x + N[(N[(y + N[(z * N[(1.0 + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6], N[(x - N[(a - N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 1.0), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;a \leq -72000:\\
                \;\;\;\;x + \left(\left(y + z \cdot \left(1 + y \cdot z\right)\right) - \tan a\right)\\
                
                \mathbf{elif}\;a \leq 1.6:\\
                \;\;\;\;x - \left(a - \tan \left(y + z\right)\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;x \cdot 1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if a < -72000

                  1. Initial program 79.1%

                    \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                  2. Step-by-step derivation
                    1. lift-tan.f64N/A

                      \[\leadsto x + \left(\color{blue}{\tan \left(y + z\right)} - \tan a\right) \]
                    2. tan-quotN/A

                      \[\leadsto x + \left(\color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} - \tan a\right) \]
                    3. lift-+.f64N/A

                      \[\leadsto x + \left(\frac{\sin \color{blue}{\left(y + z\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
                    4. +-commutativeN/A

                      \[\leadsto x + \left(\frac{\sin \color{blue}{\left(z + y\right)}}{\cos \left(y + z\right)} - \tan a\right) \]
                    5. sin-sumN/A

                      \[\leadsto x + \left(\frac{\color{blue}{\sin z \cdot \cos y + \cos z \cdot \sin y}}{\cos \left(y + z\right)} - \tan a\right) \]
                    6. div-addN/A

                      \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
                    7. *-commutativeN/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\color{blue}{\sin y \cdot \cos z}}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                    8. lower-+.f64N/A

                      \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right)} - \tan a\right) \]
                    9. lower-/.f64N/A

                      \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z \cdot \cos y}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                    10. lower-*.f64N/A

                      \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z \cdot \cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                    11. lower-sin.f64N/A

                      \[\leadsto x + \left(\left(\frac{\color{blue}{\sin z} \cdot \cos y}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                    12. lower-cos.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \color{blue}{\cos y}}{\cos \left(y + z\right)} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                    13. lower-cos.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos \left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                    14. lift-+.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(y + z\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                    15. +-commutativeN/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                    16. lower-+.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}\right) - \tan a\right) \]
                    17. lower-/.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
                  3. Applied rewrites79.6%

                    \[\leadsto x + \left(\color{blue}{\left(\frac{\sin z \cdot \cos y}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right)} - \tan a\right) \]
                  4. Step-by-step derivation
                    1. lift-cos.f64N/A

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

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z + y\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                    3. add-flipN/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                    4. cos-diffN/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                    5. cos-neg-revN/A

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

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

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                    8. lower-fma.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                    9. lift-sin.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                    10. lower-*.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                    11. lower-sin.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                    12. lower-neg.f6480.4

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
                  5. Applied rewrites80.4%

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

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
                    2. lift-+.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
                    3. add-flipN/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos \color{blue}{\left(z - \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
                    4. cos-diffN/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z \cdot \cos \left(\mathsf{neg}\left(y\right)\right) + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
                    5. cos-neg-revN/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
                    6. lift-cos.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\cos z} \cdot \cos y + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
                    7. lift-cos.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\cos z \cdot \color{blue}{\cos y} + \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right) - \tan a\right) \]
                    8. lower-fma.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\color{blue}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}}\right) - \tan a\right) \]
                    9. lift-sin.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z} \cdot \sin \left(\mathsf{neg}\left(y\right)\right)\right)}\right) - \tan a\right) \]
                    10. lower-*.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \color{blue}{\sin z \cdot \sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
                    11. lower-sin.f64N/A

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \color{blue}{\sin \left(\mathsf{neg}\left(y\right)\right)}\right)}\right) - \tan a\right) \]
                    12. lower-neg.f6499.7

                      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\cos z \cdot \sin y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \color{blue}{\left(-y\right)}\right)}\right) - \tan a\right) \]
                  7. Applied rewrites99.7%

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

                    \[\leadsto x + \left(\color{blue}{\left(y \cdot \left(1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}\right) + \frac{\sin z}{\cos z}\right)} - \tan a\right) \]
                  9. Step-by-step derivation
                    1. lower-fma.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, \color{blue}{1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    2. lower--.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - \color{blue}{-1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    3. lower-*.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \color{blue}{\frac{{\sin z}^{2}}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    4. lower-/.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{\color{blue}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    5. lower-pow.f64N/A

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

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos \color{blue}{z}}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    7. lower-pow.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{\color{blue}{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    8. lower-cos.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    9. lower-/.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    10. lower-sin.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    11. lower-cos.f6451.1

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                  10. Applied rewrites51.1%

                    \[\leadsto x + \left(\color{blue}{\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right)} - \tan a\right) \]
                  11. Taylor expanded in z around 0

                    \[\leadsto x + \left(\left(y + \color{blue}{z \cdot \left(1 + y \cdot z\right)}\right) - \tan a\right) \]
                  12. Step-by-step derivation
                    1. lower-+.f64N/A

                      \[\leadsto x + \left(\left(y + z \cdot \color{blue}{\left(1 + y \cdot z\right)}\right) - \tan a\right) \]
                    2. lower-*.f64N/A

                      \[\leadsto x + \left(\left(y + z \cdot \left(1 + \color{blue}{y \cdot z}\right)\right) - \tan a\right) \]
                    3. lower-+.f64N/A

                      \[\leadsto x + \left(\left(y + z \cdot \left(1 + y \cdot \color{blue}{z}\right)\right) - \tan a\right) \]
                    4. lower-*.f6427.3

                      \[\leadsto x + \left(\left(y + z \cdot \left(1 + y \cdot z\right)\right) - \tan a\right) \]
                  13. Applied rewrites27.3%

                    \[\leadsto x + \left(\left(y + \color{blue}{z \cdot \left(1 + y \cdot z\right)}\right) - \tan a\right) \]

                  if -72000 < a < 1.6000000000000001

                  1. Initial program 79.1%

                    \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                  2. Taylor expanded in a around 0

                    \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a}\right) \]
                  3. Step-by-step derivation
                    1. Applied rewrites40.5%

                      \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a}\right) \]
                    2. Step-by-step derivation
                      1. lift-+.f64N/A

                        \[\leadsto \color{blue}{x + \left(\tan \left(y + z\right) - a\right)} \]
                      2. add-flipN/A

                        \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\tan \left(y + z\right) - a\right)\right)\right)} \]
                      3. lower--.f64N/A

                        \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\tan \left(y + z\right) - a\right)\right)\right)} \]
                      4. lift--.f64N/A

                        \[\leadsto x - \left(\mathsf{neg}\left(\color{blue}{\left(\tan \left(y + z\right) - a\right)}\right)\right) \]
                      5. sub-negate-revN/A

                        \[\leadsto x - \color{blue}{\left(a - \tan \left(y + z\right)\right)} \]
                      6. lower--.f6440.5

                        \[\leadsto x - \color{blue}{\left(a - \tan \left(y + z\right)\right)} \]
                    3. Applied rewrites40.5%

                      \[\leadsto \color{blue}{x - \left(a - \tan \left(y + z\right)\right)} \]

                    if 1.6000000000000001 < a

                    1. Initial program 79.1%

                      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                    2. Taylor expanded in x around inf

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

                        \[\leadsto x \cdot \color{blue}{\left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right)} \]
                      2. lower--.f64N/A

                        \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \color{blue}{\frac{\sin a}{x \cdot \cos a}}\right) \]
                      3. lower-+.f64N/A

                        \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\color{blue}{\sin a}}{x \cdot \cos a}\right) \]
                      4. lower-/.f64N/A

                        \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                      5. lower-sin.f64N/A

                        \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                      6. lower-+.f64N/A

                        \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                      7. lower-*.f64N/A

                        \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                      8. lower-cos.f64N/A

                        \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                      9. lower-+.f64N/A

                        \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                      10. lower-/.f64N/A

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

                        \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{\color{blue}{x} \cdot \cos a}\right) \]
                      12. lower-*.f64N/A

                        \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \color{blue}{\cos a}}\right) \]
                      13. lower-cos.f6478.8

                        \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                    4. Applied rewrites78.8%

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

                      \[\leadsto x \cdot 1 \]
                    6. Step-by-step derivation
                      1. Applied rewrites31.8%

                        \[\leadsto x \cdot 1 \]
                    7. Recombined 3 regimes into one program.
                    8. Add Preprocessing

                    Alternative 16: 50.1% accurate, 1.5× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -0.09:\\ \;\;\;\;x \cdot 1\\ \mathbf{elif}\;a \leq 1.6:\\ \;\;\;\;x - \left(a - \tan \left(y + z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1\\ \end{array} \end{array} \]
                    (FPCore (x y z a)
                     :precision binary64
                     (if (<= a -0.09)
                       (* x 1.0)
                       (if (<= a 1.6) (- x (- a (tan (+ y z)))) (* x 1.0))))
                    double code(double x, double y, double z, double a) {
                    	double tmp;
                    	if (a <= -0.09) {
                    		tmp = x * 1.0;
                    	} else if (a <= 1.6) {
                    		tmp = x - (a - tan((y + z)));
                    	} else {
                    		tmp = x * 1.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(x, y, z, a)
                    use fmin_fmax_functions
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: a
                        real(8) :: tmp
                        if (a <= (-0.09d0)) then
                            tmp = x * 1.0d0
                        else if (a <= 1.6d0) then
                            tmp = x - (a - tan((y + z)))
                        else
                            tmp = x * 1.0d0
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z, double a) {
                    	double tmp;
                    	if (a <= -0.09) {
                    		tmp = x * 1.0;
                    	} else if (a <= 1.6) {
                    		tmp = x - (a - Math.tan((y + z)));
                    	} else {
                    		tmp = x * 1.0;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, a):
                    	tmp = 0
                    	if a <= -0.09:
                    		tmp = x * 1.0
                    	elif a <= 1.6:
                    		tmp = x - (a - math.tan((y + z)))
                    	else:
                    		tmp = x * 1.0
                    	return tmp
                    
                    function code(x, y, z, a)
                    	tmp = 0.0
                    	if (a <= -0.09)
                    		tmp = Float64(x * 1.0);
                    	elseif (a <= 1.6)
                    		tmp = Float64(x - Float64(a - tan(Float64(y + z))));
                    	else
                    		tmp = Float64(x * 1.0);
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z, a)
                    	tmp = 0.0;
                    	if (a <= -0.09)
                    		tmp = x * 1.0;
                    	elseif (a <= 1.6)
                    		tmp = x - (a - tan((y + z)));
                    	else
                    		tmp = x * 1.0;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_, a_] := If[LessEqual[a, -0.09], N[(x * 1.0), $MachinePrecision], If[LessEqual[a, 1.6], N[(x - N[(a - N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 1.0), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;a \leq -0.09:\\
                    \;\;\;\;x \cdot 1\\
                    
                    \mathbf{elif}\;a \leq 1.6:\\
                    \;\;\;\;x - \left(a - \tan \left(y + z\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;x \cdot 1\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if a < -0.089999999999999997 or 1.6000000000000001 < a

                      1. Initial program 79.1%

                        \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                      2. Taylor expanded in x around inf

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

                          \[\leadsto x \cdot \color{blue}{\left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right)} \]
                        2. lower--.f64N/A

                          \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \color{blue}{\frac{\sin a}{x \cdot \cos a}}\right) \]
                        3. lower-+.f64N/A

                          \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\color{blue}{\sin a}}{x \cdot \cos a}\right) \]
                        4. lower-/.f64N/A

                          \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                        5. lower-sin.f64N/A

                          \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                        6. lower-+.f64N/A

                          \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                        7. lower-*.f64N/A

                          \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                        8. lower-cos.f64N/A

                          \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                        9. lower-+.f64N/A

                          \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                        10. lower-/.f64N/A

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

                          \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{\color{blue}{x} \cdot \cos a}\right) \]
                        12. lower-*.f64N/A

                          \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \color{blue}{\cos a}}\right) \]
                        13. lower-cos.f6478.8

                          \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                      4. Applied rewrites78.8%

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

                        \[\leadsto x \cdot 1 \]
                      6. Step-by-step derivation
                        1. Applied rewrites31.8%

                          \[\leadsto x \cdot 1 \]

                        if -0.089999999999999997 < a < 1.6000000000000001

                        1. Initial program 79.1%

                          \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                        2. Taylor expanded in a around 0

                          \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a}\right) \]
                        3. Step-by-step derivation
                          1. Applied rewrites40.5%

                            \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a}\right) \]
                          2. Step-by-step derivation
                            1. lift-+.f64N/A

                              \[\leadsto \color{blue}{x + \left(\tan \left(y + z\right) - a\right)} \]
                            2. add-flipN/A

                              \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\tan \left(y + z\right) - a\right)\right)\right)} \]
                            3. lower--.f64N/A

                              \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\tan \left(y + z\right) - a\right)\right)\right)} \]
                            4. lift--.f64N/A

                              \[\leadsto x - \left(\mathsf{neg}\left(\color{blue}{\left(\tan \left(y + z\right) - a\right)}\right)\right) \]
                            5. sub-negate-revN/A

                              \[\leadsto x - \color{blue}{\left(a - \tan \left(y + z\right)\right)} \]
                            6. lower--.f6440.5

                              \[\leadsto x - \color{blue}{\left(a - \tan \left(y + z\right)\right)} \]
                          3. Applied rewrites40.5%

                            \[\leadsto \color{blue}{x - \left(a - \tan \left(y + z\right)\right)} \]
                        4. Recombined 2 regimes into one program.
                        5. Add Preprocessing

                        Alternative 17: 40.7% accurate, 1.6× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.65:\\ \;\;\;\;x \cdot 1\\ \mathbf{elif}\;a \leq 1.55:\\ \;\;\;\;x - \left(a - \tan z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 1\\ \end{array} \end{array} \]
                        (FPCore (x y z a)
                         :precision binary64
                         (if (<= a -1.65) (* x 1.0) (if (<= a 1.55) (- x (- a (tan z))) (* x 1.0))))
                        double code(double x, double y, double z, double a) {
                        	double tmp;
                        	if (a <= -1.65) {
                        		tmp = x * 1.0;
                        	} else if (a <= 1.55) {
                        		tmp = x - (a - tan(z));
                        	} else {
                        		tmp = x * 1.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(x, y, z, a)
                        use fmin_fmax_functions
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            real(8), intent (in) :: a
                            real(8) :: tmp
                            if (a <= (-1.65d0)) then
                                tmp = x * 1.0d0
                            else if (a <= 1.55d0) then
                                tmp = x - (a - tan(z))
                            else
                                tmp = x * 1.0d0
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double x, double y, double z, double a) {
                        	double tmp;
                        	if (a <= -1.65) {
                        		tmp = x * 1.0;
                        	} else if (a <= 1.55) {
                        		tmp = x - (a - Math.tan(z));
                        	} else {
                        		tmp = x * 1.0;
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, a):
                        	tmp = 0
                        	if a <= -1.65:
                        		tmp = x * 1.0
                        	elif a <= 1.55:
                        		tmp = x - (a - math.tan(z))
                        	else:
                        		tmp = x * 1.0
                        	return tmp
                        
                        function code(x, y, z, a)
                        	tmp = 0.0
                        	if (a <= -1.65)
                        		tmp = Float64(x * 1.0);
                        	elseif (a <= 1.55)
                        		tmp = Float64(x - Float64(a - tan(z)));
                        	else
                        		tmp = Float64(x * 1.0);
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x, y, z, a)
                        	tmp = 0.0;
                        	if (a <= -1.65)
                        		tmp = x * 1.0;
                        	elseif (a <= 1.55)
                        		tmp = x - (a - tan(z));
                        	else
                        		tmp = x * 1.0;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x_, y_, z_, a_] := If[LessEqual[a, -1.65], N[(x * 1.0), $MachinePrecision], If[LessEqual[a, 1.55], N[(x - N[(a - N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * 1.0), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;a \leq -1.65:\\
                        \;\;\;\;x \cdot 1\\
                        
                        \mathbf{elif}\;a \leq 1.55:\\
                        \;\;\;\;x - \left(a - \tan z\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;x \cdot 1\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if a < -1.6499999999999999 or 1.55000000000000004 < a

                          1. Initial program 79.1%

                            \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                          2. Taylor expanded in x around inf

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

                              \[\leadsto x \cdot \color{blue}{\left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right)} \]
                            2. lower--.f64N/A

                              \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \color{blue}{\frac{\sin a}{x \cdot \cos a}}\right) \]
                            3. lower-+.f64N/A

                              \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\color{blue}{\sin a}}{x \cdot \cos a}\right) \]
                            4. lower-/.f64N/A

                              \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                            5. lower-sin.f64N/A

                              \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                            6. lower-+.f64N/A

                              \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                            7. lower-*.f64N/A

                              \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                            8. lower-cos.f64N/A

                              \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                            9. lower-+.f64N/A

                              \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                            10. lower-/.f64N/A

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

                              \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{\color{blue}{x} \cdot \cos a}\right) \]
                            12. lower-*.f64N/A

                              \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \color{blue}{\cos a}}\right) \]
                            13. lower-cos.f6478.8

                              \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                          4. Applied rewrites78.8%

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

                            \[\leadsto x \cdot 1 \]
                          6. Step-by-step derivation
                            1. Applied rewrites31.8%

                              \[\leadsto x \cdot 1 \]

                            if -1.6499999999999999 < a < 1.55000000000000004

                            1. Initial program 79.1%

                              \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                            2. Taylor expanded in a around 0

                              \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a}\right) \]
                            3. Step-by-step derivation
                              1. Applied rewrites40.5%

                                \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a}\right) \]
                              2. Step-by-step derivation
                                1. lift-+.f64N/A

                                  \[\leadsto \color{blue}{x + \left(\tan \left(y + z\right) - a\right)} \]
                                2. add-flipN/A

                                  \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\tan \left(y + z\right) - a\right)\right)\right)} \]
                                3. lower--.f64N/A

                                  \[\leadsto \color{blue}{x - \left(\mathsf{neg}\left(\left(\tan \left(y + z\right) - a\right)\right)\right)} \]
                                4. lift--.f64N/A

                                  \[\leadsto x - \left(\mathsf{neg}\left(\color{blue}{\left(\tan \left(y + z\right) - a\right)}\right)\right) \]
                                5. sub-negate-revN/A

                                  \[\leadsto x - \color{blue}{\left(a - \tan \left(y + z\right)\right)} \]
                                6. lower--.f6440.5

                                  \[\leadsto x - \color{blue}{\left(a - \tan \left(y + z\right)\right)} \]
                              3. Applied rewrites40.5%

                                \[\leadsto \color{blue}{x - \left(a - \tan \left(y + z\right)\right)} \]
                              4. Taylor expanded in y around 0

                                \[\leadsto x - \left(a - \tan \color{blue}{z}\right) \]
                              5. Step-by-step derivation
                                1. Applied rewrites31.1%

                                  \[\leadsto x - \left(a - \tan \color{blue}{z}\right) \]
                              6. Recombined 2 regimes into one program.
                              7. Add Preprocessing

                              Alternative 18: 31.8% accurate, 20.0× speedup?

                              \[\begin{array}{l} \\ x \cdot 1 \end{array} \]
                              (FPCore (x y z a) :precision binary64 (* x 1.0))
                              double code(double x, double y, double z, double a) {
                              	return x * 1.0;
                              }
                              
                              module fmin_fmax_functions
                                  implicit none
                                  private
                                  public fmax
                                  public fmin
                              
                                  interface fmax
                                      module procedure fmax88
                                      module procedure fmax44
                                      module procedure fmax84
                                      module procedure fmax48
                                  end interface
                                  interface fmin
                                      module procedure fmin88
                                      module procedure fmin44
                                      module procedure fmin84
                                      module procedure fmin48
                                  end interface
                              contains
                                  real(8) function fmax88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmax44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmax84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmax48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin88(x, y) result (res)
                                      real(8), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(4) function fmin44(x, y) result (res)
                                      real(4), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                  end function
                                  real(8) function fmin84(x, y) result(res)
                                      real(8), intent (in) :: x
                                      real(4), intent (in) :: y
                                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                  end function
                                  real(8) function fmin48(x, y) result(res)
                                      real(4), intent (in) :: x
                                      real(8), intent (in) :: y
                                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                  end function
                              end module
                              
                              real(8) function code(x, y, z, a)
                              use fmin_fmax_functions
                                  real(8), intent (in) :: x
                                  real(8), intent (in) :: y
                                  real(8), intent (in) :: z
                                  real(8), intent (in) :: a
                                  code = x * 1.0d0
                              end function
                              
                              public static double code(double x, double y, double z, double a) {
                              	return x * 1.0;
                              }
                              
                              def code(x, y, z, a):
                              	return x * 1.0
                              
                              function code(x, y, z, a)
                              	return Float64(x * 1.0)
                              end
                              
                              function tmp = code(x, y, z, a)
                              	tmp = x * 1.0;
                              end
                              
                              code[x_, y_, z_, a_] := N[(x * 1.0), $MachinePrecision]
                              
                              \begin{array}{l}
                              
                              \\
                              x \cdot 1
                              \end{array}
                              
                              Derivation
                              1. Initial program 79.1%

                                \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                              2. Taylor expanded in x around inf

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

                                  \[\leadsto x \cdot \color{blue}{\left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right)} \]
                                2. lower--.f64N/A

                                  \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \color{blue}{\frac{\sin a}{x \cdot \cos a}}\right) \]
                                3. lower-+.f64N/A

                                  \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\color{blue}{\sin a}}{x \cdot \cos a}\right) \]
                                4. lower-/.f64N/A

                                  \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                                5. lower-sin.f64N/A

                                  \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                                6. lower-+.f64N/A

                                  \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                                7. lower-*.f64N/A

                                  \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                                8. lower-cos.f64N/A

                                  \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                                9. lower-+.f64N/A

                                  \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                                10. lower-/.f64N/A

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

                                  \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{\color{blue}{x} \cdot \cos a}\right) \]
                                12. lower-*.f64N/A

                                  \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \color{blue}{\cos a}}\right) \]
                                13. lower-cos.f6478.8

                                  \[\leadsto x \cdot \left(\left(1 + \frac{\sin \left(y + z\right)}{x \cdot \cos \left(y + z\right)}\right) - \frac{\sin a}{x \cdot \cos a}\right) \]
                              4. Applied rewrites78.8%

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

                                \[\leadsto x \cdot 1 \]
                              6. Step-by-step derivation
                                1. Applied rewrites31.8%

                                  \[\leadsto x \cdot 1 \]
                                2. Add Preprocessing

                                Reproduce

                                ?
                                herbie shell --seed 2025147 
                                (FPCore (x y z a)
                                  :name "tan-example (used to crash)"
                                  :precision binary64
                                  :pre (and (and (and (or (== x 0.0) (and (<= 0.5884142 x) (<= x 505.5909))) (or (and (<= -1.796658e+308 y) (<= y -9.425585e-310)) (and (<= 1.284938e-309 y) (<= y 1.751224e+308)))) (or (and (<= -1.776707e+308 z) (<= z -8.599796e-310)) (and (<= 3.293145e-311 z) (<= z 1.725154e+308)))) (or (and (<= -1.796658e+308 a) (<= a -9.425585e-310)) (and (<= 1.284938e-309 a) (<= a 1.751224e+308))))
                                  (+ x (- (tan (+ y z)) (tan a))))