tan-example (used to crash)

Percentage Accurate: 79.5% → 99.7%
Time: 11.2s
Alternatives: 17
Speedup: 0.5×

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 17 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.5% 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(\sin z, -\sin y, \cos z \cdot \cos y\right)\\ x + \left(\left(\frac{\sin z \cdot \cos y}{t\_0} + \frac{\cos z \cdot \sin y}{t\_0}\right) - \tan a\right) \end{array} \]
(FPCore (x y z a)
 :precision binary64
 (let* ((t_0 (fma (sin z) (- (sin y)) (* (cos z) (cos 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(sin(z), -sin(y), (cos(z) * cos(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(sin(z), Float64(-sin(y)), Float64(cos(z) * cos(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[Sin[z], $MachinePrecision] * (-N[Sin[y], $MachinePrecision]) + N[(N[Cos[z], $MachinePrecision] * N[Cos[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(\sin z, -\sin y, \cos z \cdot \cos y\right)\\
x + \left(\left(\frac{\sin z \cdot \cos y}{t\_0} + \frac{\cos z \cdot \sin y}{t\_0}\right) - \tan a\right)
\end{array}
Derivation
  1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \left(\left(\frac{\sin z \cdot \cos y}{\color{blue}{\cos z \cdot \cos y - \sin y \cdot \sin z}} + \frac{\cos z \cdot \sin y}{\cos z \cdot \cos y - \sin y \cdot \sin z}\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 y \cdot \sin z}} + \frac{\cos z \cdot \sin y}{\cos z \cdot \cos y - \sin y \cdot \sin z}\right) - \tan a\right) \]
    3. fp-cancel-sub-sign-invN/A

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

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

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

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

      \[\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}{\cos z \cdot \cos y - \sin y \cdot \sin z}\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}{\cos z \cdot \cos y - \sin y \cdot \sin z}\right) - \tan a\right) \]
  10. Step-by-step derivation
    1. 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}{\cos z \cdot \cos y - \sin y \cdot \sin z}}\right) - \tan a\right) \]
    2. 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}{\cos z \cdot \cos y - \color{blue}{\sin y \cdot \sin z}}\right) - \tan a\right) \]
    3. fp-cancel-sub-sign-invN/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 + \left(\mathsf{neg}\left(\sin y\right)\right) \cdot \sin z}}\right) - \tan a\right) \]
    4. +-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}{\left(\mathsf{neg}\left(\sin y\right)\right) \cdot \sin z + \cos z \cdot \cos y}}\right) - \tan a\right) \]
    5. *-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 \left(\mathsf{neg}\left(\sin y\right)\right)} + \cos z \cdot \cos y}\right) - \tan a\right) \]
    6. 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, \mathsf{neg}\left(\sin y\right), \cos z \cdot \cos y\right)}}\right) - \tan a\right) \]
    7. lower-neg.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, \color{blue}{-\sin y}, \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. 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.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 89.7% accurate, 0.2× speedup?

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

\mathbf{elif}\;a \leq 1.02 \cdot 10^{-13}:\\
\;\;\;\;x + \mathsf{fma}\left(a, -0.3333333333333333 \cdot {a}^{2} - 1, \frac{t\_10}{t\_9} + \frac{t\_5}{t\_9}\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(\left(\frac{\sin t\_1 + \sin \left(\mathsf{max}\left(y, z\right) - \mathsf{min}\left(y, z\right)\right)}{2 \cdot t\_2} + t\_8\right) - \tan a\right)\\


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

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0499999999999998 < a < 1.0199999999999999e-13

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0199999999999999e-13 < a

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 89.6% accurate, 0.2× speedup?

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

\mathbf{elif}\;a \leq 1.02 \cdot 10^{-13}:\\
\;\;\;\;x + \mathsf{fma}\left(-1, a, \frac{t\_8}{t\_10} + \frac{t\_5}{t\_10}\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(\left(\frac{\sin t\_1 + \sin \left(\mathsf{max}\left(y, z\right) - \mathsf{min}\left(y, z\right)\right)}{2 \cdot t\_2} + t\_9\right) - \tan a\right)\\


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

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.0499999999999998 < a < 1.0199999999999999e-13

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0199999999999999e-13 < a

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 89.2% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \sin \left(\mathsf{max}\left(y, z\right)\right)\\ t_1 := \mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right)\\ t_2 := \cos \left(\mathsf{max}\left(y, z\right)\right)\\ t_3 := \sin \left(\mathsf{min}\left(y, z\right)\right)\\ t_4 := t\_2 \cdot t\_3\\ t_5 := t\_3 \cdot t\_0\\ t_6 := \cos \left(\mathsf{min}\left(y, z\right)\right)\\ t_7 := \frac{t\_4}{t\_2 \cdot t\_6 - t\_5}\\ t_8 := t\_6 \cdot t\_0\\ t_9 := \cos t\_1\\ t_10 := t\_6 \cdot t\_2 - t\_5\\ \mathbf{if}\;a \leq -3.7:\\ \;\;\;\;x + \left(\left(\frac{t\_8}{t\_9} + t\_7\right) - \tan a\right)\\ \mathbf{elif}\;a \leq 1.02 \cdot 10^{-13}:\\ \;\;\;\;x + \left(\frac{t\_8}{t\_10} + \frac{t\_4}{t\_10}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(\frac{\sin t\_1 + \sin \left(\mathsf{max}\left(y, z\right) - \mathsf{min}\left(y, z\right)\right)}{2 \cdot t\_9} + t\_7\right) - \tan a\right)\\ \end{array} \]
(FPCore (x y z a)
 :precision binary64
 (let* ((t_0 (sin (fmax y z)))
        (t_1 (+ (fmin y z) (fmax y z)))
        (t_2 (cos (fmax y z)))
        (t_3 (sin (fmin y z)))
        (t_4 (* t_2 t_3))
        (t_5 (* t_3 t_0))
        (t_6 (cos (fmin y z)))
        (t_7 (/ t_4 (- (* t_2 t_6) t_5)))
        (t_8 (* t_6 t_0))
        (t_9 (cos t_1))
        (t_10 (- (* t_6 t_2) t_5)))
   (if (<= a -3.7)
     (+ x (- (+ (/ t_8 t_9) t_7) (tan a)))
     (if (<= a 1.02e-13)
       (+ x (+ (/ t_8 t_10) (/ t_4 t_10)))
       (+
        x
        (-
         (+ (/ (+ (sin t_1) (sin (- (fmax y z) (fmin y z)))) (* 2.0 t_9)) t_7)
         (tan a)))))))
double code(double x, double y, double z, double a) {
	double t_0 = sin(fmax(y, z));
	double t_1 = fmin(y, z) + fmax(y, z);
	double t_2 = cos(fmax(y, z));
	double t_3 = sin(fmin(y, z));
	double t_4 = t_2 * t_3;
	double t_5 = t_3 * t_0;
	double t_6 = cos(fmin(y, z));
	double t_7 = t_4 / ((t_2 * t_6) - t_5);
	double t_8 = t_6 * t_0;
	double t_9 = cos(t_1);
	double t_10 = (t_6 * t_2) - t_5;
	double tmp;
	if (a <= -3.7) {
		tmp = x + (((t_8 / t_9) + t_7) - tan(a));
	} else if (a <= 1.02e-13) {
		tmp = x + ((t_8 / t_10) + (t_4 / t_10));
	} else {
		tmp = x + ((((sin(t_1) + sin((fmax(y, z) - fmin(y, z)))) / (2.0 * t_9)) + t_7) - 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) :: t_0
    real(8) :: t_1
    real(8) :: t_10
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: t_7
    real(8) :: t_8
    real(8) :: t_9
    real(8) :: tmp
    t_0 = sin(fmax(y, z))
    t_1 = fmin(y, z) + fmax(y, z)
    t_2 = cos(fmax(y, z))
    t_3 = sin(fmin(y, z))
    t_4 = t_2 * t_3
    t_5 = t_3 * t_0
    t_6 = cos(fmin(y, z))
    t_7 = t_4 / ((t_2 * t_6) - t_5)
    t_8 = t_6 * t_0
    t_9 = cos(t_1)
    t_10 = (t_6 * t_2) - t_5
    if (a <= (-3.7d0)) then
        tmp = x + (((t_8 / t_9) + t_7) - tan(a))
    else if (a <= 1.02d-13) then
        tmp = x + ((t_8 / t_10) + (t_4 / t_10))
    else
        tmp = x + ((((sin(t_1) + sin((fmax(y, z) - fmin(y, z)))) / (2.0d0 * t_9)) + t_7) - tan(a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double a) {
	double t_0 = Math.sin(fmax(y, z));
	double t_1 = fmin(y, z) + fmax(y, z);
	double t_2 = Math.cos(fmax(y, z));
	double t_3 = Math.sin(fmin(y, z));
	double t_4 = t_2 * t_3;
	double t_5 = t_3 * t_0;
	double t_6 = Math.cos(fmin(y, z));
	double t_7 = t_4 / ((t_2 * t_6) - t_5);
	double t_8 = t_6 * t_0;
	double t_9 = Math.cos(t_1);
	double t_10 = (t_6 * t_2) - t_5;
	double tmp;
	if (a <= -3.7) {
		tmp = x + (((t_8 / t_9) + t_7) - Math.tan(a));
	} else if (a <= 1.02e-13) {
		tmp = x + ((t_8 / t_10) + (t_4 / t_10));
	} else {
		tmp = x + ((((Math.sin(t_1) + Math.sin((fmax(y, z) - fmin(y, z)))) / (2.0 * t_9)) + t_7) - Math.tan(a));
	}
	return tmp;
}
def code(x, y, z, a):
	t_0 = math.sin(fmax(y, z))
	t_1 = fmin(y, z) + fmax(y, z)
	t_2 = math.cos(fmax(y, z))
	t_3 = math.sin(fmin(y, z))
	t_4 = t_2 * t_3
	t_5 = t_3 * t_0
	t_6 = math.cos(fmin(y, z))
	t_7 = t_4 / ((t_2 * t_6) - t_5)
	t_8 = t_6 * t_0
	t_9 = math.cos(t_1)
	t_10 = (t_6 * t_2) - t_5
	tmp = 0
	if a <= -3.7:
		tmp = x + (((t_8 / t_9) + t_7) - math.tan(a))
	elif a <= 1.02e-13:
		tmp = x + ((t_8 / t_10) + (t_4 / t_10))
	else:
		tmp = x + ((((math.sin(t_1) + math.sin((fmax(y, z) - fmin(y, z)))) / (2.0 * t_9)) + t_7) - math.tan(a))
	return tmp
function code(x, y, z, a)
	t_0 = sin(fmax(y, z))
	t_1 = Float64(fmin(y, z) + fmax(y, z))
	t_2 = cos(fmax(y, z))
	t_3 = sin(fmin(y, z))
	t_4 = Float64(t_2 * t_3)
	t_5 = Float64(t_3 * t_0)
	t_6 = cos(fmin(y, z))
	t_7 = Float64(t_4 / Float64(Float64(t_2 * t_6) - t_5))
	t_8 = Float64(t_6 * t_0)
	t_9 = cos(t_1)
	t_10 = Float64(Float64(t_6 * t_2) - t_5)
	tmp = 0.0
	if (a <= -3.7)
		tmp = Float64(x + Float64(Float64(Float64(t_8 / t_9) + t_7) - tan(a)));
	elseif (a <= 1.02e-13)
		tmp = Float64(x + Float64(Float64(t_8 / t_10) + Float64(t_4 / t_10)));
	else
		tmp = Float64(x + Float64(Float64(Float64(Float64(sin(t_1) + sin(Float64(fmax(y, z) - fmin(y, z)))) / Float64(2.0 * t_9)) + t_7) - tan(a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, a)
	t_0 = sin(max(y, z));
	t_1 = min(y, z) + max(y, z);
	t_2 = cos(max(y, z));
	t_3 = sin(min(y, z));
	t_4 = t_2 * t_3;
	t_5 = t_3 * t_0;
	t_6 = cos(min(y, z));
	t_7 = t_4 / ((t_2 * t_6) - t_5);
	t_8 = t_6 * t_0;
	t_9 = cos(t_1);
	t_10 = (t_6 * t_2) - t_5;
	tmp = 0.0;
	if (a <= -3.7)
		tmp = x + (((t_8 / t_9) + t_7) - tan(a));
	elseif (a <= 1.02e-13)
		tmp = x + ((t_8 / t_10) + (t_4 / t_10));
	else
		tmp = x + ((((sin(t_1) + sin((max(y, z) - min(y, z)))) / (2.0 * t_9)) + t_7) - tan(a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[Sin[N[Max[y, z], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Min[y, z], $MachinePrecision] + N[Max[y, z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[Max[y, z], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[Min[y, z], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$3 * t$95$0), $MachinePrecision]}, Block[{t$95$6 = N[Cos[N[Min[y, z], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$7 = N[(t$95$4 / N[(N[(t$95$2 * t$95$6), $MachinePrecision] - t$95$5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$6 * t$95$0), $MachinePrecision]}, Block[{t$95$9 = N[Cos[t$95$1], $MachinePrecision]}, Block[{t$95$10 = N[(N[(t$95$6 * t$95$2), $MachinePrecision] - t$95$5), $MachinePrecision]}, If[LessEqual[a, -3.7], N[(x + N[(N[(N[(t$95$8 / t$95$9), $MachinePrecision] + t$95$7), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.02e-13], N[(x + N[(N[(t$95$8 / t$95$10), $MachinePrecision] + N[(t$95$4 / t$95$10), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(N[(N[Sin[t$95$1], $MachinePrecision] + N[Sin[N[(N[Max[y, z], $MachinePrecision] - N[Min[y, z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * t$95$9), $MachinePrecision]), $MachinePrecision] + t$95$7), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}
t_0 := \sin \left(\mathsf{max}\left(y, z\right)\right)\\
t_1 := \mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right)\\
t_2 := \cos \left(\mathsf{max}\left(y, z\right)\right)\\
t_3 := \sin \left(\mathsf{min}\left(y, z\right)\right)\\
t_4 := t\_2 \cdot t\_3\\
t_5 := t\_3 \cdot t\_0\\
t_6 := \cos \left(\mathsf{min}\left(y, z\right)\right)\\
t_7 := \frac{t\_4}{t\_2 \cdot t\_6 - t\_5}\\
t_8 := t\_6 \cdot t\_0\\
t_9 := \cos t\_1\\
t_10 := t\_6 \cdot t\_2 - t\_5\\
\mathbf{if}\;a \leq -3.7:\\
\;\;\;\;x + \left(\left(\frac{t\_8}{t\_9} + t\_7\right) - \tan a\right)\\

\mathbf{elif}\;a \leq 1.02 \cdot 10^{-13}:\\
\;\;\;\;x + \left(\frac{t\_8}{t\_10} + \frac{t\_4}{t\_10}\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(\left(\frac{\sin t\_1 + \sin \left(\mathsf{max}\left(y, z\right) - \mathsf{min}\left(y, z\right)\right)}{2 \cdot t\_9} + t\_7\right) - \tan a\right)\\


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

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.7000000000000002 < a < 1.0199999999999999e-13

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0199999999999999e-13 < a

    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 80.8% accurate, 0.2× 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 := \cos \left(\mathsf{min}\left(y, z\right)\right)\\ t_3 := \sin \left(\mathsf{max}\left(y, z\right)\right)\\ x + \left(\left(\frac{t\_2 \cdot t\_3}{\cos \left(\mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right)\right)} + \frac{t\_0 \cdot t\_1}{t\_0 \cdot t\_2 - t\_1 \cdot t\_3}\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 (cos (fmin y z)))
        (t_3 (sin (fmax y z))))
   (+
    x
    (-
     (+
      (/ (* t_2 t_3) (cos (+ (fmin y z) (fmax y z))))
      (/ (* t_0 t_1) (- (* t_0 t_2) (* t_1 t_3))))
     (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 = cos(fmin(y, z));
	double t_3 = sin(fmax(y, z));
	return x + ((((t_2 * t_3) / cos((fmin(y, z) + fmax(y, z)))) + ((t_0 * t_1) / ((t_0 * t_2) - (t_1 * t_3)))) - 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
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    t_0 = cos(fmax(y, z))
    t_1 = sin(fmin(y, z))
    t_2 = cos(fmin(y, z))
    t_3 = sin(fmax(y, z))
    code = x + ((((t_2 * t_3) / cos((fmin(y, z) + fmax(y, z)))) + ((t_0 * t_1) / ((t_0 * t_2) - (t_1 * t_3)))) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
	double t_0 = Math.cos(fmax(y, z));
	double t_1 = Math.sin(fmin(y, z));
	double t_2 = Math.cos(fmin(y, z));
	double t_3 = Math.sin(fmax(y, z));
	return x + ((((t_2 * t_3) / Math.cos((fmin(y, z) + fmax(y, z)))) + ((t_0 * t_1) / ((t_0 * t_2) - (t_1 * t_3)))) - Math.tan(a));
}
def code(x, y, z, a):
	t_0 = math.cos(fmax(y, z))
	t_1 = math.sin(fmin(y, z))
	t_2 = math.cos(fmin(y, z))
	t_3 = math.sin(fmax(y, z))
	return x + ((((t_2 * t_3) / math.cos((fmin(y, z) + fmax(y, z)))) + ((t_0 * t_1) / ((t_0 * t_2) - (t_1 * t_3)))) - math.tan(a))
function code(x, y, z, a)
	t_0 = cos(fmax(y, z))
	t_1 = sin(fmin(y, z))
	t_2 = cos(fmin(y, z))
	t_3 = sin(fmax(y, z))
	return Float64(x + Float64(Float64(Float64(Float64(t_2 * t_3) / cos(Float64(fmin(y, z) + fmax(y, z)))) + Float64(Float64(t_0 * t_1) / Float64(Float64(t_0 * t_2) - Float64(t_1 * t_3)))) - tan(a)))
end
function tmp = code(x, y, z, a)
	t_0 = cos(max(y, z));
	t_1 = sin(min(y, z));
	t_2 = cos(min(y, z));
	t_3 = sin(max(y, z));
	tmp = x + ((((t_2 * t_3) / cos((min(y, z) + max(y, z)))) + ((t_0 * t_1) / ((t_0 * t_2) - (t_1 * t_3)))) - 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[Min[y, z], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[Min[y, z], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[Max[y, z], $MachinePrecision]], $MachinePrecision]}, N[(x + N[(N[(N[(N[(t$95$2 * t$95$3), $MachinePrecision] / N[Cos[N[(N[Min[y, z], $MachinePrecision] + N[Max[y, z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * t$95$1), $MachinePrecision] / N[(N[(t$95$0 * t$95$2), $MachinePrecision] - N[(t$95$1 * t$95$3), $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{min}\left(y, z\right)\right)\\
t_2 := \cos \left(\mathsf{min}\left(y, z\right)\right)\\
t_3 := \sin \left(\mathsf{max}\left(y, z\right)\right)\\
x + \left(\left(\frac{t\_2 \cdot t\_3}{\cos \left(\mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right)\right)} + \frac{t\_0 \cdot t\_1}{t\_0 \cdot t\_2 - t\_1 \cdot t\_3}\right) - \tan a\right)
\end{array}
Derivation
  1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 80.0% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 79.9% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 79.5% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 79.5% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 79.5% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 79.5% accurate, 1.0× speedup?

\[x - \left(\tan a - \tan \left(z + y\right)\right) \]
(FPCore (x y z a) :precision binary64 (- x (- (tan a) (tan (+ z y)))))
double code(double x, double y, double z, double a) {
	return x - (tan(a) - tan((z + y)));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: a
    code = x - (tan(a) - tan((z + y)))
end function
public static double code(double x, double y, double z, double a) {
	return x - (Math.tan(a) - Math.tan((z + y)));
}
def code(x, y, z, a):
	return x - (math.tan(a) - math.tan((z + y)))
function code(x, y, z, a)
	return Float64(x - Float64(tan(a) - tan(Float64(z + y))))
end
function tmp = code(x, y, z, a)
	tmp = x - (tan(a) - tan((z + y)));
end
code[x_, y_, z_, a_] := N[(x - N[(N[Tan[a], $MachinePrecision] - N[Tan[N[(z + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \left(\tan a - \tan \left(z + y\right)\right)
Derivation
  1. Initial program 79.5%

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

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

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

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

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

      \[\leadsto x - \color{blue}{\left(\tan a - \tan \left(y + z\right)\right)} \]
    6. lower--.f6479.5%

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

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

      \[\leadsto x - \left(\tan a - \tan \color{blue}{\left(z + y\right)}\right) \]
    9. lower-+.f6479.5%

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

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

Alternative 13: 69.0% accurate, 0.9× speedup?

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

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


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.4e10

    1. Initial program 79.5%

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

      \[\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 a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.4e10 < y

    1. Initial program 79.5%

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

      \[\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 y around 0

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

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

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

        \[\leadsto x + \left(\frac{\sin z}{\cos z} - \tan a\right) \]
    6. Applied rewrites60.2%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(\tan a - \frac{\sin z}{\cos z}\right)} \]
      6. lower--.f6460.2%

        \[\leadsto x - \color{blue}{\left(\tan a - \frac{\sin z}{\cos z}\right)} \]
    8. Applied rewrites60.2%

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

Alternative 14: 59.3% 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 -40000000000:\\ \;\;\;\;x + \frac{\sin \left(\mathsf{min}\left(y, z\right)\right)}{\cos \left(\mathsf{min}\left(y, z\right)\right)}\\ \mathbf{elif}\;t\_0 \leq 2:\\ \;\;\;\;x + \left(\mathsf{max}\left(y, z\right) \cdot \left(1 + 0.3333333333333333 \cdot {\left(\mathsf{max}\left(y, z\right)\right)}^{2}\right) - \tan a\right)\\ \mathbf{else}:\\ \;\;\;\;\tan t\_0 + x\\ \end{array} \]
(FPCore (x y z a)
 :precision binary64
 (let* ((t_0 (+ (fmin y z) (fmax y z))))
   (if (<= t_0 -40000000000.0)
     (+ x (/ (sin (fmin y z)) (cos (fmin y z))))
     (if (<= t_0 2.0)
       (+
        x
        (-
         (* (fmax y z) (+ 1.0 (* 0.3333333333333333 (pow (fmax y z) 2.0))))
         (tan a)))
       (+ (tan t_0) 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 <= -40000000000.0) {
		tmp = x + (sin(fmin(y, z)) / cos(fmin(y, z)));
	} else if (t_0 <= 2.0) {
		tmp = x + ((fmax(y, z) * (1.0 + (0.3333333333333333 * pow(fmax(y, z), 2.0)))) - tan(a));
	} else {
		tmp = tan(t_0) + 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 <= (-40000000000.0d0)) then
        tmp = x + (sin(fmin(y, z)) / cos(fmin(y, z)))
    else if (t_0 <= 2.0d0) then
        tmp = x + ((fmax(y, z) * (1.0d0 + (0.3333333333333333d0 * (fmax(y, z) ** 2.0d0)))) - tan(a))
    else
        tmp = tan(t_0) + 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 <= -40000000000.0) {
		tmp = x + (Math.sin(fmin(y, z)) / Math.cos(fmin(y, z)));
	} else if (t_0 <= 2.0) {
		tmp = x + ((fmax(y, z) * (1.0 + (0.3333333333333333 * Math.pow(fmax(y, z), 2.0)))) - Math.tan(a));
	} else {
		tmp = Math.tan(t_0) + x;
	}
	return tmp;
}
def code(x, y, z, a):
	t_0 = fmin(y, z) + fmax(y, z)
	tmp = 0
	if t_0 <= -40000000000.0:
		tmp = x + (math.sin(fmin(y, z)) / math.cos(fmin(y, z)))
	elif t_0 <= 2.0:
		tmp = x + ((fmax(y, z) * (1.0 + (0.3333333333333333 * math.pow(fmax(y, z), 2.0)))) - math.tan(a))
	else:
		tmp = math.tan(t_0) + x
	return tmp
function code(x, y, z, a)
	t_0 = Float64(fmin(y, z) + fmax(y, z))
	tmp = 0.0
	if (t_0 <= -40000000000.0)
		tmp = Float64(x + Float64(sin(fmin(y, z)) / cos(fmin(y, z))));
	elseif (t_0 <= 2.0)
		tmp = Float64(x + Float64(Float64(fmax(y, z) * Float64(1.0 + Float64(0.3333333333333333 * (fmax(y, z) ^ 2.0)))) - tan(a)));
	else
		tmp = Float64(tan(t_0) + 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 <= -40000000000.0)
		tmp = x + (sin(min(y, z)) / cos(min(y, z)));
	elseif (t_0 <= 2.0)
		tmp = x + ((max(y, z) * (1.0 + (0.3333333333333333 * (max(y, z) ^ 2.0)))) - tan(a));
	else
		tmp = tan(t_0) + 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, -40000000000.0], N[(x + N[(N[Sin[N[Min[y, z], $MachinePrecision]], $MachinePrecision] / N[Cos[N[Min[y, z], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2.0], N[(x + N[(N[(N[Max[y, z], $MachinePrecision] * N[(1.0 + N[(0.3333333333333333 * N[Power[N[Max[y, z], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Tan[t$95$0], $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \mathsf{min}\left(y, z\right) + \mathsf{max}\left(y, z\right)\\
\mathbf{if}\;t\_0 \leq -40000000000:\\
\;\;\;\;x + \frac{\sin \left(\mathsf{min}\left(y, z\right)\right)}{\cos \left(\mathsf{min}\left(y, z\right)\right)}\\

\mathbf{elif}\;t\_0 \leq 2:\\
\;\;\;\;x + \left(\mathsf{max}\left(y, z\right) \cdot \left(1 + 0.3333333333333333 \cdot {\left(\mathsf{max}\left(y, z\right)\right)}^{2}\right) - \tan a\right)\\

\mathbf{else}:\\
\;\;\;\;\tan t\_0 + x\\


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

    1. Initial program 79.5%

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

      \[\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 a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + \left(\frac{\cos y \cdot \sin z}{\cos \left(y + z\right)} + \frac{\cos z \cdot \sin y}{\cos \left(y + z\right)}\right)} \]
    7. Taylor expanded in z around 0

      \[\leadsto x + \color{blue}{\frac{\sin y}{\cos y}} \]
    8. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto x + \frac{\sin y}{\color{blue}{\cos y}} \]
      2. lower-/.f64N/A

        \[\leadsto x + \frac{\sin y}{\cos y} \]
      3. lower-sin.f64N/A

        \[\leadsto x + \frac{\sin y}{\cos y} \]
      4. lower-cos.f6440.6%

        \[\leadsto x + \frac{\sin y}{\cos y} \]
    9. Applied rewrites40.6%

      \[\leadsto x + \color{blue}{\frac{\sin y}{\cos y}} \]

    if -4e10 < (+.f64 y z) < 2

    1. Initial program 79.5%

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

      \[\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 y around 0

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

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

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

        \[\leadsto x + \left(\frac{\sin z}{\cos z} - \tan a\right) \]
    6. Applied rewrites60.2%

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

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

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

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

        \[\leadsto x + \left(z \cdot \left(1 + \frac{1}{3} \cdot {z}^{\color{blue}{2}}\right) - \tan a\right) \]
      4. lower-pow.f6431.7%

        \[\leadsto x + \left(z \cdot \left(1 + 0.3333333333333333 \cdot {z}^{2}\right) - \tan a\right) \]
    9. Applied rewrites31.7%

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

    if 2 < (+.f64 y z)

    1. Initial program 79.5%

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

      \[\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 a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 59.1% accurate, 1.0× speedup?

\[\begin{array}{l} t_0 := \tan \left(y + z\right) + x\\ \mathbf{if}\;y + z \leq -40000000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y + z \leq 2:\\ \;\;\;\;x + \left(z \cdot \left(1 + 0.3333333333333333 \cdot {z}^{2}\right) - \tan a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
(FPCore (x y z a)
 :precision binary64
 (let* ((t_0 (+ (tan (+ y z)) x)))
   (if (<= (+ y z) -40000000000.0)
     t_0
     (if (<= (+ y z) 2.0)
       (+ x (- (* z (+ 1.0 (* 0.3333333333333333 (pow z 2.0)))) (tan a)))
       t_0))))
double code(double x, double y, double z, double a) {
	double t_0 = tan((y + z)) + x;
	double tmp;
	if ((y + z) <= -40000000000.0) {
		tmp = t_0;
	} else if ((y + z) <= 2.0) {
		tmp = x + ((z * (1.0 + (0.3333333333333333 * pow(z, 2.0)))) - tan(a));
	} else {
		tmp = t_0;
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(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 = tan((y + z)) + x
    if ((y + z) <= (-40000000000.0d0)) then
        tmp = t_0
    else if ((y + z) <= 2.0d0) then
        tmp = x + ((z * (1.0d0 + (0.3333333333333333d0 * (z ** 2.0d0)))) - tan(a))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double a) {
	double t_0 = Math.tan((y + z)) + x;
	double tmp;
	if ((y + z) <= -40000000000.0) {
		tmp = t_0;
	} else if ((y + z) <= 2.0) {
		tmp = x + ((z * (1.0 + (0.3333333333333333 * Math.pow(z, 2.0)))) - Math.tan(a));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z, a):
	t_0 = math.tan((y + z)) + x
	tmp = 0
	if (y + z) <= -40000000000.0:
		tmp = t_0
	elif (y + z) <= 2.0:
		tmp = x + ((z * (1.0 + (0.3333333333333333 * math.pow(z, 2.0)))) - math.tan(a))
	else:
		tmp = t_0
	return tmp
function code(x, y, z, a)
	t_0 = Float64(tan(Float64(y + z)) + x)
	tmp = 0.0
	if (Float64(y + z) <= -40000000000.0)
		tmp = t_0;
	elseif (Float64(y + z) <= 2.0)
		tmp = Float64(x + Float64(Float64(z * Float64(1.0 + Float64(0.3333333333333333 * (z ^ 2.0)))) - tan(a)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z, a)
	t_0 = tan((y + z)) + x;
	tmp = 0.0;
	if ((y + z) <= -40000000000.0)
		tmp = t_0;
	elseif ((y + z) <= 2.0)
		tmp = x + ((z * (1.0 + (0.3333333333333333 * (z ^ 2.0)))) - tan(a));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[N[(y + z), $MachinePrecision], -40000000000.0], t$95$0, If[LessEqual[N[(y + z), $MachinePrecision], 2.0], N[(x + N[(N[(z * N[(1.0 + N[(0.3333333333333333 * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \tan \left(y + z\right) + x\\
\mathbf{if}\;y + z \leq -40000000000:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y + z \leq 2:\\
\;\;\;\;x + \left(z \cdot \left(1 + 0.3333333333333333 \cdot {z}^{2}\right) - \tan a\right)\\

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


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

    1. Initial program 79.5%

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

      \[\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 a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4e10 < (+.f64 y z) < 2

    1. Initial program 79.5%

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

      \[\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 y around 0

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

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

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

        \[\leadsto x + \left(\frac{\sin z}{\cos z} - \tan a\right) \]
    6. Applied rewrites60.2%

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

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

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

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

        \[\leadsto x + \left(z \cdot \left(1 + \frac{1}{3} \cdot {z}^{\color{blue}{2}}\right) - \tan a\right) \]
      4. lower-pow.f6431.7%

        \[\leadsto x + \left(z \cdot \left(1 + 0.3333333333333333 \cdot {z}^{2}\right) - \tan a\right) \]
    9. Applied rewrites31.7%

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

Alternative 16: 50.0% accurate, 1.9× speedup?

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

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

    \[\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 a around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 31.0% accurate, 1.9× speedup?

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

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

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

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

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

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

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

      Reproduce

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