tan-example (used to crash)

Percentage Accurate: 79.8% → 99.5%
Time: 6.2s
Alternatives: 9
Speedup: 1.0×

Specification

?
\[\left(\left(\left(x = 0 \lor \frac{2942071}{5000000} \leq x \land x \leq \frac{5055909}{10000}\right) \land \left(-179665800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 \leq y \land y \leq \frac{-1885117}{2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} \lor \frac{642469}{500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} \leq y \land y \leq 175122400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\right)\right) \land \left(-177670700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 \leq z \land z \leq \frac{-2149949}{2500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} \lor \frac{658629}{20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} \leq z \land z \leq 172515400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\right)\right) \land \left(-179665800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 \leq a \land a \leq \frac{-1885117}{2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} \lor \frac{642469}{500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000} \leq a \land a \leq 175122400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\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 9 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.8% 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.5% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.5% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 89.3% accurate, 0.1× speedup?

\[\begin{array}{l} t_0 := \cos y \cdot \cos z - \sin y \cdot \sin z\\ t_1 := \cos \left(z + y\right)\\ t_2 := \frac{\cos z \cdot \sin y}{t\_1}\\ \mathbf{if}\;\tan a \leq \frac{-1152921504606847}{576460752303423488}:\\ \;\;\;\;x + \left(\left(\frac{\sin z \cdot \sin \left(\left(-y\right) + \pi \cdot \frac{1}{2}\right)}{t\_1} + t\_2\right) - \tan a\right)\\ \mathbf{elif}\;\tan a \leq \frac{8920298079412249}{178405961588244985132285746181186892047843328}:\\ \;\;\;\;\left(x + \frac{\cos y}{t\_0} \cdot \sin z\right) + \frac{\sin y}{t\_0} \cdot \cos z\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(\frac{\sin z \cdot \cos y}{t\_1} + t\_2\right) - \tan a\right)\\ \end{array} \]
(FPCore (x y z a)
  :precision binary64
  (let* ((t_0 (- (* (cos y) (cos z)) (* (sin y) (sin z))))
       (t_1 (cos (+ z y)))
       (t_2 (/ (* (cos z) (sin y)) t_1)))
  (if (<= (tan a) -1152921504606847/576460752303423488)
    (+
     x
     (-
      (+ (/ (* (sin z) (sin (+ (- y) (* PI 1/2)))) t_1) t_2)
      (tan a)))
    (if (<=
         (tan a)
         8920298079412249/178405961588244985132285746181186892047843328)
      (+
       (+ x (* (/ (cos y) t_0) (sin z)))
       (* (/ (sin y) t_0) (cos z)))
      (+ x (- (+ (/ (* (sin z) (cos y)) t_1) t_2) (tan a)))))))
double code(double x, double y, double z, double a) {
	double t_0 = (cos(y) * cos(z)) - (sin(y) * sin(z));
	double t_1 = cos((z + y));
	double t_2 = (cos(z) * sin(y)) / t_1;
	double tmp;
	if (tan(a) <= -0.002) {
		tmp = x + ((((sin(z) * sin((-y + (((double) M_PI) * 0.5)))) / t_1) + t_2) - tan(a));
	} else if (tan(a) <= 5e-29) {
		tmp = (x + ((cos(y) / t_0) * sin(z))) + ((sin(y) / t_0) * cos(z));
	} else {
		tmp = x + ((((sin(z) * cos(y)) / t_1) + t_2) - tan(a));
	}
	return tmp;
}
public static double code(double x, double y, double z, double a) {
	double t_0 = (Math.cos(y) * Math.cos(z)) - (Math.sin(y) * Math.sin(z));
	double t_1 = Math.cos((z + y));
	double t_2 = (Math.cos(z) * Math.sin(y)) / t_1;
	double tmp;
	if (Math.tan(a) <= -0.002) {
		tmp = x + ((((Math.sin(z) * Math.sin((-y + (Math.PI * 0.5)))) / t_1) + t_2) - Math.tan(a));
	} else if (Math.tan(a) <= 5e-29) {
		tmp = (x + ((Math.cos(y) / t_0) * Math.sin(z))) + ((Math.sin(y) / t_0) * Math.cos(z));
	} else {
		tmp = x + ((((Math.sin(z) * Math.cos(y)) / t_1) + t_2) - Math.tan(a));
	}
	return tmp;
}
def code(x, y, z, a):
	t_0 = (math.cos(y) * math.cos(z)) - (math.sin(y) * math.sin(z))
	t_1 = math.cos((z + y))
	t_2 = (math.cos(z) * math.sin(y)) / t_1
	tmp = 0
	if math.tan(a) <= -0.002:
		tmp = x + ((((math.sin(z) * math.sin((-y + (math.pi * 0.5)))) / t_1) + t_2) - math.tan(a))
	elif math.tan(a) <= 5e-29:
		tmp = (x + ((math.cos(y) / t_0) * math.sin(z))) + ((math.sin(y) / t_0) * math.cos(z))
	else:
		tmp = x + ((((math.sin(z) * math.cos(y)) / t_1) + t_2) - math.tan(a))
	return tmp
function code(x, y, z, a)
	t_0 = Float64(Float64(cos(y) * cos(z)) - Float64(sin(y) * sin(z)))
	t_1 = cos(Float64(z + y))
	t_2 = Float64(Float64(cos(z) * sin(y)) / t_1)
	tmp = 0.0
	if (tan(a) <= -0.002)
		tmp = Float64(x + Float64(Float64(Float64(Float64(sin(z) * sin(Float64(Float64(-y) + Float64(pi * 0.5)))) / t_1) + t_2) - tan(a)));
	elseif (tan(a) <= 5e-29)
		tmp = Float64(Float64(x + Float64(Float64(cos(y) / t_0) * sin(z))) + Float64(Float64(sin(y) / t_0) * cos(z)));
	else
		tmp = Float64(x + Float64(Float64(Float64(Float64(sin(z) * cos(y)) / t_1) + t_2) - tan(a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, a)
	t_0 = (cos(y) * cos(z)) - (sin(y) * sin(z));
	t_1 = cos((z + y));
	t_2 = (cos(z) * sin(y)) / t_1;
	tmp = 0.0;
	if (tan(a) <= -0.002)
		tmp = x + ((((sin(z) * sin((-y + (pi * 0.5)))) / t_1) + t_2) - tan(a));
	elseif (tan(a) <= 5e-29)
		tmp = (x + ((cos(y) / t_0) * sin(z))) + ((sin(y) / t_0) * cos(z));
	else
		tmp = x + ((((sin(z) * cos(y)) / t_1) + t_2) - tan(a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[(N[Cos[y], $MachinePrecision] * N[Cos[z], $MachinePrecision]), $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] * N[Sin[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(z + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Cos[z], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -1152921504606847/576460752303423488], N[(x + N[(N[(N[(N[(N[Sin[z], $MachinePrecision] * N[Sin[N[((-y) + N[(Pi * 1/2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 8920298079412249/178405961588244985132285746181186892047843328], N[(N[(x + N[(N[(N[Cos[y], $MachinePrecision] / t$95$0), $MachinePrecision] * N[Sin[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sin[y], $MachinePrecision] / t$95$0), $MachinePrecision] * N[Cos[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(N[(N[Sin[z], $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \cos y \cdot \cos z - \sin y \cdot \sin z\\
t_1 := \cos \left(z + y\right)\\
t_2 := \frac{\cos z \cdot \sin y}{t\_1}\\
\mathbf{if}\;\tan a \leq \frac{-1152921504606847}{576460752303423488}:\\
\;\;\;\;x + \left(\left(\frac{\sin z \cdot \sin \left(\left(-y\right) + \pi \cdot \frac{1}{2}\right)}{t\_1} + t\_2\right) - \tan a\right)\\

\mathbf{elif}\;\tan a \leq \frac{8920298079412249}{178405961588244985132285746181186892047843328}:\\
\;\;\;\;\left(x + \frac{\cos y}{t\_0} \cdot \sin z\right) + \frac{\sin y}{t\_0} \cdot \cos z\\

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


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

    1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2e-3 < (tan.f64 a) < 4.9999999999999999e-29

    1. Initial program 79.8%

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

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

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

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

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

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

        \[\leadsto x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} \]
      6. lower-+.f6450.7%

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

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

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

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

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

        \[\leadsto x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} \]
      5. quot-tanN/A

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

        \[\leadsto x + \tan \left(y + z\right) \]
      7. +-commutativeN/A

        \[\leadsto x + \tan \left(z + y\right) \]
      8. lift-+.f64N/A

        \[\leadsto x + \tan \left(z + y\right) \]
      9. tan-quotN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \frac{\sin z \cdot \cos y + \cos z \cdot \sin y}{\cos \left(z + y\right)} \]
      19. div-add-revN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + \frac{\cos y}{\cos y \cdot \cos z - \sin y \cdot \sin z} \cdot \sin z\right) + \frac{\sin y}{\cos \left(z + y\right)} \cdot \cos z \]
      12. lower-*.f6451.6%

        \[\leadsto \left(x + \frac{\cos y}{\cos y \cdot \cos z - \sin y \cdot \sin z} \cdot \sin z\right) + \frac{\sin y}{\cos \left(z + y\right)} \cdot \cos z \]
    8. Applied rewrites51.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(x + \frac{\cos y}{\cos y \cdot \cos z - \sin y \cdot \sin z} \cdot \sin z\right) + \frac{\sin y}{\cos y \cdot \cos z - \sin y \cdot \sin z} \cdot \cos z \]
      12. lower-*.f6461.2%

        \[\leadsto \left(x + \frac{\cos y}{\cos y \cdot \cos z - \sin y \cdot \sin z} \cdot \sin z\right) + \frac{\sin y}{\cos y \cdot \cos z - \sin y \cdot \sin z} \cdot \cos z \]
    10. Applied rewrites61.2%

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

    if 4.9999999999999999e-29 < (tan.f64 a)

    1. Initial program 79.8%

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

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

Alternative 4: 80.3% accurate, 0.3× speedup?

\[\begin{array}{l} t_0 := \cos \left(z + y\right)\\ x + \left(\left(\frac{\sin z \cdot \cos y}{t\_0} + \frac{\cos z \cdot \sin y}{t\_0}\right) - \tan a\right) \end{array} \]
(FPCore (x y z a)
  :precision binary64
  (let* ((t_0 (cos (+ z y))))
  (+
   x
   (-
    (+ (/ (* (sin z) (cos y)) t_0) (/ (* (cos z) (sin y)) t_0))
    (tan a)))))
double code(double x, double y, double z, double a) {
	double t_0 = cos((z + y));
	return x + ((((sin(z) * cos(y)) / t_0) + ((cos(z) * sin(y)) / t_0)) - tan(a));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z, a)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: a
    real(8) :: t_0
    t_0 = cos((z + y))
    code = x + ((((sin(z) * cos(y)) / t_0) + ((cos(z) * sin(y)) / t_0)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
	double t_0 = Math.cos((z + y));
	return x + ((((Math.sin(z) * Math.cos(y)) / t_0) + ((Math.cos(z) * Math.sin(y)) / t_0)) - Math.tan(a));
}
def code(x, y, z, a):
	t_0 = math.cos((z + y))
	return x + ((((math.sin(z) * math.cos(y)) / t_0) + ((math.cos(z) * math.sin(y)) / t_0)) - math.tan(a))
function code(x, y, z, a)
	t_0 = cos(Float64(z + y))
	return Float64(x + Float64(Float64(Float64(Float64(sin(z) * cos(y)) / t_0) + Float64(Float64(cos(z) * sin(y)) / t_0)) - tan(a)))
end
function tmp = code(x, y, z, a)
	t_0 = cos((z + y));
	tmp = x + ((((sin(z) * cos(y)) / t_0) + ((cos(z) * sin(y)) / t_0)) - tan(a));
end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[Cos[N[(z + y), $MachinePrecision]], $MachinePrecision]}, N[(x + N[(N[(N[(N[(N[Sin[z], $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(N[(N[Cos[z], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_0 := \cos \left(z + y\right)\\
x + \left(\left(\frac{\sin z \cdot \cos y}{t\_0} + \frac{\cos z \cdot \sin y}{t\_0}\right) - \tan a\right)
\end{array}
Derivation
  1. Initial program 79.8%

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

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

Alternative 5: 79.9% accurate, 0.3× speedup?

\[\begin{array}{l} t_0 := \cos \left(z + y\right)\\ x + \left(\left(\frac{\sin z \cdot 1}{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 y))))
  (+
   x
   (- (+ (/ (* (sin z) 1) t_0) (/ (* (cos z) (sin y)) t_0)) (tan a)))))
double code(double x, double y, double z, double a) {
	double t_0 = cos((z + y));
	return x + ((((sin(z) * 1.0) / t_0) + ((cos(z) * sin(y)) / t_0)) - tan(a));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

    \[\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(\left(\frac{\sin z \cdot \color{blue}{1}}{\cos \left(z + y\right)} + \frac{\cos z \cdot \sin y}{\cos \left(z + y\right)}\right) - \tan a\right) \]
  5. Step-by-step derivation
    1. Applied rewrites79.9%

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

    Alternative 6: 79.8% accurate, 0.2× speedup?

    \[\begin{array}{l} t_0 := \cos \left(\mathsf{min}\left(y, z\right)\right)\\ \left(\frac{t\_0}{\cos \left(\mathsf{max}\left(y, z\right) + \mathsf{min}\left(y, z\right)\right)} \cdot \sin \left(\mathsf{max}\left(y, z\right)\right) + \left(x + \frac{\sin \left(\mathsf{min}\left(y, z\right)\right)}{t\_0}\right)\right) - \tan a \end{array} \]
    (FPCore (x y z a)
      :precision binary64
      (let* ((t_0 (cos (fmin y z))))
      (-
       (+
        (* (/ t_0 (cos (+ (fmax y z) (fmin y z)))) (sin (fmax y z)))
        (+ x (/ (sin (fmin y z)) t_0)))
       (tan a))))
    double code(double x, double y, double z, double a) {
    	double t_0 = cos(fmin(y, z));
    	return (((t_0 / cos((fmax(y, z) + fmin(y, z)))) * sin(fmax(y, z))) + (x + (sin(fmin(y, z)) / t_0))) - tan(a);
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, y, z, a)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: a
        real(8) :: t_0
        t_0 = cos(fmin(y, z))
        code = (((t_0 / cos((fmax(y, z) + fmin(y, z)))) * sin(fmax(y, z))) + (x + (sin(fmin(y, z)) / t_0))) - tan(a)
    end function
    
    public static double code(double x, double y, double z, double a) {
    	double t_0 = Math.cos(fmin(y, z));
    	return (((t_0 / Math.cos((fmax(y, z) + fmin(y, z)))) * Math.sin(fmax(y, z))) + (x + (Math.sin(fmin(y, z)) / t_0))) - Math.tan(a);
    }
    
    def code(x, y, z, a):
    	t_0 = math.cos(fmin(y, z))
    	return (((t_0 / math.cos((fmax(y, z) + fmin(y, z)))) * math.sin(fmax(y, z))) + (x + (math.sin(fmin(y, z)) / t_0))) - math.tan(a)
    
    function code(x, y, z, a)
    	t_0 = cos(fmin(y, z))
    	return Float64(Float64(Float64(Float64(t_0 / cos(Float64(fmax(y, z) + fmin(y, z)))) * sin(fmax(y, z))) + Float64(x + Float64(sin(fmin(y, z)) / t_0))) - tan(a))
    end
    
    function tmp = code(x, y, z, a)
    	t_0 = cos(min(y, z));
    	tmp = (((t_0 / cos((max(y, z) + min(y, z)))) * sin(max(y, z))) + (x + (sin(min(y, z)) / t_0))) - tan(a);
    end
    
    code[x_, y_, z_, a_] := Block[{t$95$0 = N[Cos[N[Min[y, z], $MachinePrecision]], $MachinePrecision]}, N[(N[(N[(N[(t$95$0 / N[Cos[N[(N[Max[y, z], $MachinePrecision] + N[Min[y, z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[Max[y, z], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(x + N[(N[Sin[N[Min[y, z], $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    t_0 := \cos \left(\mathsf{min}\left(y, z\right)\right)\\
    \left(\frac{t\_0}{\cos \left(\mathsf{max}\left(y, z\right) + \mathsf{min}\left(y, z\right)\right)} \cdot \sin \left(\mathsf{max}\left(y, z\right)\right) + \left(x + \frac{\sin \left(\mathsf{min}\left(y, z\right)\right)}{t\_0}\right)\right) - \tan a
    \end{array}
    
    Derivation
    1. Initial program 79.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 7: 69.5% accurate, 0.4× speedup?

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

      1. Initial program 79.8%

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

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

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

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

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

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

          \[\leadsto x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} \]
        6. lower-+.f6450.7%

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

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

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

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

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

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

          \[\leadsto \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} + x \]
        6. quot-tanN/A

          \[\leadsto \tan \left(y + z\right) + x \]
        7. lower-tan.f64N/A

          \[\leadsto \tan \left(y + z\right) + x \]
        8. lift-+.f64N/A

          \[\leadsto \tan \left(y + z\right) + x \]
        9. +-commutativeN/A

          \[\leadsto \tan \left(z + y\right) + x \]
        10. lift-+.f64N/A

          \[\leadsto \tan \left(z + y\right) + x \]
        11. lift-+.f6450.7%

          \[\leadsto \tan \left(z + y\right) + \color{blue}{x} \]
      6. Applied rewrites50.7%

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

      if -500 < (+.f64 y z)

      1. Initial program 79.8%

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

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

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

      Alternative 8: 50.7% accurate, 2.0× speedup?

      \[\tan \left(z + y\right) + x \]
      (FPCore (x y z a)
        :precision binary64
        (+ (tan (+ z y)) x))
      double code(double x, double y, double z, double a) {
      	return tan((z + y)) + x;
      }
      
      module fmin_fmax_functions
          implicit none
          private
          public fmax
          public fmin
      
          interface fmax
              module procedure fmax88
              module procedure fmax44
              module procedure fmax84
              module procedure fmax48
          end interface
          interface fmin
              module procedure fmin88
              module procedure fmin44
              module procedure fmin84
              module procedure fmin48
          end interface
      contains
          real(8) function fmax88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(4) function fmax44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
          end function
          real(8) function fmax84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmax48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
          end function
          real(8) function fmin88(x, y) result (res)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(4) function fmin44(x, y) result (res)
              real(4), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
          end function
          real(8) function fmin84(x, y) result(res)
              real(8), intent (in) :: x
              real(4), intent (in) :: y
              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
          end function
          real(8) function fmin48(x, y) result(res)
              real(4), intent (in) :: x
              real(8), intent (in) :: y
              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
          end function
      end module
      
      real(8) function code(x, y, z, a)
      use fmin_fmax_functions
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8), intent (in) :: a
          code = tan((z + y)) + x
      end function
      
      public static double code(double x, double y, double z, double a) {
      	return Math.tan((z + y)) + x;
      }
      
      def code(x, y, z, a):
      	return math.tan((z + y)) + x
      
      function code(x, y, z, a)
      	return Float64(tan(Float64(z + y)) + x)
      end
      
      function tmp = code(x, y, z, a)
      	tmp = tan((z + y)) + x;
      end
      
      code[x_, y_, z_, a_] := N[(N[Tan[N[(z + y), $MachinePrecision]], $MachinePrecision] + x), $MachinePrecision]
      
      \tan \left(z + y\right) + x
      
      Derivation
      1. Initial program 79.8%

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

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

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

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

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

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

          \[\leadsto x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} \]
        6. lower-+.f6450.7%

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

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

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

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

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

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

          \[\leadsto \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} + x \]
        6. quot-tanN/A

          \[\leadsto \tan \left(y + z\right) + x \]
        7. lower-tan.f64N/A

          \[\leadsto \tan \left(y + z\right) + x \]
        8. lift-+.f64N/A

          \[\leadsto \tan \left(y + z\right) + x \]
        9. +-commutativeN/A

          \[\leadsto \tan \left(z + y\right) + x \]
        10. lift-+.f64N/A

          \[\leadsto \tan \left(z + y\right) + x \]
        11. lift-+.f6450.7%

          \[\leadsto \tan \left(z + y\right) + \color{blue}{x} \]
      6. Applied rewrites50.7%

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

      Reproduce

      ?
      herbie shell --seed 2025285 -o generate:evaluate
      (FPCore (x y z a)
        :name "tan-example (used to crash)"
        :precision binary64
        :pre (and (and (and (or (== x 0) (and (<= 2942071/5000000 x) (<= x 5055909/10000))) (or (and (<= -179665800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 y) (<= y -1885117/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) (and (<= 642469/500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 y) (<= y 175122400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))) (or (and (<= -177670700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 z) (<= z -2149949/2500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) (and (<= 658629/20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 z) (<= z 172515400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)))) (or (and (<= -179665800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 a) (<= a -1885117/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)) (and (<= 642469/500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 a) (<= a 175122400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000))))
        (+ x (- (tan (+ y z)) (tan a))))