tan-example (used to crash)

Percentage Accurate: 79.3% → 99.7%
Time: 12.9s
Alternatives: 20
Speedup: 0.4×

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)\]
\[x + \left(\tan \left(y + z\right) - \tan a\right) \]
(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]
x + \left(\tan \left(y + z\right) - \tan a\right)

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 20 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.3% accurate, 1.0× speedup?

\[x + \left(\tan \left(y + z\right) - \tan a\right) \]
(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]
x + \left(\tan \left(y + z\right) - \tan a\right)

Alternative 1: 99.7% accurate, 0.2× speedup?

\[\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} \]
(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}
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}
Derivation
  1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.7% accurate, 0.2× speedup?

\[\begin{array}{l} 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} \]
(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}
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}
Derivation
  1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\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) \]
    2. lift-*.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y + \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) \]
    3. 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 \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) \]
    4. lift-neg.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y + \sin z \cdot \sin \color{blue}{\left(\mathsf{neg}\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) \]
    5. sin-negN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y + \sin z \cdot \color{blue}{\left(\mathsf{neg}\left(\sin 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) \]
    6. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y + \sin z \cdot \left(\mathsf{neg}\left(\color{blue}{\sin 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) \]
    7. distribute-rgt-neg-outN/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y + \color{blue}{\left(\mathsf{neg}\left(\sin z \cdot \sin 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) \]
    8. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y + \left(\mathsf{neg}\left(\color{blue}{\sin z} \cdot \sin 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. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y + \left(\mathsf{neg}\left(\sin z \cdot \color{blue}{\sin 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. sub-flipN/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}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
    11. 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}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
    12. lower-*.f64N/A

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

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin z \cdot \color{blue}{\sin y}} + \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{\sin z \cdot \cos y}{\cos z \cdot \cos y - \color{blue}{\sin y \cdot \sin z}} + \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. lower-*.f6499.7%

      \[\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}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
  9. Applied rewrites99.7%

    \[\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}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)}\right) - \tan a\right) \]
  10. Step-by-step derivation
    1. lift-fma.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 \left(-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 z \cdot \cos y + \color{blue}{\sin z \cdot \sin \left(-y\right)}}\right) - \tan a\right) \]
    3. 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 \left(-y\right)}}\right) - \tan a\right) \]
    4. lift-neg.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 \sin \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}}\right) - \tan a\right) \]
    5. sin-negN/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}{\left(\mathsf{neg}\left(\sin y\right)\right)}}\right) - \tan a\right) \]
    6. 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 \left(\mathsf{neg}\left(\color{blue}{\sin y}\right)\right)}\right) - \tan a\right) \]
    7. distribute-rgt-neg-outN/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}{\left(\mathsf{neg}\left(\sin z \cdot \sin y\right)\right)}}\right) - \tan a\right) \]
    8. lift-sin.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos z \cdot \cos y + \left(\mathsf{neg}\left(\color{blue}{\sin z} \cdot \sin y\right)\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 y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos z \cdot \cos y + \left(\mathsf{neg}\left(\sin z \cdot \color{blue}{\sin y}\right)\right)}\right) - \tan a\right) \]
    10. sub-flipN/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) \]
    11. 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) \]
    12. lower-*.f64N/A

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

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

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\cos z \cdot \cos y - \sin y \cdot \sin z} + \frac{\cos z \cdot \sin y}{\cos z \cdot \cos y - \sin z \cdot \color{blue}{\sin y}}\right) - \tan a\right) \]
    15. *-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) \]
    16. 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) \]
  11. 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) \]
  12. Add Preprocessing

Alternative 3: 89.9% accurate, 0.2× speedup?

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

\mathbf{elif}\;a \leq 0.105:\\
\;\;\;\;x + \mathsf{fma}\left(a, -0.3333333333333333 \cdot {a}^{2} - 1, \frac{t\_1 \cdot t\_3}{t\_7} + \frac{t\_2}{t\_7}\right)\\

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -0.85999999999999999 or 0.105 < a

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \left(\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.4%

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

      \[\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 -0.85999999999999999 < a < 0.105

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 89.8% accurate, 0.1× speedup?

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

\mathbf{elif}\;\tan a \leq 0.00038:\\
\;\;\;\;x + \mathsf{fma}\left(-1, a, \frac{t\_1 \cdot t\_3}{t\_6} + \frac{t\_2}{t\_6}\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(\left(\frac{t\_3}{t\_0} + t\_7\right) - \tan a\right)\\


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

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \left(\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.4%

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

      \[\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 -5.0000000000000002e-5 < (tan.f64 a) < 3.8000000000000002e-4

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(-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.0%

      \[\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 3.8000000000000002e-4 < (tan.f64 a)

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z}{\cos z}} + \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-/.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z}{\color{blue}{\cos z}} + \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. lower-sin.f64N/A

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

        \[\leadsto x + \left(\left(\frac{\sin z}{\cos z} + \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.4%

      \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z}{\cos z}} + \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: 89.5% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x + \left(\left(\frac{t\_2}{t\_3} + t\_6\right) - \tan a\right)\\


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

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \left(\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.4%

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

      \[\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 -5.0000000000000002e-5 < (tan.f64 a) < 4.9999999999999998e-8

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\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) \]
      2. +-commutativeN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\sin z \cdot \sin \left(-y\right) + \cos z \cdot \cos y}} + \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-*.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\sin z \cdot \sin \left(-y\right)} + \cos z \cdot \cos y} + \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. lower-fma.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\sin z, \sin \left(-y\right), \cos z \cdot \cos 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-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\sin z, \color{blue}{\sin \left(-y\right)}, \cos z \cdot \cos 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-neg.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\sin z, \sin \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}, \cos z \cdot \cos 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. sin-negN/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\sin z, \color{blue}{\mathsf{neg}\left(\sin y\right)}, \cos z \cdot \cos 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-sin.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\sin z, \mathsf{neg}\left(\color{blue}{\sin y}\right), \cos z \cdot \cos 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. lower-neg.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\sin z, \color{blue}{-\sin y}, \cos z \cdot \cos 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. lower-*.f6499.7%

        \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\sin z, -\sin y, \color{blue}{\cos z \cdot \cos 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. Applied rewrites99.7%

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\mathsf{fma}\left(\sin z, -\sin y, \cos z \cdot \cos 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. Step-by-step derivation
      1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\frac{\cos y \cdot \sin z}{-1 \cdot \left(\sin y \cdot \sin z\right) + \cos y \cdot \cos z} + \color{blue}{\frac{\cos z \cdot \sin y}{-1 \cdot \left(\sin y \cdot \sin z\right) + \cos y \cdot \cos z}}\right) \]
    14. Applied rewrites60.6%

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

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

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z}{\cos z}} + \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-/.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z}{\color{blue}{\cos z}} + \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. lower-sin.f64N/A

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

        \[\leadsto x + \left(\left(\frac{\sin z}{\cos z} + \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.4%

      \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z}{\cos z}} + \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: 89.5% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \left(\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.4%

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

      \[\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 -5.0000000000000002e-5 < (tan.f64 a) < 4.9999999999999998e-8

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z}{\cos z}} + \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-/.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z}{\color{blue}{\cos z}} + \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. lower-sin.f64N/A

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

        \[\leadsto x + \left(\left(\frac{\sin z}{\cos z} + \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.4%

      \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z}{\cos z}} + \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: 89.5% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;x + \left(\left(\frac{t\_2}{t\_0} + \frac{t\_7}{t\_6}\right) - \tan a\right)\\


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

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \color{blue}{\frac{\sin y}{\cos y}}\right) - \tan a\right) \]
    9. Step-by-step derivation
      1. 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{\sin y}{\color{blue}{\cos y}}\right) - \tan a\right) \]
      2. 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{\sin y}{\cos \color{blue}{y}}\right) - \tan a\right) \]
      3. lower-cos.f6480.3%

        \[\leadsto x + \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}{\cos y}\right) - \tan a\right) \]
    10. Applied rewrites80.3%

      \[\leadsto 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}{\cos y}}\right) - \tan a\right) \]

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

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z}{\cos z}} + \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-/.f64N/A

        \[\leadsto x + \left(\left(\frac{\sin z}{\color{blue}{\cos z}} + \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. lower-sin.f64N/A

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

        \[\leadsto x + \left(\left(\frac{\sin z}{\cos z} + \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.4%

      \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z}{\cos z}} + \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 8: 80.5% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \cos \left(\mathsf{max}\left(y, z\right)\right)\\ t_1 := \sin \left(\mathsf{max}\left(y, z\right)\right)\\ t_2 := \cos \left(\mathsf{min}\left(y, z\right)\right)\\ x + \left(\left(\frac{t\_1 \cdot t\_2}{\mathsf{fma}\left(t\_0, t\_2, t\_1 \cdot \sin \left(-\mathsf{min}\left(y, z\right)\right)\right)} + \frac{\sin \left(\mathsf{min}\left(y, z\right)\right) \cdot t\_0}{\cos \left(\mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right)\right)}\right) - \tan a\right) \end{array} \]
(FPCore (x y z a)
  :precision binary64
  (let* ((t_0 (cos (fmax y z)))
       (t_1 (sin (fmax y z)))
       (t_2 (cos (fmin y z))))
  (+
   x
   (-
    (+
     (/ (* t_1 t_2) (fma t_0 t_2 (* t_1 (sin (- (fmin y z))))))
     (/ (* (sin (fmin y z)) t_0) (cos (+ (fmin y z) (fmax y z)))))
    (tan a)))))
double code(double x, double y, double z, double a) {
	double t_0 = cos(fmax(y, z));
	double t_1 = sin(fmax(y, z));
	double t_2 = cos(fmin(y, z));
	return x + ((((t_1 * t_2) / fma(t_0, t_2, (t_1 * sin(-fmin(y, z))))) + ((sin(fmin(y, z)) * t_0) / cos((fmin(y, z) + fmax(y, z))))) - tan(a));
}
function code(x, y, z, a)
	t_0 = cos(fmax(y, z))
	t_1 = sin(fmax(y, z))
	t_2 = cos(fmin(y, z))
	return Float64(x + Float64(Float64(Float64(Float64(t_1 * t_2) / fma(t_0, t_2, Float64(t_1 * sin(Float64(-fmin(y, z)))))) + Float64(Float64(sin(fmin(y, z)) * t_0) / cos(Float64(fmin(y, z) + fmax(y, z))))) - tan(a)))
end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[Cos[N[Max[y, z], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[Max[y, z], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[Min[y, z], $MachinePrecision]], $MachinePrecision]}, N[(x + N[(N[(N[(N[(t$95$1 * t$95$2), $MachinePrecision] / N[(t$95$0 * t$95$2 + N[(t$95$1 * N[Sin[(-N[Min[y, z], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sin[N[Min[y, z], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] / N[Cos[N[(N[Min[y, z], $MachinePrecision] + N[Max[y, z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \cos \left(\mathsf{max}\left(y, z\right)\right)\\
t_1 := \sin \left(\mathsf{max}\left(y, z\right)\right)\\
t_2 := \cos \left(\mathsf{min}\left(y, z\right)\right)\\
x + \left(\left(\frac{t\_1 \cdot t\_2}{\mathsf{fma}\left(t\_0, t\_2, t\_1 \cdot \sin \left(-\mathsf{min}\left(y, z\right)\right)\right)} + \frac{\sin \left(\mathsf{min}\left(y, z\right)\right) \cdot t\_0}{\cos \left(\mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right)\right)}\right) - \tan a\right)
\end{array}
Derivation
  1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\cos \color{blue}{\left(z + y\right)}}\right) - \tan a\right) \]
    15. 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(z + y\right)}}\right) - \tan a\right) \]
    16. lift-cos.f6480.4%

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \frac{\sin y \cdot \cos z}{\color{blue}{\cos \left(z + y\right)}}\right) - \tan a\right) \]
    17. 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(z + y\right)}}\right) - \tan a\right) \]
    18. +-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) \]
    19. lower-+.f6480.4%

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

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

Alternative 9: 80.4% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \sin \left(\mathsf{max}\left(y, z\right)\right)\\ t_1 := \cos \left(\mathsf{min}\left(y, z\right)\right)\\ x + \left(\left(\frac{t\_0 \cdot t\_1}{\mathsf{fma}\left(\cos \left(\mathsf{max}\left(y, z\right)\right), t\_1, t\_0 \cdot \sin \left(-\mathsf{min}\left(y, z\right)\right)\right)} + \frac{\sin \left(\mathsf{min}\left(y, z\right)\right)}{t\_1}\right) - \tan a\right) \end{array} \]
(FPCore (x y z a)
  :precision binary64
  (let* ((t_0 (sin (fmax y z))) (t_1 (cos (fmin y z))))
  (+
   x
   (-
    (+
     (/
      (* t_0 t_1)
      (fma (cos (fmax y z)) t_1 (* t_0 (sin (- (fmin y z))))))
     (/ (sin (fmin y z)) t_1))
    (tan a)))))
double code(double x, double y, double z, double a) {
	double t_0 = sin(fmax(y, z));
	double t_1 = cos(fmin(y, z));
	return x + ((((t_0 * t_1) / fma(cos(fmax(y, z)), t_1, (t_0 * sin(-fmin(y, z))))) + (sin(fmin(y, z)) / t_1)) - tan(a));
}
function code(x, y, z, a)
	t_0 = sin(fmax(y, z))
	t_1 = cos(fmin(y, z))
	return Float64(x + Float64(Float64(Float64(Float64(t_0 * t_1) / fma(cos(fmax(y, z)), t_1, Float64(t_0 * sin(Float64(-fmin(y, z)))))) + Float64(sin(fmin(y, z)) / t_1)) - tan(a)))
end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[Sin[N[Max[y, z], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[Min[y, z], $MachinePrecision]], $MachinePrecision]}, N[(x + N[(N[(N[(N[(t$95$0 * t$95$1), $MachinePrecision] / N[(N[Cos[N[Max[y, z], $MachinePrecision]], $MachinePrecision] * t$95$1 + N[(t$95$0 * N[Sin[(-N[Min[y, z], $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[Min[y, z], $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \sin \left(\mathsf{max}\left(y, z\right)\right)\\
t_1 := \cos \left(\mathsf{min}\left(y, z\right)\right)\\
x + \left(\left(\frac{t\_0 \cdot t\_1}{\mathsf{fma}\left(\cos \left(\mathsf{max}\left(y, z\right)\right), t\_1, t\_0 \cdot \sin \left(-\mathsf{min}\left(y, z\right)\right)\right)} + \frac{\sin \left(\mathsf{min}\left(y, z\right)\right)}{t\_1}\right) - \tan a\right)
\end{array}
Derivation
  1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\mathsf{fma}\left(\cos z, \cos y, \sin z \cdot \sin \left(-y\right)\right)} + \color{blue}{\frac{\sin y}{\cos y}}\right) - \tan a\right) \]
  9. Step-by-step derivation
    1. 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{\sin y}{\color{blue}{\cos y}}\right) - \tan a\right) \]
    2. 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{\sin y}{\cos \color{blue}{y}}\right) - \tan a\right) \]
    3. lower-cos.f6480.3%

      \[\leadsto x + \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}{\cos y}\right) - \tan a\right) \]
  10. Applied rewrites80.3%

    \[\leadsto 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}{\cos y}}\right) - \tan a\right) \]
  11. Add Preprocessing

Alternative 10: 80.3% accurate, 0.2× speedup?

\[x + \left(\left(\frac{\sin z}{\cos z} + \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) \]
(FPCore (x y z a)
  :precision binary64
  (+
 x
 (-
  (+
   (/ (sin z) (cos 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 + (((sin(z) / cos(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(sin(z) / cos(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[Sin[z], $MachinePrecision] / N[Cos[z], $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]
x + \left(\left(\frac{\sin z}{\cos z} + \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)
Derivation
  1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z}{\cos z}} + \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-/.f64N/A

      \[\leadsto x + \left(\left(\frac{\sin z}{\color{blue}{\cos z}} + \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. lower-sin.f64N/A

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

      \[\leadsto x + \left(\left(\frac{\sin z}{\cos z} + \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.4%

    \[\leadsto x + \left(\left(\color{blue}{\frac{\sin z}{\cos z}} + \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. Add Preprocessing

Alternative 11: 79.7% accurate, 0.3× speedup?

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

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

    \[\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 \color{blue}{x + \left(\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 \color{blue}{\left(\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) + x} \]
    3. lift--.f64N/A

      \[\leadsto \color{blue}{\left(\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)} + x \]
    4. lift-+.f64N/A

      \[\leadsto \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) + x \]
    5. associate--l+N/A

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

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

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

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

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

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

Alternative 12: 79.7% accurate, 0.4× speedup?

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

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

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

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

Alternative 13: 79.3% accurate, 0.3× speedup?

\[\begin{array}{l} t_0 := \cos \left(\mathsf{min}\left(y, z\right)\right)\\ x + \left(\left(\frac{\sin \left(\mathsf{max}\left(y, z\right)\right) \cdot t\_0}{\cos \left(\mathsf{max}\left(y, z\right) + \mathsf{min}\left(y, z\right)\right)} + \frac{\sin \left(\mathsf{min}\left(y, z\right)\right)}{t\_0}\right) - \tan a\right) \end{array} \]
(FPCore (x y z a)
  :precision binary64
  (let* ((t_0 (cos (fmin y z))))
  (+
   x
   (-
    (+
     (/ (* (sin (fmax y z)) t_0) (cos (+ (fmax y z) (fmin y z))))
     (/ (sin (fmin y z)) t_0))
    (tan a)))))
double code(double x, double y, double z, double a) {
	double t_0 = cos(fmin(y, z));
	return x + ((((sin(fmax(y, z)) * t_0) / cos((fmax(y, z) + fmin(y, z)))) + (sin(fmin(y, z)) / 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(fmin(y, z))
    code = x + ((((sin(fmax(y, z)) * t_0) / cos((fmax(y, z) + fmin(y, z)))) + (sin(fmin(y, z)) / t_0)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
	double t_0 = Math.cos(fmin(y, z));
	return x + ((((Math.sin(fmax(y, z)) * t_0) / Math.cos((fmax(y, z) + fmin(y, z)))) + (Math.sin(fmin(y, z)) / t_0)) - Math.tan(a));
}
def code(x, y, z, a):
	t_0 = math.cos(fmin(y, z))
	return x + ((((math.sin(fmax(y, z)) * t_0) / math.cos((fmax(y, z) + fmin(y, z)))) + (math.sin(fmin(y, z)) / t_0)) - math.tan(a))
function code(x, y, z, a)
	t_0 = cos(fmin(y, z))
	return Float64(x + Float64(Float64(Float64(Float64(sin(fmax(y, z)) * t_0) / cos(Float64(fmax(y, z) + fmin(y, z)))) + Float64(sin(fmin(y, z)) / t_0)) - tan(a)))
end
function tmp = code(x, y, z, a)
	t_0 = cos(min(y, z));
	tmp = x + ((((sin(max(y, z)) * t_0) / cos((max(y, z) + min(y, z)))) + (sin(min(y, z)) / t_0)) - tan(a));
end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[Cos[N[Min[y, z], $MachinePrecision]], $MachinePrecision]}, N[(x + N[(N[(N[(N[(N[Sin[N[Max[y, z], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision] / N[Cos[N[(N[Max[y, z], $MachinePrecision] + N[Min[y, z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[Min[y, z], $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_0 := \cos \left(\mathsf{min}\left(y, z\right)\right)\\
x + \left(\left(\frac{\sin \left(\mathsf{max}\left(y, z\right)\right) \cdot t\_0}{\cos \left(\mathsf{max}\left(y, z\right) + \mathsf{min}\left(y, z\right)\right)} + \frac{\sin \left(\mathsf{min}\left(y, z\right)\right)}{t\_0}\right) - \tan a\right)
\end{array}
Derivation
  1. Initial program 79.3%

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

    \[\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. Taylor expanded in z around 0

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

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

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

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

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

Alternative 14: 68.7% accurate, 0.9× speedup?

\[\begin{array}{l} \mathbf{if}\;\mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right) \leq -0.0001:\\ \;\;\;\;1 \cdot \left(x + \frac{\sin \left(\mathsf{min}\left(y, z\right)\right)}{\cos \left(\mathsf{min}\left(y, z\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\tan \left(\mathsf{max}\left(y, z\right)\right) - \tan a\right)\\ \end{array} \]
(FPCore (x y z a)
  :precision binary64
  (if (<= (+ (fmin y z) (fmax y z)) -0.0001)
  (* 1.0 (+ x (/ (sin (fmin y z)) (cos (fmin y z)))))
  (+ x (- (tan (fmax y z)) (tan a)))))
double code(double x, double y, double z, double a) {
	double tmp;
	if ((fmin(y, z) + fmax(y, z)) <= -0.0001) {
		tmp = 1.0 * (x + (sin(fmin(y, z)) / cos(fmin(y, z))));
	} else {
		tmp = x + (tan(fmax(y, 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 ((fmin(y, z) + fmax(y, z)) <= (-0.0001d0)) then
        tmp = 1.0d0 * (x + (sin(fmin(y, z)) / cos(fmin(y, z))))
    else
        tmp = x + (tan(fmax(y, z)) - tan(a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double a) {
	double tmp;
	if ((fmin(y, z) + fmax(y, z)) <= -0.0001) {
		tmp = 1.0 * (x + (Math.sin(fmin(y, z)) / Math.cos(fmin(y, z))));
	} else {
		tmp = x + (Math.tan(fmax(y, z)) - Math.tan(a));
	}
	return tmp;
}
def code(x, y, z, a):
	tmp = 0
	if (fmin(y, z) + fmax(y, z)) <= -0.0001:
		tmp = 1.0 * (x + (math.sin(fmin(y, z)) / math.cos(fmin(y, z))))
	else:
		tmp = x + (math.tan(fmax(y, z)) - math.tan(a))
	return tmp
function code(x, y, z, a)
	tmp = 0.0
	if (Float64(fmin(y, z) + fmax(y, z)) <= -0.0001)
		tmp = Float64(1.0 * Float64(x + Float64(sin(fmin(y, z)) / cos(fmin(y, z)))));
	else
		tmp = Float64(x + Float64(tan(fmax(y, z)) - tan(a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, a)
	tmp = 0.0;
	if ((min(y, z) + max(y, z)) <= -0.0001)
		tmp = 1.0 * (x + (sin(min(y, z)) / cos(min(y, z))));
	else
		tmp = x + (tan(max(y, z)) - tan(a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, a_] := If[LessEqual[N[(N[Min[y, z], $MachinePrecision] + N[Max[y, z], $MachinePrecision]), $MachinePrecision], -0.0001], N[(1.0 * N[(x + N[(N[Sin[N[Min[y, z], $MachinePrecision]], $MachinePrecision] / N[Cos[N[Min[y, z], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[N[Max[y, z], $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right) \leq -0.0001:\\
\;\;\;\;1 \cdot \left(x + \frac{\sin \left(\mathsf{min}\left(y, z\right)\right)}{\cos \left(\mathsf{min}\left(y, z\right)\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(\tan \left(\mathsf{max}\left(y, z\right)\right) - \tan a\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 y z) < -1e-4

    1. Initial program 79.3%

      \[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. sub-to-multN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \color{blue}{\left(\tan \left(y + z\right) + x\right)} \]
      14. lower-+.f6479.2%

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

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

        \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
      17. lower-+.f6479.2%

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

      \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \left(z + y\right) + x\right)} \]
    4. Taylor expanded in x around inf

      \[\leadsto \color{blue}{1} \cdot \left(\tan \left(z + y\right) + x\right) \]
    5. Step-by-step derivation
      1. Applied rewrites50.3%

        \[\leadsto \color{blue}{1} \cdot \left(\tan \left(z + y\right) + x\right) \]
      2. Taylor expanded in z around 0

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

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

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

          \[\leadsto 1 \cdot \left(x + \frac{\sin y}{\cos \color{blue}{y}}\right) \]
        4. lower-cos.f6440.2%

          \[\leadsto 1 \cdot \left(x + \frac{\sin y}{\cos y}\right) \]
      4. Applied rewrites40.2%

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

      if -1e-4 < (+.f64 y z)

      1. Initial program 79.3%

        \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
      2. Taylor expanded in y around 0

        \[\leadsto x + \left(\tan \color{blue}{z} - \tan a\right) \]
      3. Step-by-step derivation
        1. Applied rewrites60.2%

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

      Alternative 15: 59.7% accurate, 0.8× speedup?

      \[\begin{array}{l} t_0 := \mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right)\\ \mathbf{if}\;t\_0 \leq -0.0001:\\ \;\;\;\;1 \cdot \left(x + \frac{\sin \left(\mathsf{min}\left(y, z\right)\right)}{\cos \left(\mathsf{min}\left(y, z\right)\right)}\right)\\ \mathbf{elif}\;t\_0 \leq 0.002:\\ \;\;\;\;x + \left(\left(\mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right) \cdot \left(1 + \mathsf{max}\left(y, z\right) \cdot \left(\mathsf{min}\left(y, z\right) + 0.3333333333333333 \cdot \mathsf{max}\left(y, z\right)\right)\right)\right) - \tan a\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(\tan \left(\frac{t\_0}{\mathsf{max}\left(y, z\right)} \cdot \mathsf{max}\left(y, z\right)\right) + x\right)\\ \end{array} \]
      (FPCore (x y z a)
        :precision binary64
        (let* ((t_0 (+ (fmin y z) (fmax y z))))
        (if (<= t_0 -0.0001)
          (* 1.0 (+ x (/ (sin (fmin y z)) (cos (fmin y z)))))
          (if (<= t_0 0.002)
            (+
             x
             (-
              (+
               (fmin y z)
               (*
                (fmax y z)
                (+
                 1.0
                 (*
                  (fmax y z)
                  (+ (fmin y z) (* 0.3333333333333333 (fmax y z)))))))
              (tan a)))
            (* 1.0 (+ (tan (* (/ t_0 (fmax y z)) (fmax y z))) x))))))
      double code(double x, double y, double z, double a) {
      	double t_0 = fmin(y, z) + fmax(y, z);
      	double tmp;
      	if (t_0 <= -0.0001) {
      		tmp = 1.0 * (x + (sin(fmin(y, z)) / cos(fmin(y, z))));
      	} else if (t_0 <= 0.002) {
      		tmp = x + ((fmin(y, z) + (fmax(y, z) * (1.0 + (fmax(y, z) * (fmin(y, z) + (0.3333333333333333 * fmax(y, z))))))) - tan(a));
      	} else {
      		tmp = 1.0 * (tan(((t_0 / fmax(y, z)) * fmax(y, z))) + x);
      	}
      	return tmp;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, a)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: a
          real(8) :: t_0
          real(8) :: tmp
          t_0 = fmin(y, z) + fmax(y, z)
          if (t_0 <= (-0.0001d0)) then
              tmp = 1.0d0 * (x + (sin(fmin(y, z)) / cos(fmin(y, z))))
          else if (t_0 <= 0.002d0) then
              tmp = x + ((fmin(y, z) + (fmax(y, z) * (1.0d0 + (fmax(y, z) * (fmin(y, z) + (0.3333333333333333d0 * fmax(y, z))))))) - tan(a))
          else
              tmp = 1.0d0 * (tan(((t_0 / fmax(y, z)) * fmax(y, z))) + x)
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z, double a) {
      	double t_0 = fmin(y, z) + fmax(y, z);
      	double tmp;
      	if (t_0 <= -0.0001) {
      		tmp = 1.0 * (x + (Math.sin(fmin(y, z)) / Math.cos(fmin(y, z))));
      	} else if (t_0 <= 0.002) {
      		tmp = x + ((fmin(y, z) + (fmax(y, z) * (1.0 + (fmax(y, z) * (fmin(y, z) + (0.3333333333333333 * fmax(y, z))))))) - Math.tan(a));
      	} else {
      		tmp = 1.0 * (Math.tan(((t_0 / fmax(y, z)) * fmax(y, z))) + x);
      	}
      	return tmp;
      }
      
      def code(x, y, z, a):
      	t_0 = fmin(y, z) + fmax(y, z)
      	tmp = 0
      	if t_0 <= -0.0001:
      		tmp = 1.0 * (x + (math.sin(fmin(y, z)) / math.cos(fmin(y, z))))
      	elif t_0 <= 0.002:
      		tmp = x + ((fmin(y, z) + (fmax(y, z) * (1.0 + (fmax(y, z) * (fmin(y, z) + (0.3333333333333333 * fmax(y, z))))))) - math.tan(a))
      	else:
      		tmp = 1.0 * (math.tan(((t_0 / fmax(y, z)) * fmax(y, z))) + x)
      	return tmp
      
      function code(x, y, z, a)
      	t_0 = Float64(fmin(y, z) + fmax(y, z))
      	tmp = 0.0
      	if (t_0 <= -0.0001)
      		tmp = Float64(1.0 * Float64(x + Float64(sin(fmin(y, z)) / cos(fmin(y, z)))));
      	elseif (t_0 <= 0.002)
      		tmp = Float64(x + Float64(Float64(fmin(y, z) + Float64(fmax(y, z) * Float64(1.0 + Float64(fmax(y, z) * Float64(fmin(y, z) + Float64(0.3333333333333333 * fmax(y, z))))))) - tan(a)));
      	else
      		tmp = Float64(1.0 * Float64(tan(Float64(Float64(t_0 / fmax(y, z)) * fmax(y, z))) + x));
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z, a)
      	t_0 = min(y, z) + max(y, z);
      	tmp = 0.0;
      	if (t_0 <= -0.0001)
      		tmp = 1.0 * (x + (sin(min(y, z)) / cos(min(y, z))));
      	elseif (t_0 <= 0.002)
      		tmp = x + ((min(y, z) + (max(y, z) * (1.0 + (max(y, z) * (min(y, z) + (0.3333333333333333 * max(y, z))))))) - tan(a));
      	else
      		tmp = 1.0 * (tan(((t_0 / max(y, z)) * max(y, z))) + x);
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Min[y, z], $MachinePrecision] + N[Max[y, z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.0001], N[(1.0 * N[(x + N[(N[Sin[N[Min[y, z], $MachinePrecision]], $MachinePrecision] / N[Cos[N[Min[y, z], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.002], N[(x + N[(N[(N[Min[y, z], $MachinePrecision] + N[(N[Max[y, z], $MachinePrecision] * N[(1.0 + N[(N[Max[y, z], $MachinePrecision] * N[(N[Min[y, z], $MachinePrecision] + N[(0.3333333333333333 * N[Max[y, z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(N[Tan[N[(N[(t$95$0 / N[Max[y, z], $MachinePrecision]), $MachinePrecision] * N[Max[y, z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      t_0 := \mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right)\\
      \mathbf{if}\;t\_0 \leq -0.0001:\\
      \;\;\;\;1 \cdot \left(x + \frac{\sin \left(\mathsf{min}\left(y, z\right)\right)}{\cos \left(\mathsf{min}\left(y, z\right)\right)}\right)\\
      
      \mathbf{elif}\;t\_0 \leq 0.002:\\
      \;\;\;\;x + \left(\left(\mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right) \cdot \left(1 + \mathsf{max}\left(y, z\right) \cdot \left(\mathsf{min}\left(y, z\right) + 0.3333333333333333 \cdot \mathsf{max}\left(y, z\right)\right)\right)\right) - \tan a\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;1 \cdot \left(\tan \left(\frac{t\_0}{\mathsf{max}\left(y, z\right)} \cdot \mathsf{max}\left(y, z\right)\right) + x\right)\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (+.f64 y z) < -1e-4

        1. Initial program 79.3%

          \[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. sub-to-multN/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \color{blue}{\left(\tan \left(y + z\right) + x\right)} \]
          14. lower-+.f6479.2%

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

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

            \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
          17. lower-+.f6479.2%

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

          \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \left(z + y\right) + x\right)} \]
        4. Taylor expanded in x around inf

          \[\leadsto \color{blue}{1} \cdot \left(\tan \left(z + y\right) + x\right) \]
        5. Step-by-step derivation
          1. Applied rewrites50.3%

            \[\leadsto \color{blue}{1} \cdot \left(\tan \left(z + y\right) + x\right) \]
          2. Taylor expanded in z around 0

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

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

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

              \[\leadsto 1 \cdot \left(x + \frac{\sin y}{\cos \color{blue}{y}}\right) \]
            4. lower-cos.f6440.2%

              \[\leadsto 1 \cdot \left(x + \frac{\sin y}{\cos y}\right) \]
          4. Applied rewrites40.2%

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

          if -1e-4 < (+.f64 y z) < 2e-3

          1. Initial program 79.3%

            \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
          2. Taylor expanded in y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + \frac{1}{3} \cdot \color{blue}{z}\right)\right)\right) - \tan a\right) \]
            6. lower-*.f6426.0%

              \[\leadsto x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)\right) - \tan a\right) \]
          7. Applied rewrites26.0%

            \[\leadsto x + \left(\left(y + \color{blue}{z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)}\right) - \tan a\right) \]

          if 2e-3 < (+.f64 y z)

          1. Initial program 79.3%

            \[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. sub-to-multN/A

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \color{blue}{\left(\tan \left(y + z\right) + x\right)} \]
            14. lower-+.f6479.2%

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

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

              \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
            17. lower-+.f6479.2%

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

            \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \left(z + y\right) + x\right)} \]
          4. Taylor expanded in x around inf

            \[\leadsto \color{blue}{1} \cdot \left(\tan \left(z + y\right) + x\right) \]
          5. Step-by-step derivation
            1. Applied rewrites50.3%

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

                \[\leadsto 1 \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
              2. sum-to-multN/A

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

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

                \[\leadsto 1 \cdot \left(\tan \left(\color{blue}{\left(1 + \frac{y}{z}\right)} \cdot z\right) + x\right) \]
              5. lower-unsound-/.f6442.1%

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

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

                \[\leadsto 1 \cdot \left(\tan \left(\color{blue}{\left(\frac{y}{z} + 1\right)} \cdot z\right) + x\right) \]
              8. sum-to-mult-revN/A

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

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

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

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

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

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

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

                \[\leadsto 1 \cdot \left(\tan \left(\frac{\left(1 + \frac{1}{\color{blue}{\frac{y}{z}}}\right) \cdot y}{z} \cdot z\right) + x\right) \]
              16. div-flip-revN/A

                \[\leadsto 1 \cdot \left(\tan \left(\frac{\left(1 + \color{blue}{\frac{z}{y}}\right) \cdot y}{z} \cdot z\right) + x\right) \]
              17. sum-to-mult-revN/A

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

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

                \[\leadsto 1 \cdot \left(\tan \left(\frac{\color{blue}{z + y}}{z} \cdot z\right) + x\right) \]
              20. lower-/.f6442.2%

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

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

                \[\leadsto 1 \cdot \left(\tan \left(\frac{\color{blue}{y + z}}{z} \cdot z\right) + x\right) \]
              23. lower-+.f6442.2%

                \[\leadsto 1 \cdot \left(\tan \left(\frac{\color{blue}{y + z}}{z} \cdot z\right) + x\right) \]
            3. Applied rewrites42.2%

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

          Alternative 16: 59.7% accurate, 0.8× speedup?

          \[\begin{array}{l} t_0 := \mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right)\\ \mathbf{if}\;t\_0 \leq -0.0001:\\ \;\;\;\;1 \cdot \left(\tan \left(\left(\frac{\mathsf{max}\left(y, z\right)}{\mathsf{min}\left(y, z\right)} - -1\right) \cdot \mathsf{min}\left(y, z\right)\right) + x\right)\\ \mathbf{elif}\;t\_0 \leq 0.002:\\ \;\;\;\;x + \left(\left(\mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right) \cdot \left(1 + \mathsf{max}\left(y, z\right) \cdot \left(\mathsf{min}\left(y, z\right) + 0.3333333333333333 \cdot \mathsf{max}\left(y, z\right)\right)\right)\right) - \tan a\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(\tan \left(\frac{t\_0}{\mathsf{max}\left(y, z\right)} \cdot \mathsf{max}\left(y, z\right)\right) + x\right)\\ \end{array} \]
          (FPCore (x y z a)
            :precision binary64
            (let* ((t_0 (+ (fmin y z) (fmax y z))))
            (if (<= t_0 -0.0001)
              (*
               1.0
               (+ (tan (* (- (/ (fmax y z) (fmin y z)) -1.0) (fmin y z))) x))
              (if (<= t_0 0.002)
                (+
                 x
                 (-
                  (+
                   (fmin y z)
                   (*
                    (fmax y z)
                    (+
                     1.0
                     (*
                      (fmax y z)
                      (+ (fmin y z) (* 0.3333333333333333 (fmax y z)))))))
                  (tan a)))
                (* 1.0 (+ (tan (* (/ t_0 (fmax y z)) (fmax y z))) x))))))
          double code(double x, double y, double z, double a) {
          	double t_0 = fmin(y, z) + fmax(y, z);
          	double tmp;
          	if (t_0 <= -0.0001) {
          		tmp = 1.0 * (tan((((fmax(y, z) / fmin(y, z)) - -1.0) * fmin(y, z))) + x);
          	} else if (t_0 <= 0.002) {
          		tmp = x + ((fmin(y, z) + (fmax(y, z) * (1.0 + (fmax(y, z) * (fmin(y, z) + (0.3333333333333333 * fmax(y, z))))))) - tan(a));
          	} else {
          		tmp = 1.0 * (tan(((t_0 / fmax(y, z)) * fmax(y, z))) + x);
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, y, z, a)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: a
              real(8) :: t_0
              real(8) :: tmp
              t_0 = fmin(y, z) + fmax(y, z)
              if (t_0 <= (-0.0001d0)) then
                  tmp = 1.0d0 * (tan((((fmax(y, z) / fmin(y, z)) - (-1.0d0)) * fmin(y, z))) + x)
              else if (t_0 <= 0.002d0) then
                  tmp = x + ((fmin(y, z) + (fmax(y, z) * (1.0d0 + (fmax(y, z) * (fmin(y, z) + (0.3333333333333333d0 * fmax(y, z))))))) - tan(a))
              else
                  tmp = 1.0d0 * (tan(((t_0 / fmax(y, z)) * fmax(y, z))) + x)
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double a) {
          	double t_0 = fmin(y, z) + fmax(y, z);
          	double tmp;
          	if (t_0 <= -0.0001) {
          		tmp = 1.0 * (Math.tan((((fmax(y, z) / fmin(y, z)) - -1.0) * fmin(y, z))) + x);
          	} else if (t_0 <= 0.002) {
          		tmp = x + ((fmin(y, z) + (fmax(y, z) * (1.0 + (fmax(y, z) * (fmin(y, z) + (0.3333333333333333 * fmax(y, z))))))) - Math.tan(a));
          	} else {
          		tmp = 1.0 * (Math.tan(((t_0 / fmax(y, z)) * fmax(y, z))) + x);
          	}
          	return tmp;
          }
          
          def code(x, y, z, a):
          	t_0 = fmin(y, z) + fmax(y, z)
          	tmp = 0
          	if t_0 <= -0.0001:
          		tmp = 1.0 * (math.tan((((fmax(y, z) / fmin(y, z)) - -1.0) * fmin(y, z))) + x)
          	elif t_0 <= 0.002:
          		tmp = x + ((fmin(y, z) + (fmax(y, z) * (1.0 + (fmax(y, z) * (fmin(y, z) + (0.3333333333333333 * fmax(y, z))))))) - math.tan(a))
          	else:
          		tmp = 1.0 * (math.tan(((t_0 / fmax(y, z)) * fmax(y, z))) + x)
          	return tmp
          
          function code(x, y, z, a)
          	t_0 = Float64(fmin(y, z) + fmax(y, z))
          	tmp = 0.0
          	if (t_0 <= -0.0001)
          		tmp = Float64(1.0 * Float64(tan(Float64(Float64(Float64(fmax(y, z) / fmin(y, z)) - -1.0) * fmin(y, z))) + x));
          	elseif (t_0 <= 0.002)
          		tmp = Float64(x + Float64(Float64(fmin(y, z) + Float64(fmax(y, z) * Float64(1.0 + Float64(fmax(y, z) * Float64(fmin(y, z) + Float64(0.3333333333333333 * fmax(y, z))))))) - tan(a)));
          	else
          		tmp = Float64(1.0 * Float64(tan(Float64(Float64(t_0 / fmax(y, z)) * fmax(y, z))) + x));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, a)
          	t_0 = min(y, z) + max(y, z);
          	tmp = 0.0;
          	if (t_0 <= -0.0001)
          		tmp = 1.0 * (tan((((max(y, z) / min(y, z)) - -1.0) * min(y, z))) + x);
          	elseif (t_0 <= 0.002)
          		tmp = x + ((min(y, z) + (max(y, z) * (1.0 + (max(y, z) * (min(y, z) + (0.3333333333333333 * max(y, z))))))) - tan(a));
          	else
          		tmp = 1.0 * (tan(((t_0 / max(y, z)) * max(y, z))) + x);
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Min[y, z], $MachinePrecision] + N[Max[y, z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.0001], N[(1.0 * N[(N[Tan[N[(N[(N[(N[Max[y, z], $MachinePrecision] / N[Min[y, z], $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision] * N[Min[y, z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.002], N[(x + N[(N[(N[Min[y, z], $MachinePrecision] + N[(N[Max[y, z], $MachinePrecision] * N[(1.0 + N[(N[Max[y, z], $MachinePrecision] * N[(N[Min[y, z], $MachinePrecision] + N[(0.3333333333333333 * N[Max[y, z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(N[Tan[N[(N[(t$95$0 / N[Max[y, z], $MachinePrecision]), $MachinePrecision] * N[Max[y, z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          t_0 := \mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right)\\
          \mathbf{if}\;t\_0 \leq -0.0001:\\
          \;\;\;\;1 \cdot \left(\tan \left(\left(\frac{\mathsf{max}\left(y, z\right)}{\mathsf{min}\left(y, z\right)} - -1\right) \cdot \mathsf{min}\left(y, z\right)\right) + x\right)\\
          
          \mathbf{elif}\;t\_0 \leq 0.002:\\
          \;\;\;\;x + \left(\left(\mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right) \cdot \left(1 + \mathsf{max}\left(y, z\right) \cdot \left(\mathsf{min}\left(y, z\right) + 0.3333333333333333 \cdot \mathsf{max}\left(y, z\right)\right)\right)\right) - \tan a\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;1 \cdot \left(\tan \left(\frac{t\_0}{\mathsf{max}\left(y, z\right)} \cdot \mathsf{max}\left(y, z\right)\right) + x\right)\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (+.f64 y z) < -1e-4

            1. Initial program 79.3%

              \[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. sub-to-multN/A

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \color{blue}{\left(\tan \left(y + z\right) + x\right)} \]
              14. lower-+.f6479.2%

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

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

                \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
              17. lower-+.f6479.2%

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

              \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \left(z + y\right) + x\right)} \]
            4. Taylor expanded in x around inf

              \[\leadsto \color{blue}{1} \cdot \left(\tan \left(z + y\right) + x\right) \]
            5. Step-by-step derivation
              1. Applied rewrites50.3%

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

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

                  \[\leadsto 1 \cdot \left(\tan \color{blue}{\left(y + z\right)} + x\right) \]
                3. sum-to-mult-revN/A

                  \[\leadsto 1 \cdot \left(\tan \color{blue}{\left(\left(1 + \frac{z}{y}\right) \cdot y\right)} + x\right) \]
                4. div-flip-revN/A

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

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

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

                  \[\leadsto 1 \cdot \left(\tan \left(\color{blue}{\left(1 + \frac{1}{\frac{y}{z}}\right)} \cdot y\right) + x\right) \]
                8. lower-*.f6441.3%

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

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

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

                  \[\leadsto 1 \cdot \left(\tan \left(\color{blue}{\left(\frac{1}{\frac{y}{z}} - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot y\right) + x\right) \]
                12. metadata-evalN/A

                  \[\leadsto 1 \cdot \left(\tan \left(\left(\frac{1}{\frac{y}{z}} - \color{blue}{-1}\right) \cdot y\right) + x\right) \]
                13. lower--.f6441.3%

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

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

                  \[\leadsto 1 \cdot \left(\tan \left(\left(\frac{1}{\color{blue}{\frac{y}{z}}} - -1\right) \cdot y\right) + x\right) \]
                16. div-flip-revN/A

                  \[\leadsto 1 \cdot \left(\tan \left(\left(\color{blue}{\frac{z}{y}} - -1\right) \cdot y\right) + x\right) \]
                17. lower-/.f6442.3%

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

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

              if -1e-4 < (+.f64 y z) < 2e-3

              1. Initial program 79.3%

                \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
              2. Taylor expanded in y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + \frac{1}{3} \cdot \color{blue}{z}\right)\right)\right) - \tan a\right) \]
                6. lower-*.f6426.0%

                  \[\leadsto x + \left(\left(y + z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)\right) - \tan a\right) \]
              7. Applied rewrites26.0%

                \[\leadsto x + \left(\left(y + \color{blue}{z \cdot \left(1 + z \cdot \left(y + 0.3333333333333333 \cdot z\right)\right)}\right) - \tan a\right) \]

              if 2e-3 < (+.f64 y z)

              1. Initial program 79.3%

                \[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. sub-to-multN/A

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \color{blue}{\left(\tan \left(y + z\right) + x\right)} \]
                14. lower-+.f6479.2%

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

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

                  \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
                17. lower-+.f6479.2%

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

                \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \left(z + y\right) + x\right)} \]
              4. Taylor expanded in x around inf

                \[\leadsto \color{blue}{1} \cdot \left(\tan \left(z + y\right) + x\right) \]
              5. Step-by-step derivation
                1. Applied rewrites50.3%

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

                    \[\leadsto 1 \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
                  2. sum-to-multN/A

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

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

                    \[\leadsto 1 \cdot \left(\tan \left(\color{blue}{\left(1 + \frac{y}{z}\right)} \cdot z\right) + x\right) \]
                  5. lower-unsound-/.f6442.1%

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

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

                    \[\leadsto 1 \cdot \left(\tan \left(\color{blue}{\left(\frac{y}{z} + 1\right)} \cdot z\right) + x\right) \]
                  8. sum-to-mult-revN/A

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

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

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

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

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

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

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

                    \[\leadsto 1 \cdot \left(\tan \left(\frac{\left(1 + \frac{1}{\color{blue}{\frac{y}{z}}}\right) \cdot y}{z} \cdot z\right) + x\right) \]
                  16. div-flip-revN/A

                    \[\leadsto 1 \cdot \left(\tan \left(\frac{\left(1 + \color{blue}{\frac{z}{y}}\right) \cdot y}{z} \cdot z\right) + x\right) \]
                  17. sum-to-mult-revN/A

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

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

                    \[\leadsto 1 \cdot \left(\tan \left(\frac{\color{blue}{z + y}}{z} \cdot z\right) + x\right) \]
                  20. lower-/.f6442.2%

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

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

                    \[\leadsto 1 \cdot \left(\tan \left(\frac{\color{blue}{y + z}}{z} \cdot z\right) + x\right) \]
                  23. lower-+.f6442.2%

                    \[\leadsto 1 \cdot \left(\tan \left(\frac{\color{blue}{y + z}}{z} \cdot z\right) + x\right) \]
                3. Applied rewrites42.2%

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

              Alternative 17: 59.7% accurate, 0.9× speedup?

              \[\begin{array}{l} t_0 := \mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right)\\ \mathbf{if}\;t\_0 \leq -0.0001:\\ \;\;\;\;1 \cdot \left(\tan \left(\left(\frac{\mathsf{max}\left(y, z\right)}{\mathsf{min}\left(y, z\right)} - -1\right) \cdot \mathsf{min}\left(y, z\right)\right) + x\right)\\ \mathbf{elif}\;t\_0 \leq 0.002:\\ \;\;\;\;x + \left(\left(\mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right) \cdot \left(1 + \mathsf{min}\left(y, z\right) \cdot \mathsf{max}\left(y, z\right)\right)\right) - \tan a\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(\tan \left(\frac{t\_0}{\mathsf{max}\left(y, z\right)} \cdot \mathsf{max}\left(y, z\right)\right) + x\right)\\ \end{array} \]
              (FPCore (x y z a)
                :precision binary64
                (let* ((t_0 (+ (fmin y z) (fmax y z))))
                (if (<= t_0 -0.0001)
                  (*
                   1.0
                   (+ (tan (* (- (/ (fmax y z) (fmin y z)) -1.0) (fmin y z))) x))
                  (if (<= t_0 0.002)
                    (+
                     x
                     (-
                      (+
                       (fmin y z)
                       (* (fmax y z) (+ 1.0 (* (fmin y z) (fmax y z)))))
                      (tan a)))
                    (* 1.0 (+ (tan (* (/ t_0 (fmax y z)) (fmax y z))) x))))))
              double code(double x, double y, double z, double a) {
              	double t_0 = fmin(y, z) + fmax(y, z);
              	double tmp;
              	if (t_0 <= -0.0001) {
              		tmp = 1.0 * (tan((((fmax(y, z) / fmin(y, z)) - -1.0) * fmin(y, z))) + x);
              	} else if (t_0 <= 0.002) {
              		tmp = x + ((fmin(y, z) + (fmax(y, z) * (1.0 + (fmin(y, z) * fmax(y, z))))) - tan(a));
              	} else {
              		tmp = 1.0 * (tan(((t_0 / fmax(y, z)) * fmax(y, z))) + x);
              	}
              	return tmp;
              }
              
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(x, y, z, a)
              use fmin_fmax_functions
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: a
                  real(8) :: t_0
                  real(8) :: tmp
                  t_0 = fmin(y, z) + fmax(y, z)
                  if (t_0 <= (-0.0001d0)) then
                      tmp = 1.0d0 * (tan((((fmax(y, z) / fmin(y, z)) - (-1.0d0)) * fmin(y, z))) + x)
                  else if (t_0 <= 0.002d0) then
                      tmp = x + ((fmin(y, z) + (fmax(y, z) * (1.0d0 + (fmin(y, z) * fmax(y, z))))) - tan(a))
                  else
                      tmp = 1.0d0 * (tan(((t_0 / fmax(y, z)) * fmax(y, z))) + x)
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z, double a) {
              	double t_0 = fmin(y, z) + fmax(y, z);
              	double tmp;
              	if (t_0 <= -0.0001) {
              		tmp = 1.0 * (Math.tan((((fmax(y, z) / fmin(y, z)) - -1.0) * fmin(y, z))) + x);
              	} else if (t_0 <= 0.002) {
              		tmp = x + ((fmin(y, z) + (fmax(y, z) * (1.0 + (fmin(y, z) * fmax(y, z))))) - Math.tan(a));
              	} else {
              		tmp = 1.0 * (Math.tan(((t_0 / fmax(y, z)) * fmax(y, z))) + x);
              	}
              	return tmp;
              }
              
              def code(x, y, z, a):
              	t_0 = fmin(y, z) + fmax(y, z)
              	tmp = 0
              	if t_0 <= -0.0001:
              		tmp = 1.0 * (math.tan((((fmax(y, z) / fmin(y, z)) - -1.0) * fmin(y, z))) + x)
              	elif t_0 <= 0.002:
              		tmp = x + ((fmin(y, z) + (fmax(y, z) * (1.0 + (fmin(y, z) * fmax(y, z))))) - math.tan(a))
              	else:
              		tmp = 1.0 * (math.tan(((t_0 / fmax(y, z)) * fmax(y, z))) + x)
              	return tmp
              
              function code(x, y, z, a)
              	t_0 = Float64(fmin(y, z) + fmax(y, z))
              	tmp = 0.0
              	if (t_0 <= -0.0001)
              		tmp = Float64(1.0 * Float64(tan(Float64(Float64(Float64(fmax(y, z) / fmin(y, z)) - -1.0) * fmin(y, z))) + x));
              	elseif (t_0 <= 0.002)
              		tmp = Float64(x + Float64(Float64(fmin(y, z) + Float64(fmax(y, z) * Float64(1.0 + Float64(fmin(y, z) * fmax(y, z))))) - tan(a)));
              	else
              		tmp = Float64(1.0 * Float64(tan(Float64(Float64(t_0 / fmax(y, z)) * fmax(y, z))) + x));
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z, a)
              	t_0 = min(y, z) + max(y, z);
              	tmp = 0.0;
              	if (t_0 <= -0.0001)
              		tmp = 1.0 * (tan((((max(y, z) / min(y, z)) - -1.0) * min(y, z))) + x);
              	elseif (t_0 <= 0.002)
              		tmp = x + ((min(y, z) + (max(y, z) * (1.0 + (min(y, z) * max(y, z))))) - tan(a));
              	else
              		tmp = 1.0 * (tan(((t_0 / max(y, z)) * max(y, z))) + x);
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Min[y, z], $MachinePrecision] + N[Max[y, z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.0001], N[(1.0 * N[(N[Tan[N[(N[(N[(N[Max[y, z], $MachinePrecision] / N[Min[y, z], $MachinePrecision]), $MachinePrecision] - -1.0), $MachinePrecision] * N[Min[y, z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.002], N[(x + N[(N[(N[Min[y, z], $MachinePrecision] + N[(N[Max[y, z], $MachinePrecision] * N[(1.0 + N[(N[Min[y, z], $MachinePrecision] * N[Max[y, z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(N[Tan[N[(N[(t$95$0 / N[Max[y, z], $MachinePrecision]), $MachinePrecision] * N[Max[y, z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]]
              
              \begin{array}{l}
              t_0 := \mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right)\\
              \mathbf{if}\;t\_0 \leq -0.0001:\\
              \;\;\;\;1 \cdot \left(\tan \left(\left(\frac{\mathsf{max}\left(y, z\right)}{\mathsf{min}\left(y, z\right)} - -1\right) \cdot \mathsf{min}\left(y, z\right)\right) + x\right)\\
              
              \mathbf{elif}\;t\_0 \leq 0.002:\\
              \;\;\;\;x + \left(\left(\mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right) \cdot \left(1 + \mathsf{min}\left(y, z\right) \cdot \mathsf{max}\left(y, z\right)\right)\right) - \tan a\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;1 \cdot \left(\tan \left(\frac{t\_0}{\mathsf{max}\left(y, z\right)} \cdot \mathsf{max}\left(y, z\right)\right) + x\right)\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if (+.f64 y z) < -1e-4

                1. Initial program 79.3%

                  \[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. sub-to-multN/A

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \color{blue}{\left(\tan \left(y + z\right) + x\right)} \]
                  14. lower-+.f6479.2%

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

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

                    \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
                  17. lower-+.f6479.2%

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

                  \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \left(z + y\right) + x\right)} \]
                4. Taylor expanded in x around inf

                  \[\leadsto \color{blue}{1} \cdot \left(\tan \left(z + y\right) + x\right) \]
                5. Step-by-step derivation
                  1. Applied rewrites50.3%

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

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

                      \[\leadsto 1 \cdot \left(\tan \color{blue}{\left(y + z\right)} + x\right) \]
                    3. sum-to-mult-revN/A

                      \[\leadsto 1 \cdot \left(\tan \color{blue}{\left(\left(1 + \frac{z}{y}\right) \cdot y\right)} + x\right) \]
                    4. div-flip-revN/A

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

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

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

                      \[\leadsto 1 \cdot \left(\tan \left(\color{blue}{\left(1 + \frac{1}{\frac{y}{z}}\right)} \cdot y\right) + x\right) \]
                    8. lower-*.f6441.3%

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

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

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

                      \[\leadsto 1 \cdot \left(\tan \left(\color{blue}{\left(\frac{1}{\frac{y}{z}} - \left(\mathsf{neg}\left(1\right)\right)\right)} \cdot y\right) + x\right) \]
                    12. metadata-evalN/A

                      \[\leadsto 1 \cdot \left(\tan \left(\left(\frac{1}{\frac{y}{z}} - \color{blue}{-1}\right) \cdot y\right) + x\right) \]
                    13. lower--.f6441.3%

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

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

                      \[\leadsto 1 \cdot \left(\tan \left(\left(\frac{1}{\color{blue}{\frac{y}{z}}} - -1\right) \cdot y\right) + x\right) \]
                    16. div-flip-revN/A

                      \[\leadsto 1 \cdot \left(\tan \left(\left(\color{blue}{\frac{z}{y}} - -1\right) \cdot y\right) + x\right) \]
                    17. lower-/.f6442.3%

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

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

                  if -1e-4 < (+.f64 y z) < 2e-3

                  1. Initial program 79.3%

                    \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                  2. Taylor expanded in y around 0

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

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

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

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \color{blue}{\frac{{\sin z}^{2}}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    4. lower-/.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{\color{blue}{{\cos z}^{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    5. lower-pow.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\color{blue}{\cos z}}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    6. lower-sin.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos \color{blue}{z}}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    7. lower-pow.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{\color{blue}{2}}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    8. lower-cos.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    9. lower-/.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    10. lower-sin.f64N/A

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                    11. lower-cos.f6450.8%

                      \[\leadsto x + \left(\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right) - \tan a\right) \]
                  4. Applied rewrites50.8%

                    \[\leadsto x + \left(\color{blue}{\mathsf{fma}\left(y, 1 - -1 \cdot \frac{{\sin z}^{2}}{{\cos z}^{2}}, \frac{\sin z}{\cos z}\right)} - \tan a\right) \]
                  5. Taylor expanded in z around 0

                    \[\leadsto x + \left(\left(y + \color{blue}{z \cdot \left(1 + y \cdot z\right)}\right) - \tan a\right) \]
                  6. Step-by-step derivation
                    1. lower-+.f64N/A

                      \[\leadsto x + \left(\left(y + z \cdot \color{blue}{\left(1 + y \cdot z\right)}\right) - \tan a\right) \]
                    2. lower-*.f64N/A

                      \[\leadsto x + \left(\left(y + z \cdot \left(1 + \color{blue}{y \cdot z}\right)\right) - \tan a\right) \]
                    3. lower-+.f64N/A

                      \[\leadsto x + \left(\left(y + z \cdot \left(1 + y \cdot \color{blue}{z}\right)\right) - \tan a\right) \]
                    4. lower-*.f6426.1%

                      \[\leadsto x + \left(\left(y + z \cdot \left(1 + y \cdot z\right)\right) - \tan a\right) \]
                  7. Applied rewrites26.1%

                    \[\leadsto x + \left(\left(y + \color{blue}{z \cdot \left(1 + y \cdot z\right)}\right) - \tan a\right) \]

                  if 2e-3 < (+.f64 y z)

                  1. Initial program 79.3%

                    \[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. sub-to-multN/A

                      \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{x + \tan \left(y + z\right)}\right) \cdot \left(x + \tan \left(y + z\right)\right)} \]
                    5. lower-unsound-*.f64N/A

                      \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{x + \tan \left(y + z\right)}\right) \cdot \left(x + \tan \left(y + z\right)\right)} \]
                    6. lower-unsound--.f64N/A

                      \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{x + \tan \left(y + z\right)}\right)} \cdot \left(x + \tan \left(y + z\right)\right) \]
                    7. lower-unsound-/.f64N/A

                      \[\leadsto \left(1 - \color{blue}{\frac{\tan a}{x + \tan \left(y + z\right)}}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                    8. +-commutativeN/A

                      \[\leadsto \left(1 - \frac{\tan a}{\color{blue}{\tan \left(y + z\right) + x}}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                    9. lower-+.f64N/A

                      \[\leadsto \left(1 - \frac{\tan a}{\color{blue}{\tan \left(y + z\right) + x}}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                    10. lift-+.f64N/A

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \color{blue}{\left(y + z\right)} + x}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                    11. +-commutativeN/A

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \color{blue}{\left(z + y\right)} + x}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                    12. lower-+.f64N/A

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \color{blue}{\left(z + y\right)} + x}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                    13. +-commutativeN/A

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \color{blue}{\left(\tan \left(y + z\right) + x\right)} \]
                    14. lower-+.f6479.2%

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \color{blue}{\left(\tan \left(y + z\right) + x\right)} \]
                    15. lift-+.f64N/A

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(y + z\right)} + x\right) \]
                    16. +-commutativeN/A

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
                    17. lower-+.f6479.2%

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
                  3. Applied rewrites79.2%

                    \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \left(z + y\right) + x\right)} \]
                  4. Taylor expanded in x around inf

                    \[\leadsto \color{blue}{1} \cdot \left(\tan \left(z + y\right) + x\right) \]
                  5. Step-by-step derivation
                    1. Applied rewrites50.3%

                      \[\leadsto \color{blue}{1} \cdot \left(\tan \left(z + y\right) + x\right) \]
                    2. Step-by-step derivation
                      1. lift-+.f64N/A

                        \[\leadsto 1 \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
                      2. sum-to-multN/A

                        \[\leadsto 1 \cdot \left(\tan \color{blue}{\left(\left(1 + \frac{y}{z}\right) \cdot z\right)} + x\right) \]
                      3. lower-unsound-*.f64N/A

                        \[\leadsto 1 \cdot \left(\tan \color{blue}{\left(\left(1 + \frac{y}{z}\right) \cdot z\right)} + x\right) \]
                      4. lower-unsound-+.f64N/A

                        \[\leadsto 1 \cdot \left(\tan \left(\color{blue}{\left(1 + \frac{y}{z}\right)} \cdot z\right) + x\right) \]
                      5. lower-unsound-/.f6442.1%

                        \[\leadsto 1 \cdot \left(\tan \left(\left(1 + \color{blue}{\frac{y}{z}}\right) \cdot z\right) + x\right) \]
                      6. lower-+.f64N/A

                        \[\leadsto 1 \cdot \left(\tan \left(\color{blue}{\left(1 + \frac{y}{z}\right)} \cdot z\right) + x\right) \]
                      7. +-commutativeN/A

                        \[\leadsto 1 \cdot \left(\tan \left(\color{blue}{\left(\frac{y}{z} + 1\right)} \cdot z\right) + x\right) \]
                      8. sum-to-mult-revN/A

                        \[\leadsto 1 \cdot \left(\tan \left(\color{blue}{\left(\left(1 + \frac{1}{\frac{y}{z}}\right) \cdot \frac{y}{z}\right)} \cdot z\right) + x\right) \]
                      9. lift-/.f64N/A

                        \[\leadsto 1 \cdot \left(\tan \left(\left(\left(1 + \color{blue}{\frac{1}{\frac{y}{z}}}\right) \cdot \frac{y}{z}\right) \cdot z\right) + x\right) \]
                      10. lift-+.f64N/A

                        \[\leadsto 1 \cdot \left(\tan \left(\left(\color{blue}{\left(1 + \frac{1}{\frac{y}{z}}\right)} \cdot \frac{y}{z}\right) \cdot z\right) + x\right) \]
                      11. lift-/.f64N/A

                        \[\leadsto 1 \cdot \left(\tan \left(\left(\left(1 + \frac{1}{\frac{y}{z}}\right) \cdot \color{blue}{\frac{y}{z}}\right) \cdot z\right) + x\right) \]
                      12. associate-*r/N/A

                        \[\leadsto 1 \cdot \left(\tan \left(\color{blue}{\frac{\left(1 + \frac{1}{\frac{y}{z}}\right) \cdot y}{z}} \cdot z\right) + x\right) \]
                      13. lift-+.f64N/A

                        \[\leadsto 1 \cdot \left(\tan \left(\frac{\color{blue}{\left(1 + \frac{1}{\frac{y}{z}}\right)} \cdot y}{z} \cdot z\right) + x\right) \]
                      14. lift-/.f64N/A

                        \[\leadsto 1 \cdot \left(\tan \left(\frac{\left(1 + \color{blue}{\frac{1}{\frac{y}{z}}}\right) \cdot y}{z} \cdot z\right) + x\right) \]
                      15. lift-/.f64N/A

                        \[\leadsto 1 \cdot \left(\tan \left(\frac{\left(1 + \frac{1}{\color{blue}{\frac{y}{z}}}\right) \cdot y}{z} \cdot z\right) + x\right) \]
                      16. div-flip-revN/A

                        \[\leadsto 1 \cdot \left(\tan \left(\frac{\left(1 + \color{blue}{\frac{z}{y}}\right) \cdot y}{z} \cdot z\right) + x\right) \]
                      17. sum-to-mult-revN/A

                        \[\leadsto 1 \cdot \left(\tan \left(\frac{\color{blue}{y + z}}{z} \cdot z\right) + x\right) \]
                      18. +-commutativeN/A

                        \[\leadsto 1 \cdot \left(\tan \left(\frac{\color{blue}{z + y}}{z} \cdot z\right) + x\right) \]
                      19. lift-+.f64N/A

                        \[\leadsto 1 \cdot \left(\tan \left(\frac{\color{blue}{z + y}}{z} \cdot z\right) + x\right) \]
                      20. lower-/.f6442.2%

                        \[\leadsto 1 \cdot \left(\tan \left(\color{blue}{\frac{z + y}{z}} \cdot z\right) + x\right) \]
                      21. lift-+.f64N/A

                        \[\leadsto 1 \cdot \left(\tan \left(\frac{\color{blue}{z + y}}{z} \cdot z\right) + x\right) \]
                      22. +-commutativeN/A

                        \[\leadsto 1 \cdot \left(\tan \left(\frac{\color{blue}{y + z}}{z} \cdot z\right) + x\right) \]
                      23. lower-+.f6442.2%

                        \[\leadsto 1 \cdot \left(\tan \left(\frac{\color{blue}{y + z}}{z} \cdot z\right) + x\right) \]
                    3. Applied rewrites42.2%

                      \[\leadsto 1 \cdot \left(\tan \color{blue}{\left(\frac{y + z}{z} \cdot z\right)} + x\right) \]
                  6. Recombined 3 regimes into one program.
                  7. Add Preprocessing

                  Alternative 18: 50.3% accurate, 1.8× speedup?

                  \[1 \cdot \left(\tan \left(z + y\right) + x\right) \]
                  (FPCore (x y z a)
                    :precision binary64
                    (* 1.0 (+ (tan (+ z y)) x)))
                  double code(double x, double y, double z, double a) {
                  	return 1.0 * (tan((z + y)) + x);
                  }
                  
                  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 = 1.0d0 * (tan((z + y)) + x)
                  end function
                  
                  public static double code(double x, double y, double z, double a) {
                  	return 1.0 * (Math.tan((z + y)) + x);
                  }
                  
                  def code(x, y, z, a):
                  	return 1.0 * (math.tan((z + y)) + x)
                  
                  function code(x, y, z, a)
                  	return Float64(1.0 * Float64(tan(Float64(z + y)) + x))
                  end
                  
                  function tmp = code(x, y, z, a)
                  	tmp = 1.0 * (tan((z + y)) + x);
                  end
                  
                  code[x_, y_, z_, a_] := N[(1.0 * N[(N[Tan[N[(z + y), $MachinePrecision]], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]
                  
                  1 \cdot \left(\tan \left(z + y\right) + x\right)
                  
                  Derivation
                  1. Initial program 79.3%

                    \[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. sub-to-multN/A

                      \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{x + \tan \left(y + z\right)}\right) \cdot \left(x + \tan \left(y + z\right)\right)} \]
                    5. lower-unsound-*.f64N/A

                      \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{x + \tan \left(y + z\right)}\right) \cdot \left(x + \tan \left(y + z\right)\right)} \]
                    6. lower-unsound--.f64N/A

                      \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{x + \tan \left(y + z\right)}\right)} \cdot \left(x + \tan \left(y + z\right)\right) \]
                    7. lower-unsound-/.f64N/A

                      \[\leadsto \left(1 - \color{blue}{\frac{\tan a}{x + \tan \left(y + z\right)}}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                    8. +-commutativeN/A

                      \[\leadsto \left(1 - \frac{\tan a}{\color{blue}{\tan \left(y + z\right) + x}}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                    9. lower-+.f64N/A

                      \[\leadsto \left(1 - \frac{\tan a}{\color{blue}{\tan \left(y + z\right) + x}}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                    10. lift-+.f64N/A

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \color{blue}{\left(y + z\right)} + x}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                    11. +-commutativeN/A

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \color{blue}{\left(z + y\right)} + x}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                    12. lower-+.f64N/A

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \color{blue}{\left(z + y\right)} + x}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                    13. +-commutativeN/A

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \color{blue}{\left(\tan \left(y + z\right) + x\right)} \]
                    14. lower-+.f6479.2%

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \color{blue}{\left(\tan \left(y + z\right) + x\right)} \]
                    15. lift-+.f64N/A

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(y + z\right)} + x\right) \]
                    16. +-commutativeN/A

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
                    17. lower-+.f6479.2%

                      \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
                  3. Applied rewrites79.2%

                    \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \left(z + y\right) + x\right)} \]
                  4. Taylor expanded in x around inf

                    \[\leadsto \color{blue}{1} \cdot \left(\tan \left(z + y\right) + x\right) \]
                  5. Step-by-step derivation
                    1. Applied rewrites50.3%

                      \[\leadsto \color{blue}{1} \cdot \left(\tan \left(z + y\right) + x\right) \]
                    2. Add Preprocessing

                    Alternative 19: 40.8% accurate, 1.8× speedup?

                    \[1 \cdot \left(\tan \left(\mathsf{max}\left(y, z\right)\right) + x\right) \]
                    (FPCore (x y z a)
                      :precision binary64
                      (* 1.0 (+ (tan (fmax y z)) x)))
                    double code(double x, double y, double z, double a) {
                    	return 1.0 * (tan(fmax(y, z)) + x);
                    }
                    
                    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 = 1.0d0 * (tan(fmax(y, z)) + x)
                    end function
                    
                    public static double code(double x, double y, double z, double a) {
                    	return 1.0 * (Math.tan(fmax(y, z)) + x);
                    }
                    
                    def code(x, y, z, a):
                    	return 1.0 * (math.tan(fmax(y, z)) + x)
                    
                    function code(x, y, z, a)
                    	return Float64(1.0 * Float64(tan(fmax(y, z)) + x))
                    end
                    
                    function tmp = code(x, y, z, a)
                    	tmp = 1.0 * (tan(max(y, z)) + x);
                    end
                    
                    code[x_, y_, z_, a_] := N[(1.0 * N[(N[Tan[N[Max[y, z], $MachinePrecision]], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]
                    
                    1 \cdot \left(\tan \left(\mathsf{max}\left(y, z\right)\right) + x\right)
                    
                    Derivation
                    1. Initial program 79.3%

                      \[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. sub-to-multN/A

                        \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{x + \tan \left(y + z\right)}\right) \cdot \left(x + \tan \left(y + z\right)\right)} \]
                      5. lower-unsound-*.f64N/A

                        \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{x + \tan \left(y + z\right)}\right) \cdot \left(x + \tan \left(y + z\right)\right)} \]
                      6. lower-unsound--.f64N/A

                        \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{x + \tan \left(y + z\right)}\right)} \cdot \left(x + \tan \left(y + z\right)\right) \]
                      7. lower-unsound-/.f64N/A

                        \[\leadsto \left(1 - \color{blue}{\frac{\tan a}{x + \tan \left(y + z\right)}}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                      8. +-commutativeN/A

                        \[\leadsto \left(1 - \frac{\tan a}{\color{blue}{\tan \left(y + z\right) + x}}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                      9. lower-+.f64N/A

                        \[\leadsto \left(1 - \frac{\tan a}{\color{blue}{\tan \left(y + z\right) + x}}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                      10. lift-+.f64N/A

                        \[\leadsto \left(1 - \frac{\tan a}{\tan \color{blue}{\left(y + z\right)} + x}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                      11. +-commutativeN/A

                        \[\leadsto \left(1 - \frac{\tan a}{\tan \color{blue}{\left(z + y\right)} + x}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                      12. lower-+.f64N/A

                        \[\leadsto \left(1 - \frac{\tan a}{\tan \color{blue}{\left(z + y\right)} + x}\right) \cdot \left(x + \tan \left(y + z\right)\right) \]
                      13. +-commutativeN/A

                        \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \color{blue}{\left(\tan \left(y + z\right) + x\right)} \]
                      14. lower-+.f6479.2%

                        \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \color{blue}{\left(\tan \left(y + z\right) + x\right)} \]
                      15. lift-+.f64N/A

                        \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(y + z\right)} + x\right) \]
                      16. +-commutativeN/A

                        \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
                      17. lower-+.f6479.2%

                        \[\leadsto \left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \color{blue}{\left(z + y\right)} + x\right) \]
                    3. Applied rewrites79.2%

                      \[\leadsto \color{blue}{\left(1 - \frac{\tan a}{\tan \left(z + y\right) + x}\right) \cdot \left(\tan \left(z + y\right) + x\right)} \]
                    4. Taylor expanded in x around inf

                      \[\leadsto \color{blue}{1} \cdot \left(\tan \left(z + y\right) + x\right) \]
                    5. Step-by-step derivation
                      1. Applied rewrites50.3%

                        \[\leadsto \color{blue}{1} \cdot \left(\tan \left(z + y\right) + x\right) \]
                      2. Taylor expanded in y around 0

                        \[\leadsto 1 \cdot \left(\tan \color{blue}{z} + x\right) \]
                      3. Step-by-step derivation
                        1. Applied rewrites40.9%

                          \[\leadsto 1 \cdot \left(\tan \color{blue}{z} + x\right) \]
                        2. Add Preprocessing

                        Reproduce

                        ?
                        herbie shell --seed 2025212 
                        (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))))