tan-example (used to crash)

Percentage Accurate: 79.4% → 99.7%
Time: 11.2s
Alternatives: 18
Speedup: 0.7×

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

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

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

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

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

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

    \[\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. lower--.f64N/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) \]
    5. 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 y} + \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}{\cos z \cdot \color{blue}{\cos y} - \sin z \cdot \sin y} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
    7. lower-*.f64N/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) \]
    8. 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) \]
    9. 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) \]
    10. *-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) \]
    11. lower-*.f6480.6

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

    \[\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. 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 z \cdot \sin y}}\right) - \tan a\right) \]
    5. 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 z \cdot \sin y}\right) - \tan a\right) \]
    6. 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 z \cdot \sin y}\right) - \tan a\right) \]
    7. 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 z \cdot \sin y}\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 - \color{blue}{\sin z} \cdot \sin y}\right) - \tan a\right) \]
    9. 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) \]
    10. *-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) \]
    11. 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: 90.3% 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 := \mathsf{fma}\left(\cos y, \cos z, t\_0\right)\\ t_3 := \cos z \cdot \sin y\\ t_4 := \cos \left(y + z\right)\\ t_5 := \cos y \cdot \sin z\\ \mathbf{if}\;a \leq -0.3:\\ \;\;\;\;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}\;a \leq 0.0064:\\ \;\;\;\;x + \mathsf{fma}\left(a, -0.3333333333333333 \cdot {a}^{2} - 1, \frac{t\_5}{t\_2} + \frac{t\_3}{t\_2}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(\frac{t\_5}{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 (fma (cos y) (cos z) t_0))
        (t_3 (* (cos z) (sin y)))
        (t_4 (cos (+ y z)))
        (t_5 (* (cos y) (sin z))))
   (if (<= a -0.3)
     (+
      x
      (- (+ (/ (* (sin z) (cos y)) t_1) (/ (* (sin y) (cos z)) t_4)) (tan a)))
     (if (<= a 0.0064)
       (+
        x
        (fma
         a
         (- (* -0.3333333333333333 (pow a 2.0)) 1.0)
         (+ (/ t_5 t_2) (/ t_3 t_2))))
       (+ x (- (+ (/ t_5 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 = fma(cos(y), cos(z), t_0);
	double t_3 = cos(z) * sin(y);
	double t_4 = cos((y + z));
	double t_5 = cos(y) * sin(z);
	double tmp;
	if (a <= -0.3) {
		tmp = x + ((((sin(z) * cos(y)) / t_1) + ((sin(y) * cos(z)) / t_4)) - tan(a));
	} else if (a <= 0.0064) {
		tmp = x + fma(a, ((-0.3333333333333333 * pow(a, 2.0)) - 1.0), ((t_5 / t_2) + (t_3 / t_2)));
	} else {
		tmp = x + (((t_5 / 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 = fma(cos(y), cos(z), t_0)
	t_3 = Float64(cos(z) * sin(y))
	t_4 = cos(Float64(y + z))
	t_5 = Float64(cos(y) * sin(z))
	tmp = 0.0
	if (a <= -0.3)
		tmp = Float64(x + Float64(Float64(Float64(Float64(sin(z) * cos(y)) / t_1) + Float64(Float64(sin(y) * cos(z)) / t_4)) - tan(a)));
	elseif (a <= 0.0064)
		tmp = Float64(x + fma(a, Float64(Float64(-0.3333333333333333 * (a ^ 2.0)) - 1.0), Float64(Float64(t_5 / t_2) + Float64(t_3 / t_2))));
	else
		tmp = Float64(x + Float64(Float64(Float64(t_5 / 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[Cos[z], $MachinePrecision] + t$95$0), $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[Sin[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.3], 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[a, 0.0064], N[(x + N[(a * N[(N[(-0.3333333333333333 * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] + N[(N[(t$95$5 / t$95$2), $MachinePrecision] + N[(t$95$3 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(t$95$5 / 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 := \mathsf{fma}\left(\cos y, \cos z, t\_0\right)\\
t_3 := \cos z \cdot \sin y\\
t_4 := \cos \left(y + z\right)\\
t_5 := \cos y \cdot \sin z\\
\mathbf{if}\;a \leq -0.3:\\
\;\;\;\;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}\;a \leq 0.0064:\\
\;\;\;\;x + \mathsf{fma}\left(a, -0.3333333333333333 \cdot {a}^{2} - 1, \frac{t\_5}{t\_2} + \frac{t\_3}{t\_2}\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(\left(\frac{t\_5}{t\_4} + \frac{t\_3}{t\_1}\right) - \tan a\right)\\


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

    1. Initial program 79.4%

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

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

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

      \[\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.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{\sin y \cdot \cos z}{\color{blue}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
    9. Applied rewrites80.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)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]

    if -0.299999999999999989 < a < 0.00640000000000000031

    1. Initial program 79.4%

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

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

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

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

      \[\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 0.00640000000000000031 < a

    1. Initial program 79.4%

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

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

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

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

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

      \[\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 4: 90.2% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;\tan a \leq 4 \cdot 10^{-5}:\\
\;\;\;\;x + \mathsf{fma}\left(-1, a, \frac{t\_0}{t\_3} + \frac{t\_4}{t\_3}\right)\\

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


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

    1. Initial program 79.4%

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

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

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

      \[\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(\left(\frac{\color{blue}{\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) \]
    9. Step-by-step derivation
      1. lower-sin.f6480.5

        \[\leadsto x + \left(\left(\frac{\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) \]
    10. Applied rewrites80.5%

      \[\leadsto x + \left(\left(\frac{\color{blue}{\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) \]

    if -2e-3 < (tan.f64 a) < 4.00000000000000033e-5

    1. Initial program 79.4%

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

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

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

      \[\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(-1 \cdot a + \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(-1, \color{blue}{a}, \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(-1, a, \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 rewrites51.8%

      \[\leadsto x + \color{blue}{\mathsf{fma}\left(-1, a, \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.00000000000000033e-5 < (tan.f64 a)

    1. Initial program 79.4%

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

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

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

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

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

      \[\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: 90.1% 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 := \mathsf{fma}\left(\cos z, \cos y, t\_0\right)\\ t_4 := \frac{t\_2}{t\_3}\\ t_5 := \cos y \cdot \sin z\\ \mathbf{if}\;\tan a \leq -5 \cdot 10^{-13}:\\ \;\;\;\;x + \left(\left(\frac{\sin z}{t\_3} + t\_4\right) - \tan a\right)\\ \mathbf{elif}\;\tan a \leq 5 \cdot 10^{-15}:\\ \;\;\;\;x + \left(\frac{t\_5}{t\_1} + \frac{t\_2}{t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(\frac{t\_5}{\cos \left(y + z\right)} + 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 (fma (cos z) (cos y) t_0))
        (t_4 (/ t_2 t_3))
        (t_5 (* (cos y) (sin z))))
   (if (<= (tan a) -5e-13)
     (+ x (- (+ (/ (sin z) t_3) t_4) (tan a)))
     (if (<= (tan a) 5e-15)
       (+ x (+ (/ t_5 t_1) (/ t_2 t_1)))
       (+ x (- (+ (/ t_5 (cos (+ y z))) 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 = fma(cos(z), cos(y), t_0);
	double t_4 = t_2 / t_3;
	double t_5 = cos(y) * sin(z);
	double tmp;
	if (tan(a) <= -5e-13) {
		tmp = x + (((sin(z) / t_3) + t_4) - tan(a));
	} else if (tan(a) <= 5e-15) {
		tmp = x + ((t_5 / t_1) + (t_2 / t_1));
	} else {
		tmp = x + (((t_5 / cos((y + z))) + 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 = fma(cos(z), cos(y), t_0)
	t_4 = Float64(t_2 / t_3)
	t_5 = Float64(cos(y) * sin(z))
	tmp = 0.0
	if (tan(a) <= -5e-13)
		tmp = Float64(x + Float64(Float64(Float64(sin(z) / t_3) + t_4) - tan(a)));
	elseif (tan(a) <= 5e-15)
		tmp = Float64(x + Float64(Float64(t_5 / t_1) + Float64(t_2 / t_1)));
	else
		tmp = Float64(x + Float64(Float64(Float64(t_5 / cos(Float64(y + z))) + 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[(N[Cos[z], $MachinePrecision] * N[Cos[y], $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[Cos[y], $MachinePrecision] * N[Sin[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -5e-13], N[(x + N[(N[(N[(N[Sin[z], $MachinePrecision] / t$95$3), $MachinePrecision] + t$95$4), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 5e-15], 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 / N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$4), $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 := \mathsf{fma}\left(\cos z, \cos y, t\_0\right)\\
t_4 := \frac{t\_2}{t\_3}\\
t_5 := \cos y \cdot \sin z\\
\mathbf{if}\;\tan a \leq -5 \cdot 10^{-13}:\\
\;\;\;\;x + \left(\left(\frac{\sin z}{t\_3} + t\_4\right) - \tan a\right)\\

\mathbf{elif}\;\tan a \leq 5 \cdot 10^{-15}:\\
\;\;\;\;x + \left(\frac{t\_5}{t\_1} + \frac{t\_2}{t\_1}\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(\left(\frac{t\_5}{\cos \left(y + z\right)} + t\_4\right) - \tan a\right)\\


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

    1. Initial program 79.4%

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

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

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

      \[\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(\left(\frac{\color{blue}{\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) \]
    9. Step-by-step derivation
      1. lower-sin.f6480.5

        \[\leadsto x + \left(\left(\frac{\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) \]
    10. Applied rewrites80.5%

      \[\leadsto x + \left(\left(\frac{\color{blue}{\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) \]

    if -4.9999999999999999e-13 < (tan.f64 a) < 4.99999999999999999e-15

    1. Initial program 79.4%

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

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

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

      \[\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 rewrites61.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.99999999999999999e-15 < (tan.f64 a)

    1. Initial program 79.4%

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

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

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

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

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

      \[\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: 90.1% 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^{-13}:\\ \;\;\;\;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^{-15}:\\ \;\;\;\;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-13)
     (+
      x
      (- (+ (/ (* (sin z) (cos y)) t_4) (/ (* (sin y) (cos z)) t_3)) (tan a)))
     (if (<= (tan a) 5e-15)
       (+ 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-13) {
		tmp = x + ((((sin(z) * cos(y)) / t_4) + ((sin(y) * cos(z)) / t_3)) - tan(a));
	} else if (tan(a) <= 5e-15) {
		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-13)
		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-15)
		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-13], 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-15], 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^{-13}:\\
\;\;\;\;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^{-15}:\\
\;\;\;\;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.9999999999999999e-13

    1. Initial program 79.4%

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

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

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

      \[\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.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{\sin y \cdot \cos z}{\color{blue}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
    9. Applied rewrites80.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)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]

    if -4.9999999999999999e-13 < (tan.f64 a) < 4.99999999999999999e-15

    1. Initial program 79.4%

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

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

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

      \[\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 rewrites61.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.99999999999999999e-15 < (tan.f64 a)

    1. Initial program 79.4%

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

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

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

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

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

      \[\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 7: 80.6% 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.4%

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

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

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

    \[\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.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{\sin y \cdot \cos z}{\color{blue}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
  9. Applied rewrites80.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)} + \color{blue}{\frac{\sin y \cdot \cos z}{\cos \left(y + z\right)}}\right) - \tan a\right) \]
  10. Add Preprocessing

Alternative 8: 80.6% 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.4%

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

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

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

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

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

    \[\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 9: 79.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(z + y\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 (cos (+ z 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 = cos((z + y));
	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 + y))
    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 + y));
	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 + y))
	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 = cos(Float64(z + 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
function tmp = code(x, y, z, a)
	t_0 = cos((z + y));
	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[Cos[N[(z + y), $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 \left(z + y\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.4%

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

    \[\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. Add Preprocessing

Alternative 10: 79.8% accurate, 0.4× speedup?

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

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

    \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

Alternative 11: 79.8% accurate, 0.4× speedup?

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

\\
\mathsf{fma}\left(\frac{1}{\cos \left(z + y\right)}, \mathsf{fma}\left(\sin z, \cos y, \sin y \cdot \cos z\right), x - \tan a\right)
\end{array}
Derivation
  1. Initial program 79.4%

    \[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. lift--.f64N/A

      \[\leadsto x + \color{blue}{\left(\tan \left(y + z\right) - \tan a\right)} \]
    3. associate-+r-N/A

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

      \[\leadsto \color{blue}{\left(\tan \left(y + z\right) + x\right)} - \tan a \]
    5. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 79.4% accurate, 0.7× speedup?

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

\\
x + \mathsf{fma}\left(\frac{1}{\cos \left(z + y\right)}, \sin \left(z + y\right), -\tan a\right)
\end{array}
Derivation
  1. Initial program 79.4%

    \[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. lift-tan.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 79.4% 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.4%

    \[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.4

      \[\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.4

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

    \[\leadsto \color{blue}{x - \left(\tan a - \tan \left(z + y\right)\right)} \]
  4. Add Preprocessing

Alternative 14: 59.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y + z \leq -20000000:\\ \;\;\;\;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) -20000000.0)
   (+ 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) <= -20000000.0) {
		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) <= (-20000000.0d0)) 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) <= -20000000.0) {
		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) <= -20000000.0:
		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) <= -20000000.0)
		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) <= -20000000.0)
		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], -20000000.0], 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 -20000000:\\
\;\;\;\;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) < -2e7

    1. Initial program 79.4%

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

        \[\leadsto x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} \]
    4. Applied rewrites50.9%

      \[\leadsto \color{blue}{x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} \]

    if -2e7 < (+.f64 y z)

    1. Initial program 79.4%

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

        \[\leadsto x + \left(\tan \color{blue}{z} - \tan a\right) \]
    4. Recombined 2 regimes into one program.
    5. Add Preprocessing

    Alternative 15: 50.9% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} \end{array} \]
    (FPCore (x y z a) :precision binary64 (+ x (/ (sin (+ y z)) (cos (+ y z)))))
    double code(double x, double y, double z, double a) {
    	return x + (sin((y + z)) / cos((y + z)));
    }
    
    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 + (sin((y + z)) / cos((y + z)))
    end function
    
    public static double code(double x, double y, double z, double a) {
    	return x + (Math.sin((y + z)) / Math.cos((y + z)));
    }
    
    def code(x, y, z, a):
    	return x + (math.sin((y + z)) / math.cos((y + z)))
    
    function code(x, y, z, a)
    	return Float64(x + Float64(sin(Float64(y + z)) / cos(Float64(y + z))))
    end
    
    function tmp = code(x, y, z, a)
    	tmp = x + (sin((y + z)) / cos((y + z)));
    end
    
    code[x_, y_, z_, a_] := N[(x + N[(N[Sin[N[(y + z), $MachinePrecision]], $MachinePrecision] / N[Cos[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}
    \end{array}
    
    Derivation
    1. Initial program 79.4%

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

        \[\leadsto x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} \]
    4. Applied rewrites50.9%

      \[\leadsto \color{blue}{x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} \]
    5. Add Preprocessing

    Alternative 16: 41.5% accurate, 1.8× speedup?

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

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

        \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a}\right) \]
      2. Applied rewrites41.5%

        \[\leadsto \color{blue}{x - \left(a - \tan \left(y + z\right)\right)} \]
      3. Add Preprocessing

      Alternative 17: 31.7% accurate, 1.9× speedup?

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

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

          \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a}\right) \]
        2. Applied rewrites41.5%

          \[\leadsto \color{blue}{x - \left(a - \tan \left(y + z\right)\right)} \]
        3. Taylor expanded in y around 0

          \[\leadsto x - \left(a - \tan \color{blue}{z}\right) \]
        4. Step-by-step derivation
          1. Applied rewrites31.7%

            \[\leadsto x - \left(a - \tan \color{blue}{z}\right) \]
          2. Add Preprocessing

          Alternative 18: 14.8% accurate, 4.5× speedup?

          \[\begin{array}{l} \\ x - \left(a - \left(z + y \cdot \left(1 + y \cdot z\right)\right)\right) \end{array} \]
          (FPCore (x y z a) :precision binary64 (- x (- a (+ z (* y (+ 1.0 (* y z)))))))
          double code(double x, double y, double z, double a) {
          	return x - (a - (z + (y * (1.0 + (y * z)))));
          }
          
          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 - (a - (z + (y * (1.0d0 + (y * z)))))
          end function
          
          public static double code(double x, double y, double z, double a) {
          	return x - (a - (z + (y * (1.0 + (y * z)))));
          }
          
          def code(x, y, z, a):
          	return x - (a - (z + (y * (1.0 + (y * z)))))
          
          function code(x, y, z, a)
          	return Float64(x - Float64(a - Float64(z + Float64(y * Float64(1.0 + Float64(y * z))))))
          end
          
          function tmp = code(x, y, z, a)
          	tmp = x - (a - (z + (y * (1.0 + (y * z)))));
          end
          
          code[x_, y_, z_, a_] := N[(x - N[(a - N[(z + N[(y * N[(1.0 + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          x - \left(a - \left(z + y \cdot \left(1 + y \cdot z\right)\right)\right)
          \end{array}
          
          Derivation
          1. Initial program 79.4%

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

              \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a}\right) \]
            2. Applied rewrites41.5%

              \[\leadsto \color{blue}{x - \left(a - \tan \left(y + z\right)\right)} \]
            3. Taylor expanded in z around 0

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x - \left(a - \mathsf{fma}\left(z, 1 - -1 \cdot \frac{{\sin y}^{2}}{{\cos y}^{2}}, \frac{\sin y}{\cos y}\right)\right) \]
              11. lower-cos.f6427.3

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

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

              \[\leadsto x - \left(a - \left(z + \color{blue}{y \cdot \left(1 + y \cdot z\right)}\right)\right) \]
            7. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto x - \left(a - \left(z + y \cdot \color{blue}{\left(1 + y \cdot z\right)}\right)\right) \]
              2. lower-*.f64N/A

                \[\leadsto x - \left(a - \left(z + y \cdot \left(1 + \color{blue}{y \cdot z}\right)\right)\right) \]
              3. lower-+.f64N/A

                \[\leadsto x - \left(a - \left(z + y \cdot \left(1 + y \cdot \color{blue}{z}\right)\right)\right) \]
              4. lower-*.f6414.8

                \[\leadsto x - \left(a - \left(z + y \cdot \left(1 + y \cdot z\right)\right)\right) \]
            8. Applied rewrites14.8%

              \[\leadsto x - \left(a - \left(z + \color{blue}{y \cdot \left(1 + y \cdot z\right)}\right)\right) \]
            9. Add Preprocessing

            Reproduce

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