tan-example (used to crash)

Percentage Accurate: 79.8% → 99.7%
Time: 24.8s
Alternatives: 22
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

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 22 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?

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

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

Alternative 1: 99.7% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ x + \left(\frac{\tan y}{1 - \frac{\tan z \cdot \sin y}{\cos y}} + \left(\frac{\tan z}{1 - \tan y \cdot \tan z} - \tan a\right)\right) \end{array} \]
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
 :precision binary64
 (+
  x
  (+
   (/ (tan y) (- 1.0 (/ (* (tan z) (sin y)) (cos y))))
   (- (/ (tan z) (- 1.0 (* (tan y) (tan z)))) (tan a)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
	return x + ((tan(y) / (1.0 - ((tan(z) * sin(y)) / cos(y)))) + ((tan(z) / (1.0 - (tan(y) * tan(z)))) - tan(a)));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: a
    code = x + ((tan(y) / (1.0d0 - ((tan(z) * sin(y)) / cos(y)))) + ((tan(z) / (1.0d0 - (tan(y) * tan(z)))) - tan(a)))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
	return x + ((Math.tan(y) / (1.0 - ((Math.tan(z) * Math.sin(y)) / Math.cos(y)))) + ((Math.tan(z) / (1.0 - (Math.tan(y) * Math.tan(z)))) - Math.tan(a)));
}
[x, y, z, a] = sort([x, y, z, a])
def code(x, y, z, a):
	return x + ((math.tan(y) / (1.0 - ((math.tan(z) * math.sin(y)) / math.cos(y)))) + ((math.tan(z) / (1.0 - (math.tan(y) * math.tan(z)))) - math.tan(a)))
x, y, z, a = sort([x, y, z, a])
function code(x, y, z, a)
	return Float64(x + Float64(Float64(tan(y) / Float64(1.0 - Float64(Float64(tan(z) * sin(y)) / cos(y)))) + Float64(Float64(tan(z) / Float64(1.0 - Float64(tan(y) * tan(z)))) - tan(a))))
end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
	tmp = x + ((tan(y) / (1.0 - ((tan(z) * sin(y)) / cos(y)))) + ((tan(z) / (1.0 - (tan(y) * tan(z)))) - tan(a)));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := N[(x + N[(N[(N[Tan[y], $MachinePrecision] / N[(1.0 - N[(N[(N[Tan[z], $MachinePrecision] * N[Sin[y], $MachinePrecision]), $MachinePrecision] / N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Tan[z], $MachinePrecision] / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\frac{\tan y}{1 - \frac{\tan z \cdot \sin y}{\cos y}} + \left(\frac{\tan z}{1 - \tan y \cdot \tan z} - \tan a\right)\right)
\end{array}
Derivation
  1. Initial program 77.3%

    \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. tan-sumN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    4. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    5. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    6. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    8. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    9. tan-lowering-tan.f6499.7%

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
  4. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{+.f64}\left(x, \left(\left(\tan y + \tan z\right) \cdot \frac{1}{1 - \tan y \cdot \tan z} - \tan \color{blue}{a}\right)\right) \]
    2. fmm-defN/A

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

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

      \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{1}{1 - \tan y \cdot \tan z} \cdot \left(\tan y + \tan z\right) + \left(\mathsf{neg}\left(\color{blue}{\tan a}\right)\right)\right)\right) \]
    5. distribute-lft-inN/A

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

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

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\left(\frac{1}{1 - \tan y \cdot \tan z} \cdot \tan y\right), \color{blue}{\left(\frac{1}{1 - \tan y \cdot \tan z} \cdot \tan z + \left(\mathsf{neg}\left(\tan a\right)\right)\right)}\right)\right) \]
  6. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \left(\tan z \cdot \tan y\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \color{blue}{\mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)}\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    2. tan-quotN/A

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

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

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

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\tan z, \sin y\right), \cos y\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\color{blue}{\mathsf{tan.f64}\left(y\right)}, \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    6. tan-lowering-tan.f64N/A

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

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{sin.f64}\left(y\right)\right), \cos y\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    8. cos-lowering-cos.f6499.7%

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{sin.f64}\left(y\right)\right), \mathsf{cos.f64}\left(y\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \color{blue}{\mathsf{tan.f64}\left(z\right)}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
  8. Applied egg-rr99.7%

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

Alternative 2: 99.7% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ x + \left(\left(\frac{\tan z}{1 - \tan y \cdot \tan z} - \tan a\right) + \frac{\tan y}{1 - \frac{\tan y \cdot \sin z}{\cos z}}\right) \end{array} \]
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
 :precision binary64
 (+
  x
  (+
   (- (/ (tan z) (- 1.0 (* (tan y) (tan z)))) (tan a))
   (/ (tan y) (- 1.0 (/ (* (tan y) (sin z)) (cos z)))))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
	return x + (((tan(z) / (1.0 - (tan(y) * tan(z)))) - tan(a)) + (tan(y) / (1.0 - ((tan(y) * sin(z)) / cos(z)))));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: a
    code = x + (((tan(z) / (1.0d0 - (tan(y) * tan(z)))) - tan(a)) + (tan(y) / (1.0d0 - ((tan(y) * sin(z)) / cos(z)))))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
	return x + (((Math.tan(z) / (1.0 - (Math.tan(y) * Math.tan(z)))) - Math.tan(a)) + (Math.tan(y) / (1.0 - ((Math.tan(y) * Math.sin(z)) / Math.cos(z)))));
}
[x, y, z, a] = sort([x, y, z, a])
def code(x, y, z, a):
	return x + (((math.tan(z) / (1.0 - (math.tan(y) * math.tan(z)))) - math.tan(a)) + (math.tan(y) / (1.0 - ((math.tan(y) * math.sin(z)) / math.cos(z)))))
x, y, z, a = sort([x, y, z, a])
function code(x, y, z, a)
	return Float64(x + Float64(Float64(Float64(tan(z) / Float64(1.0 - Float64(tan(y) * tan(z)))) - tan(a)) + Float64(tan(y) / Float64(1.0 - Float64(Float64(tan(y) * sin(z)) / cos(z))))))
end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
	tmp = x + (((tan(z) / (1.0 - (tan(y) * tan(z)))) - tan(a)) + (tan(y) / (1.0 - ((tan(y) * sin(z)) / cos(z)))));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[Tan[z], $MachinePrecision] / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision] + N[(N[Tan[y], $MachinePrecision] / N[(1.0 - N[(N[(N[Tan[y], $MachinePrecision] * N[Sin[z], $MachinePrecision]), $MachinePrecision] / N[Cos[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\left(\frac{\tan z}{1 - \tan y \cdot \tan z} - \tan a\right) + \frac{\tan y}{1 - \frac{\tan y \cdot \sin z}{\cos z}}\right)
\end{array}
Derivation
  1. Initial program 77.3%

    \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. tan-sumN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    4. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    5. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    6. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    8. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    9. tan-lowering-tan.f6499.7%

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
  4. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{+.f64}\left(x, \left(\left(\tan y + \tan z\right) \cdot \frac{1}{1 - \tan y \cdot \tan z} - \tan \color{blue}{a}\right)\right) \]
    2. fmm-defN/A

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

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

      \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{1}{1 - \tan y \cdot \tan z} \cdot \left(\tan y + \tan z\right) + \left(\mathsf{neg}\left(\color{blue}{\tan a}\right)\right)\right)\right) \]
    5. distribute-lft-inN/A

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

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

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\left(\frac{1}{1 - \tan y \cdot \tan z} \cdot \tan y\right), \color{blue}{\left(\frac{1}{1 - \tan y \cdot \tan z} \cdot \tan z + \left(\mathsf{neg}\left(\tan a\right)\right)\right)}\right)\right) \]
  6. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \frac{\sin z}{\cos z}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \color{blue}{\mathsf{tan.f64}\left(z\right)}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    2. associate-*r/N/A

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

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

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\tan y, \sin z\right), \cos z\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\color{blue}{\mathsf{tan.f64}\left(y\right)}, \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    5. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \sin z\right), \cos z\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(\color{blue}{y}\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    6. sin-lowering-sin.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{sin.f64}\left(z\right)\right), \cos z\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    7. cos-lowering-cos.f6499.7%

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{sin.f64}\left(z\right)\right), \mathsf{cos.f64}\left(z\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \color{blue}{\mathsf{tan.f64}\left(z\right)}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
  8. Applied egg-rr99.7%

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

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

Alternative 3: 99.7% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ x + \left(\frac{\tan y}{1 - \tan y \cdot \tan z} + \left(\frac{\tan z}{1 + \frac{\tan z}{\frac{-1}{\tan y}}} - \tan a\right)\right) \end{array} \]
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
 :precision binary64
 (+
  x
  (+
   (/ (tan y) (- 1.0 (* (tan y) (tan z))))
   (- (/ (tan z) (+ 1.0 (/ (tan z) (/ -1.0 (tan y))))) (tan a)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
	return x + ((tan(y) / (1.0 - (tan(y) * tan(z)))) + ((tan(z) / (1.0 + (tan(z) / (-1.0 / tan(y))))) - tan(a)));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: a
    code = x + ((tan(y) / (1.0d0 - (tan(y) * tan(z)))) + ((tan(z) / (1.0d0 + (tan(z) / ((-1.0d0) / tan(y))))) - tan(a)))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
	return x + ((Math.tan(y) / (1.0 - (Math.tan(y) * Math.tan(z)))) + ((Math.tan(z) / (1.0 + (Math.tan(z) / (-1.0 / Math.tan(y))))) - Math.tan(a)));
}
[x, y, z, a] = sort([x, y, z, a])
def code(x, y, z, a):
	return x + ((math.tan(y) / (1.0 - (math.tan(y) * math.tan(z)))) + ((math.tan(z) / (1.0 + (math.tan(z) / (-1.0 / math.tan(y))))) - math.tan(a)))
x, y, z, a = sort([x, y, z, a])
function code(x, y, z, a)
	return Float64(x + Float64(Float64(tan(y) / Float64(1.0 - Float64(tan(y) * tan(z)))) + Float64(Float64(tan(z) / Float64(1.0 + Float64(tan(z) / Float64(-1.0 / tan(y))))) - tan(a))))
end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
	tmp = x + ((tan(y) / (1.0 - (tan(y) * tan(z)))) + ((tan(z) / (1.0 + (tan(z) / (-1.0 / tan(y))))) - tan(a)));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := N[(x + N[(N[(N[Tan[y], $MachinePrecision] / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Tan[z], $MachinePrecision] / N[(1.0 + N[(N[Tan[z], $MachinePrecision] / N[(-1.0 / N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
x + \left(\frac{\tan y}{1 - \tan y \cdot \tan z} + \left(\frac{\tan z}{1 + \frac{\tan z}{\frac{-1}{\tan y}}} - \tan a\right)\right)
\end{array}
Derivation
  1. Initial program 77.3%

    \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. tan-sumN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    4. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    5. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    6. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    8. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    9. tan-lowering-tan.f6499.7%

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
  4. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{+.f64}\left(x, \left(\left(\tan y + \tan z\right) \cdot \frac{1}{1 - \tan y \cdot \tan z} - \tan \color{blue}{a}\right)\right) \]
    2. fmm-defN/A

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

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

      \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{1}{1 - \tan y \cdot \tan z} \cdot \left(\tan y + \tan z\right) + \left(\mathsf{neg}\left(\color{blue}{\tan a}\right)\right)\right)\right) \]
    5. distribute-lft-inN/A

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

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

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\left(\frac{1}{1 - \tan y \cdot \tan z} \cdot \tan y\right), \color{blue}{\left(\frac{1}{1 - \tan y \cdot \tan z} \cdot \tan z + \left(\mathsf{neg}\left(\tan a\right)\right)\right)}\right)\right) \]
  6. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \left(\tan z \cdot \tan y\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    2. tan-quotN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \left(\tan z \cdot \frac{\sin y}{\cos y}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    3. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \left(\tan z \cdot \frac{1}{\frac{\cos y}{\sin y}}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    4. un-div-invN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \left(\frac{\tan z}{\frac{\cos y}{\sin y}}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\tan z, \left(\frac{\cos y}{\sin y}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    6. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \left(\frac{\cos y}{\sin y}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    7. clear-numN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \left(\frac{1}{\frac{\sin y}{\cos y}}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    8. tan-quotN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \left(\frac{1}{\tan y}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{/.f64}\left(1, \tan y\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
    10. tan-lowering-tan.f6499.7%

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(z\right), \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(y\right)\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right)\right) \]
  8. Applied egg-rr99.7%

    \[\leadsto x + \left(\frac{\tan y}{1 - \tan y \cdot \tan z} + \left(\frac{\tan z}{1 - \color{blue}{\frac{\tan z}{\frac{1}{\tan y}}}} - \tan a\right)\right) \]
  9. Final simplification99.7%

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

Alternative 4: 99.7% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ \begin{array}{l} t_0 := 1 - \tan y \cdot \tan z\\ x + \left(\left(\frac{\tan z}{t\_0} - \tan a\right) + \frac{\tan y}{t\_0}\right) \end{array} \end{array} \]
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
 :precision binary64
 (let* ((t_0 (- 1.0 (* (tan y) (tan z)))))
   (+ x (+ (- (/ (tan z) t_0) (tan a)) (/ (tan y) t_0)))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
	double t_0 = 1.0 - (tan(y) * tan(z));
	return x + (((tan(z) / t_0) - tan(a)) + (tan(y) / t_0));
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
    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 = 1.0d0 - (tan(y) * tan(z))
    code = x + (((tan(z) / t_0) - tan(a)) + (tan(y) / t_0))
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
	double t_0 = 1.0 - (Math.tan(y) * Math.tan(z));
	return x + (((Math.tan(z) / t_0) - Math.tan(a)) + (Math.tan(y) / t_0));
}
[x, y, z, a] = sort([x, y, z, a])
def code(x, y, z, a):
	t_0 = 1.0 - (math.tan(y) * math.tan(z))
	return x + (((math.tan(z) / t_0) - math.tan(a)) + (math.tan(y) / t_0))
x, y, z, a = sort([x, y, z, a])
function code(x, y, z, a)
	t_0 = Float64(1.0 - Float64(tan(y) * tan(z)))
	return Float64(x + Float64(Float64(Float64(tan(z) / t_0) - tan(a)) + Float64(tan(y) / t_0)))
end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp = code(x, y, z, a)
	t_0 = 1.0 - (tan(y) * tan(z));
	tmp = x + (((tan(z) / t_0) - tan(a)) + (tan(y) / t_0));
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(x + N[(N[(N[(N[Tan[z], $MachinePrecision] / t$95$0), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision] + N[(N[Tan[y], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := 1 - \tan y \cdot \tan z\\
x + \left(\left(\frac{\tan z}{t\_0} - \tan a\right) + \frac{\tan y}{t\_0}\right)
\end{array}
\end{array}
Derivation
  1. Initial program 77.3%

    \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. tan-sumN/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
    2. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
    3. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    4. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    5. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    6. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    8. tan-lowering-tan.f64N/A

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    9. tan-lowering-tan.f6499.7%

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
  4. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{+.f64}\left(x, \left(\left(\tan y + \tan z\right) \cdot \frac{1}{1 - \tan y \cdot \tan z} - \tan \color{blue}{a}\right)\right) \]
    2. fmm-defN/A

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

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

      \[\leadsto \mathsf{+.f64}\left(x, \left(\frac{1}{1 - \tan y \cdot \tan z} \cdot \left(\tan y + \tan z\right) + \left(\mathsf{neg}\left(\color{blue}{\tan a}\right)\right)\right)\right) \]
    5. distribute-lft-inN/A

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

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

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\left(\frac{1}{1 - \tan y \cdot \tan z} \cdot \tan y\right), \color{blue}{\left(\frac{1}{1 - \tan y \cdot \tan z} \cdot \tan z + \left(\mathsf{neg}\left(\tan a\right)\right)\right)}\right)\right) \]
  6. Applied egg-rr99.7%

    \[\leadsto x + \color{blue}{\left(\frac{\tan y}{1 - \tan y \cdot \tan z} + \left(\frac{\tan z}{1 - \tan y \cdot \tan z} - \tan a\right)\right)} \]
  7. Final simplification99.7%

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

Alternative 5: 89.0% accurate, 0.3× speedup?

\[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ \begin{array}{l} t_0 := \tan y + \tan z\\ \mathbf{if}\;\tan a \leq -0.005:\\ \;\;\;\;x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - -0.3333333333333333 \cdot \left(z \cdot z\right)}{z}}} - \tan a\right)\\ \mathbf{elif}\;\tan a \leq 10^{-58}:\\ \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - \left(z \cdot z\right) \cdot \left(-0.3333333333333333 + \left(z \cdot z\right) \cdot \left(-0.022222222222222223 + \left(z \cdot z\right) \cdot -0.0021164021164021165\right)\right)}{z}}} - \tan a\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
(FPCore (x y z a)
 :precision binary64
 (let* ((t_0 (+ (tan y) (tan z))))
   (if (<= (tan a) -0.005)
     (+
      x
      (-
       (/
        t_0
        (+ 1.0 (/ (tan y) (/ (- -1.0 (* -0.3333333333333333 (* z z))) z))))
       (tan a)))
     (if (<= (tan a) 1e-58)
       (+ x (- (/ t_0 (- 1.0 (* (tan y) (tan z)))) a))
       (+
        x
        (-
         (/
          t_0
          (+
           1.0
           (/
            (tan y)
            (/
             (-
              -1.0
              (*
               (* z z)
               (+
                -0.3333333333333333
                (*
                 (* z z)
                 (+
                  -0.022222222222222223
                  (* (* z z) -0.0021164021164021165))))))
             z))))
         (tan a)))))))
assert(x < y && y < z && z < a);
double code(double x, double y, double z, double a) {
	double t_0 = tan(y) + tan(z);
	double tmp;
	if (tan(a) <= -0.005) {
		tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - tan(a));
	} else if (tan(a) <= 1e-58) {
		tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
	} else {
		tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + ((z * z) * (-0.022222222222222223 + ((z * z) * -0.0021164021164021165)))))) / z)))) - tan(a));
	}
	return tmp;
}
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: a
    real(8) :: t_0
    real(8) :: tmp
    t_0 = tan(y) + tan(z)
    if (tan(a) <= (-0.005d0)) then
        tmp = x + ((t_0 / (1.0d0 + (tan(y) / (((-1.0d0) - ((-0.3333333333333333d0) * (z * z))) / z)))) - tan(a))
    else if (tan(a) <= 1d-58) then
        tmp = x + ((t_0 / (1.0d0 - (tan(y) * tan(z)))) - a)
    else
        tmp = x + ((t_0 / (1.0d0 + (tan(y) / (((-1.0d0) - ((z * z) * ((-0.3333333333333333d0) + ((z * z) * ((-0.022222222222222223d0) + ((z * z) * (-0.0021164021164021165d0))))))) / z)))) - tan(a))
    end if
    code = tmp
end function
assert x < y && y < z && z < a;
public static double code(double x, double y, double z, double a) {
	double t_0 = Math.tan(y) + Math.tan(z);
	double tmp;
	if (Math.tan(a) <= -0.005) {
		tmp = x + ((t_0 / (1.0 + (Math.tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - Math.tan(a));
	} else if (Math.tan(a) <= 1e-58) {
		tmp = x + ((t_0 / (1.0 - (Math.tan(y) * Math.tan(z)))) - a);
	} else {
		tmp = x + ((t_0 / (1.0 + (Math.tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + ((z * z) * (-0.022222222222222223 + ((z * z) * -0.0021164021164021165)))))) / z)))) - Math.tan(a));
	}
	return tmp;
}
[x, y, z, a] = sort([x, y, z, a])
def code(x, y, z, a):
	t_0 = math.tan(y) + math.tan(z)
	tmp = 0
	if math.tan(a) <= -0.005:
		tmp = x + ((t_0 / (1.0 + (math.tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - math.tan(a))
	elif math.tan(a) <= 1e-58:
		tmp = x + ((t_0 / (1.0 - (math.tan(y) * math.tan(z)))) - a)
	else:
		tmp = x + ((t_0 / (1.0 + (math.tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + ((z * z) * (-0.022222222222222223 + ((z * z) * -0.0021164021164021165)))))) / z)))) - math.tan(a))
	return tmp
x, y, z, a = sort([x, y, z, a])
function code(x, y, z, a)
	t_0 = Float64(tan(y) + tan(z))
	tmp = 0.0
	if (tan(a) <= -0.005)
		tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 + Float64(tan(y) / Float64(Float64(-1.0 - Float64(-0.3333333333333333 * Float64(z * z))) / z)))) - tan(a)));
	elseif (tan(a) <= 1e-58)
		tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))) - a));
	else
		tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 + Float64(tan(y) / Float64(Float64(-1.0 - Float64(Float64(z * z) * Float64(-0.3333333333333333 + Float64(Float64(z * z) * Float64(-0.022222222222222223 + Float64(Float64(z * z) * -0.0021164021164021165)))))) / z)))) - tan(a)));
	end
	return tmp
end
x, y, z, a = num2cell(sort([x, y, z, a])){:}
function tmp_2 = code(x, y, z, a)
	t_0 = tan(y) + tan(z);
	tmp = 0.0;
	if (tan(a) <= -0.005)
		tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - tan(a));
	elseif (tan(a) <= 1e-58)
		tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
	else
		tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + ((z * z) * (-0.022222222222222223 + ((z * z) * -0.0021164021164021165)))))) / z)))) - tan(a));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.005], N[(x + N[(N[(t$95$0 / N[(1.0 + N[(N[Tan[y], $MachinePrecision] / N[(N[(-1.0 - N[(-0.3333333333333333 * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 1e-58], N[(x + N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t$95$0 / N[(1.0 + N[(N[Tan[y], $MachinePrecision] / N[(N[(-1.0 - N[(N[(z * z), $MachinePrecision] * N[(-0.3333333333333333 + N[(N[(z * z), $MachinePrecision] * N[(-0.022222222222222223 + N[(N[(z * z), $MachinePrecision] * -0.0021164021164021165), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
\\
\begin{array}{l}
t_0 := \tan y + \tan z\\
\mathbf{if}\;\tan a \leq -0.005:\\
\;\;\;\;x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - -0.3333333333333333 \cdot \left(z \cdot z\right)}{z}}} - \tan a\right)\\

\mathbf{elif}\;\tan a \leq 10^{-58}:\\
\;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - \left(z \cdot z\right) \cdot \left(-0.3333333333333333 + \left(z \cdot z\right) \cdot \left(-0.022222222222222223 + \left(z \cdot z\right) \cdot -0.0021164021164021165\right)\right)}{z}}} - \tan a\right)\\


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

    1. Initial program 75.0%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. tan-sumN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      4. tan-lowering-tan.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      5. tan-lowering-tan.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      8. tan-lowering-tan.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      9. tan-lowering-tan.f6499.7%

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    4. Applied egg-rr99.7%

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

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \frac{\sin z}{\cos z}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \frac{1}{\frac{\cos z}{\sin z}}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      3. un-div-invN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\tan y}{\frac{\cos z}{\sin z}}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\tan y, \left(\frac{\cos z}{\sin z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      5. tan-lowering-tan.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{\cos z}{\sin z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      6. clear-numN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{1}{\frac{\sin z}{\cos z}}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      7. tan-quotN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{1}{\tan z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(1, \tan z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      9. tan-lowering-tan.f6499.7%

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(z\right)\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    6. Applied egg-rr99.7%

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

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

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\left(1 + \frac{-1}{3} \cdot {z}^{2}\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{3} \cdot {z}^{2}\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{3}, \left({z}^{2}\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{3}, \left(z \cdot z\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      5. *-lowering-*.f6476.1%

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(z, z\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    9. Simplified76.1%

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

    if -0.0050000000000000001 < (tan.f64 a) < 1e-58

    1. Initial program 77.1%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. tan-sumN/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      4. tan-lowering-tan.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      5. tan-lowering-tan.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      8. tan-lowering-tan.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      9. tan-lowering-tan.f6499.7%

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    4. Applied egg-rr99.7%

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

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \color{blue}{a}\right)\right) \]
    6. Step-by-step derivation
      1. Simplified99.7%

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

      if 1e-58 < (tan.f64 a)

      1. Initial program 79.5%

        \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. tan-sumN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        4. tan-lowering-tan.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        5. tan-lowering-tan.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        6. --lowering--.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        8. tan-lowering-tan.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        9. tan-lowering-tan.f6499.6%

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      4. Applied egg-rr99.6%

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

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \frac{\sin z}{\cos z}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        2. clear-numN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \frac{1}{\frac{\cos z}{\sin z}}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        3. un-div-invN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\tan y}{\frac{\cos z}{\sin z}}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\tan y, \left(\frac{\cos z}{\sin z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        5. tan-lowering-tan.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{\cos z}{\sin z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        6. clear-numN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{1}{\frac{\sin z}{\cos z}}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        7. tan-quotN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{1}{\tan z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        8. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(1, \tan z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        9. tan-lowering-tan.f6499.6%

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(z\right)\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      6. Applied egg-rr99.6%

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

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \color{blue}{\left(\frac{1 + {z}^{2} \cdot \left({z}^{2} \cdot \left(\frac{-2}{945} \cdot {z}^{2} - \frac{1}{45}\right) - \frac{1}{3}\right)}{z}\right)}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\left(1 + {z}^{2} \cdot \left({z}^{2} \cdot \left(\frac{-2}{945} \cdot {z}^{2} - \frac{1}{45}\right) - \frac{1}{3}\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      9. Simplified79.7%

        \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \frac{\tan y}{\color{blue}{\frac{1 + \left(z \cdot z\right) \cdot \left(-0.3333333333333333 + \left(z \cdot z\right) \cdot \left(-0.022222222222222223 + \left(z \cdot z\right) \cdot -0.0021164021164021165\right)\right)}{z}}}} - \tan a\right) \]
    7. Recombined 3 regimes into one program.
    8. Final simplification88.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\tan a \leq -0.005:\\ \;\;\;\;x + \left(\frac{\tan y + \tan z}{1 + \frac{\tan y}{\frac{-1 - -0.3333333333333333 \cdot \left(z \cdot z\right)}{z}}} - \tan a\right)\\ \mathbf{elif}\;\tan a \leq 10^{-58}:\\ \;\;\;\;x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\frac{\tan y + \tan z}{1 + \frac{\tan y}{\frac{-1 - \left(z \cdot z\right) \cdot \left(-0.3333333333333333 + \left(z \cdot z\right) \cdot \left(-0.022222222222222223 + \left(z \cdot z\right) \cdot -0.0021164021164021165\right)\right)}{z}}} - \tan a\right)\\ \end{array} \]
    9. Add Preprocessing

    Alternative 6: 89.0% accurate, 0.3× speedup?

    \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ \begin{array}{l} t_0 := \tan y + \tan z\\ \mathbf{if}\;\tan a \leq -0.005:\\ \;\;\;\;x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - -0.3333333333333333 \cdot \left(z \cdot z\right)}{z}}} - \tan a\right)\\ \mathbf{elif}\;\tan a \leq 10^{-58}:\\ \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - \left(z \cdot z\right) \cdot \left(-0.3333333333333333 + z \cdot \left(z \cdot -0.022222222222222223\right)\right)}{z}}} - \tan a\right)\\ \end{array} \end{array} \]
    NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
    (FPCore (x y z a)
     :precision binary64
     (let* ((t_0 (+ (tan y) (tan z))))
       (if (<= (tan a) -0.005)
         (+
          x
          (-
           (/
            t_0
            (+ 1.0 (/ (tan y) (/ (- -1.0 (* -0.3333333333333333 (* z z))) z))))
           (tan a)))
         (if (<= (tan a) 1e-58)
           (+ x (- (/ t_0 (- 1.0 (* (tan y) (tan z)))) a))
           (+
            x
            (-
             (/
              t_0
              (+
               1.0
               (/
                (tan y)
                (/
                 (-
                  -1.0
                  (*
                   (* z z)
                   (+ -0.3333333333333333 (* z (* z -0.022222222222222223)))))
                 z))))
             (tan a)))))))
    assert(x < y && y < z && z < a);
    double code(double x, double y, double z, double a) {
    	double t_0 = tan(y) + tan(z);
    	double tmp;
    	if (tan(a) <= -0.005) {
    		tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - tan(a));
    	} else if (tan(a) <= 1e-58) {
    		tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
    	} else {
    		tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + (z * (z * -0.022222222222222223))))) / z)))) - tan(a));
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
    real(8) function code(x, y, z, a)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: a
        real(8) :: t_0
        real(8) :: tmp
        t_0 = tan(y) + tan(z)
        if (tan(a) <= (-0.005d0)) then
            tmp = x + ((t_0 / (1.0d0 + (tan(y) / (((-1.0d0) - ((-0.3333333333333333d0) * (z * z))) / z)))) - tan(a))
        else if (tan(a) <= 1d-58) then
            tmp = x + ((t_0 / (1.0d0 - (tan(y) * tan(z)))) - a)
        else
            tmp = x + ((t_0 / (1.0d0 + (tan(y) / (((-1.0d0) - ((z * z) * ((-0.3333333333333333d0) + (z * (z * (-0.022222222222222223d0)))))) / z)))) - tan(a))
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < a;
    public static double code(double x, double y, double z, double a) {
    	double t_0 = Math.tan(y) + Math.tan(z);
    	double tmp;
    	if (Math.tan(a) <= -0.005) {
    		tmp = x + ((t_0 / (1.0 + (Math.tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - Math.tan(a));
    	} else if (Math.tan(a) <= 1e-58) {
    		tmp = x + ((t_0 / (1.0 - (Math.tan(y) * Math.tan(z)))) - a);
    	} else {
    		tmp = x + ((t_0 / (1.0 + (Math.tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + (z * (z * -0.022222222222222223))))) / z)))) - Math.tan(a));
    	}
    	return tmp;
    }
    
    [x, y, z, a] = sort([x, y, z, a])
    def code(x, y, z, a):
    	t_0 = math.tan(y) + math.tan(z)
    	tmp = 0
    	if math.tan(a) <= -0.005:
    		tmp = x + ((t_0 / (1.0 + (math.tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - math.tan(a))
    	elif math.tan(a) <= 1e-58:
    		tmp = x + ((t_0 / (1.0 - (math.tan(y) * math.tan(z)))) - a)
    	else:
    		tmp = x + ((t_0 / (1.0 + (math.tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + (z * (z * -0.022222222222222223))))) / z)))) - math.tan(a))
    	return tmp
    
    x, y, z, a = sort([x, y, z, a])
    function code(x, y, z, a)
    	t_0 = Float64(tan(y) + tan(z))
    	tmp = 0.0
    	if (tan(a) <= -0.005)
    		tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 + Float64(tan(y) / Float64(Float64(-1.0 - Float64(-0.3333333333333333 * Float64(z * z))) / z)))) - tan(a)));
    	elseif (tan(a) <= 1e-58)
    		tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))) - a));
    	else
    		tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 + Float64(tan(y) / Float64(Float64(-1.0 - Float64(Float64(z * z) * Float64(-0.3333333333333333 + Float64(z * Float64(z * -0.022222222222222223))))) / z)))) - tan(a)));
    	end
    	return tmp
    end
    
    x, y, z, a = num2cell(sort([x, y, z, a])){:}
    function tmp_2 = code(x, y, z, a)
    	t_0 = tan(y) + tan(z);
    	tmp = 0.0;
    	if (tan(a) <= -0.005)
    		tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - tan(a));
    	elseif (tan(a) <= 1e-58)
    		tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
    	else
    		tmp = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - ((z * z) * (-0.3333333333333333 + (z * (z * -0.022222222222222223))))) / z)))) - tan(a));
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
    code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.005], N[(x + N[(N[(t$95$0 / N[(1.0 + N[(N[Tan[y], $MachinePrecision] / N[(N[(-1.0 - N[(-0.3333333333333333 * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 1e-58], N[(x + N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t$95$0 / N[(1.0 + N[(N[Tan[y], $MachinePrecision] / N[(N[(-1.0 - N[(N[(z * z), $MachinePrecision] * N[(-0.3333333333333333 + N[(z * N[(z * -0.022222222222222223), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
    \\
    \begin{array}{l}
    t_0 := \tan y + \tan z\\
    \mathbf{if}\;\tan a \leq -0.005:\\
    \;\;\;\;x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - -0.3333333333333333 \cdot \left(z \cdot z\right)}{z}}} - \tan a\right)\\
    
    \mathbf{elif}\;\tan a \leq 10^{-58}:\\
    \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - \left(z \cdot z\right) \cdot \left(-0.3333333333333333 + z \cdot \left(z \cdot -0.022222222222222223\right)\right)}{z}}} - \tan a\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (tan.f64 a) < -0.0050000000000000001

      1. Initial program 75.0%

        \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. tan-sumN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        4. tan-lowering-tan.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        5. tan-lowering-tan.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        6. --lowering--.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        8. tan-lowering-tan.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        9. tan-lowering-tan.f6499.7%

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      4. Applied egg-rr99.7%

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

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \frac{\sin z}{\cos z}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        2. clear-numN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \frac{1}{\frac{\cos z}{\sin z}}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        3. un-div-invN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\tan y}{\frac{\cos z}{\sin z}}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\tan y, \left(\frac{\cos z}{\sin z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        5. tan-lowering-tan.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{\cos z}{\sin z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        6. clear-numN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{1}{\frac{\sin z}{\cos z}}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        7. tan-quotN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{1}{\tan z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        8. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(1, \tan z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        9. tan-lowering-tan.f6499.7%

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(z\right)\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      6. Applied egg-rr99.7%

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

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

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\left(1 + \frac{-1}{3} \cdot {z}^{2}\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{3} \cdot {z}^{2}\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{3}, \left({z}^{2}\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{3}, \left(z \cdot z\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        5. *-lowering-*.f6476.1%

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(z, z\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      9. Simplified76.1%

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

      if -0.0050000000000000001 < (tan.f64 a) < 1e-58

      1. Initial program 77.1%

        \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. tan-sumN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        4. tan-lowering-tan.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        5. tan-lowering-tan.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        6. --lowering--.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        8. tan-lowering-tan.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        9. tan-lowering-tan.f6499.7%

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      4. Applied egg-rr99.7%

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

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \color{blue}{a}\right)\right) \]
      6. Step-by-step derivation
        1. Simplified99.7%

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

        if 1e-58 < (tan.f64 a)

        1. Initial program 79.5%

          \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. tan-sumN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          4. tan-lowering-tan.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          5. tan-lowering-tan.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          6. --lowering--.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          8. tan-lowering-tan.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          9. tan-lowering-tan.f6499.6%

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        4. Applied egg-rr99.6%

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

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \frac{\sin z}{\cos z}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          2. clear-numN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \frac{1}{\frac{\cos z}{\sin z}}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          3. un-div-invN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\tan y}{\frac{\cos z}{\sin z}}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          4. /-lowering-/.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\tan y, \left(\frac{\cos z}{\sin z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          5. tan-lowering-tan.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{\cos z}{\sin z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          6. clear-numN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{1}{\frac{\sin z}{\cos z}}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          7. tan-quotN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{1}{\tan z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          8. /-lowering-/.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(1, \tan z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          9. tan-lowering-tan.f6499.6%

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(z\right)\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        6. Applied egg-rr99.6%

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

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \color{blue}{\left(\frac{1 + {z}^{2} \cdot \left(\frac{-1}{45} \cdot {z}^{2} - \frac{1}{3}\right)}{z}\right)}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        8. Step-by-step derivation
          1. /-lowering-/.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\left(1 + {z}^{2} \cdot \left(\frac{-1}{45} \cdot {z}^{2} - \frac{1}{3}\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left({z}^{2} \cdot \left(\frac{-1}{45} \cdot {z}^{2} - \frac{1}{3}\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({z}^{2}\right), \left(\frac{-1}{45} \cdot {z}^{2} - \frac{1}{3}\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(z \cdot z\right), \left(\frac{-1}{45} \cdot {z}^{2} - \frac{1}{3}\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), \left(\frac{-1}{45} \cdot {z}^{2} - \frac{1}{3}\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          6. sub-negN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), \left(\frac{-1}{45} \cdot {z}^{2} + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), \left(\frac{-1}{45} \cdot {z}^{2} + \frac{-1}{3}\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          8. +-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), \left(\frac{-1}{3} + \frac{-1}{45} \cdot {z}^{2}\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          9. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), \mathsf{+.f64}\left(\frac{-1}{3}, \left(\frac{-1}{45} \cdot {z}^{2}\right)\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          10. *-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), \mathsf{+.f64}\left(\frac{-1}{3}, \left({z}^{2} \cdot \frac{-1}{45}\right)\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          11. unpow2N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), \mathsf{+.f64}\left(\frac{-1}{3}, \left(\left(z \cdot z\right) \cdot \frac{-1}{45}\right)\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          12. associate-*l*N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), \mathsf{+.f64}\left(\frac{-1}{3}, \left(z \cdot \left(z \cdot \frac{-1}{45}\right)\right)\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          13. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(z, \left(z \cdot \frac{-1}{45}\right)\right)\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          14. *-lowering-*.f6479.7%

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(z, z\right), \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(z, \mathsf{*.f64}\left(z, \frac{-1}{45}\right)\right)\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        9. Simplified79.7%

          \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \frac{\tan y}{\color{blue}{\frac{1 + \left(z \cdot z\right) \cdot \left(-0.3333333333333333 + z \cdot \left(z \cdot -0.022222222222222223\right)\right)}{z}}}} - \tan a\right) \]
      7. Recombined 3 regimes into one program.
      8. Final simplification88.3%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\tan a \leq -0.005:\\ \;\;\;\;x + \left(\frac{\tan y + \tan z}{1 + \frac{\tan y}{\frac{-1 - -0.3333333333333333 \cdot \left(z \cdot z\right)}{z}}} - \tan a\right)\\ \mathbf{elif}\;\tan a \leq 10^{-58}:\\ \;\;\;\;x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\frac{\tan y + \tan z}{1 + \frac{\tan y}{\frac{-1 - \left(z \cdot z\right) \cdot \left(-0.3333333333333333 + z \cdot \left(z \cdot -0.022222222222222223\right)\right)}{z}}} - \tan a\right)\\ \end{array} \]
      9. Add Preprocessing

      Alternative 7: 88.7% accurate, 0.3× speedup?

      \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ \begin{array}{l} t_0 := \tan y + \tan z\\ \mathbf{if}\;\tan a \leq -0.005:\\ \;\;\;\;x + \left(t\_0 - \tan a\right)\\ \mathbf{elif}\;\tan a \leq 10^{-58}:\\ \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1, t\_0, x - \tan a\right)\\ \end{array} \end{array} \]
      NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
      (FPCore (x y z a)
       :precision binary64
       (let* ((t_0 (+ (tan y) (tan z))))
         (if (<= (tan a) -0.005)
           (+ x (- t_0 (tan a)))
           (if (<= (tan a) 1e-58)
             (+ x (- (/ t_0 (- 1.0 (* (tan y) (tan z)))) a))
             (fma 1.0 t_0 (- x (tan a)))))))
      assert(x < y && y < z && z < a);
      double code(double x, double y, double z, double a) {
      	double t_0 = tan(y) + tan(z);
      	double tmp;
      	if (tan(a) <= -0.005) {
      		tmp = x + (t_0 - tan(a));
      	} else if (tan(a) <= 1e-58) {
      		tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
      	} else {
      		tmp = fma(1.0, t_0, (x - tan(a)));
      	}
      	return tmp;
      }
      
      x, y, z, a = sort([x, y, z, a])
      function code(x, y, z, a)
      	t_0 = Float64(tan(y) + tan(z))
      	tmp = 0.0
      	if (tan(a) <= -0.005)
      		tmp = Float64(x + Float64(t_0 - tan(a)));
      	elseif (tan(a) <= 1e-58)
      		tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))) - a));
      	else
      		tmp = fma(1.0, t_0, Float64(x - tan(a)));
      	end
      	return tmp
      end
      
      NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
      code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.005], N[(x + N[(t$95$0 - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Tan[a], $MachinePrecision], 1e-58], N[(x + N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], N[(1.0 * t$95$0 + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
      \\
      \begin{array}{l}
      t_0 := \tan y + \tan z\\
      \mathbf{if}\;\tan a \leq -0.005:\\
      \;\;\;\;x + \left(t\_0 - \tan a\right)\\
      
      \mathbf{elif}\;\tan a \leq 10^{-58}:\\
      \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(1, t\_0, x - \tan a\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (tan.f64 a) < -0.0050000000000000001

        1. Initial program 75.0%

          \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. tan-sumN/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          4. tan-lowering-tan.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          5. tan-lowering-tan.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          6. --lowering--.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          8. tan-lowering-tan.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          9. tan-lowering-tan.f6499.7%

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        4. Applied egg-rr99.7%

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

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \color{blue}{1}\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        6. Step-by-step derivation
          1. Simplified75.4%

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

          if -0.0050000000000000001 < (tan.f64 a) < 1e-58

          1. Initial program 77.1%

            \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. tan-sumN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
            2. /-lowering-/.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
            3. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
            4. tan-lowering-tan.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
            5. tan-lowering-tan.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
            6. --lowering--.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
            7. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
            8. tan-lowering-tan.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
            9. tan-lowering-tan.f6499.7%

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          4. Applied egg-rr99.7%

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

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \color{blue}{a}\right)\right) \]
          6. Step-by-step derivation
            1. Simplified99.7%

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

            if 1e-58 < (tan.f64 a)

            1. Initial program 79.5%

              \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. +-commutativeN/A

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

                \[\leadsto \left(\tan \left(y + z\right) + \left(\mathsf{neg}\left(\tan a\right)\right)\right) + x \]
              3. associate-+l+N/A

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \left(\tan y + \tan z\right), \left(\left(\mathsf{neg}\left(\tan a\right)\right) + x\right)\right) \]
              11. *-lowering-*.f64N/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \left(\tan y + \tan z\right), \left(\left(\mathsf{neg}\left(\tan a\right)\right) + x\right)\right) \]
              12. tan-lowering-tan.f64N/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \left(\tan y + \tan z\right), \left(\left(\mathsf{neg}\left(\tan a\right)\right) + x\right)\right) \]
              13. tan-lowering-tan.f64N/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \left(\tan y + \tan z\right), \left(\left(\mathsf{neg}\left(\tan a\right)\right) + x\right)\right) \]
              14. +-lowering-+.f64N/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{+.f64}\left(\tan y, \color{blue}{\tan z}\right), \left(\left(\mathsf{neg}\left(\tan a\right)\right) + x\right)\right) \]
              15. tan-lowering-tan.f64N/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan \color{blue}{z}\right), \left(\left(\mathsf{neg}\left(\tan a\right)\right) + x\right)\right) \]
              16. tan-lowering-tan.f64N/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(\left(\mathsf{neg}\left(\tan a\right)\right) + x\right)\right) \]
              17. +-commutativeN/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(x + \left(\mathsf{neg}\left(\tan a\right)\right)\right)\right) \]
              18. sub-negN/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(x - \tan a\right)\right) \]
              19. --lowering--.f64N/A

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(x, \tan a\right)\right) \]
              20. tan-lowering-tan.f6499.7%

                \[\leadsto \mathsf{fma.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(x, \mathsf{tan.f64}\left(a\right)\right)\right) \]
            4. Applied egg-rr99.7%

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

              \[\leadsto \mathsf{fma.f64}\left(\color{blue}{1}, \mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(x, \mathsf{tan.f64}\left(a\right)\right)\right) \]
            6. Step-by-step derivation
              1. Simplified79.7%

                \[\leadsto \mathsf{fma}\left(\color{blue}{1}, \tan y + \tan z, x - \tan a\right) \]
            7. Recombined 3 regimes into one program.
            8. Final simplification88.2%

              \[\leadsto \begin{array}{l} \mathbf{if}\;\tan a \leq -0.005:\\ \;\;\;\;x + \left(\left(\tan y + \tan z\right) - \tan a\right)\\ \mathbf{elif}\;\tan a \leq 10^{-58}:\\ \;\;\;\;x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - a\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1, \tan y + \tan z, x - \tan a\right)\\ \end{array} \]
            9. Add Preprocessing

            Alternative 8: 99.7% accurate, 0.4× speedup?

            \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ x + \left(\frac{1}{\frac{1 - \tan y \cdot \tan z}{\tan y + \tan z}} - \tan a\right) \end{array} \]
            NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
            (FPCore (x y z a)
             :precision binary64
             (+ x (- (/ 1.0 (/ (- 1.0 (* (tan y) (tan z))) (+ (tan y) (tan z)))) (tan a))))
            assert(x < y && y < z && z < a);
            double code(double x, double y, double z, double a) {
            	return x + ((1.0 / ((1.0 - (tan(y) * tan(z))) / (tan(y) + tan(z)))) - tan(a));
            }
            
            NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
            real(8) function code(x, y, z, a)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: a
                code = x + ((1.0d0 / ((1.0d0 - (tan(y) * tan(z))) / (tan(y) + tan(z)))) - tan(a))
            end function
            
            assert x < y && y < z && z < a;
            public static double code(double x, double y, double z, double a) {
            	return x + ((1.0 / ((1.0 - (Math.tan(y) * Math.tan(z))) / (Math.tan(y) + Math.tan(z)))) - Math.tan(a));
            }
            
            [x, y, z, a] = sort([x, y, z, a])
            def code(x, y, z, a):
            	return x + ((1.0 / ((1.0 - (math.tan(y) * math.tan(z))) / (math.tan(y) + math.tan(z)))) - math.tan(a))
            
            x, y, z, a = sort([x, y, z, a])
            function code(x, y, z, a)
            	return Float64(x + Float64(Float64(1.0 / Float64(Float64(1.0 - Float64(tan(y) * tan(z))) / Float64(tan(y) + tan(z)))) - tan(a)))
            end
            
            x, y, z, a = num2cell(sort([x, y, z, a])){:}
            function tmp = code(x, y, z, a)
            	tmp = x + ((1.0 / ((1.0 - (tan(y) * tan(z))) / (tan(y) + tan(z)))) - tan(a));
            end
            
            NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
            code[x_, y_, z_, a_] := N[(x + N[(N[(1.0 / N[(N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
            \\
            x + \left(\frac{1}{\frac{1 - \tan y \cdot \tan z}{\tan y + \tan z}} - \tan a\right)
            \end{array}
            
            Derivation
            1. Initial program 77.3%

              \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. tan-sumN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
              2. /-lowering-/.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
              3. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              4. tan-lowering-tan.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              5. tan-lowering-tan.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              6. --lowering--.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              7. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              8. tan-lowering-tan.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              9. tan-lowering-tan.f6499.7%

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
            4. Applied egg-rr99.7%

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

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \frac{\sin z}{\cos z}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              2. clear-numN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \frac{1}{\frac{\cos z}{\sin z}}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              3. un-div-invN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\tan y}{\frac{\cos z}{\sin z}}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              4. /-lowering-/.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\tan y, \left(\frac{\cos z}{\sin z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              5. tan-lowering-tan.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{\cos z}{\sin z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              6. clear-numN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{1}{\frac{\sin z}{\cos z}}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              7. tan-quotN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{1}{\tan z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              8. /-lowering-/.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(1, \tan z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              9. tan-lowering-tan.f6499.7%

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(z\right)\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
            6. Applied egg-rr99.7%

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

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

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{1 - \frac{\tan y}{\frac{1}{\tan z}}}{\tan y + \tan z}\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
              3. metadata-evalN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\frac{1}{1} - \frac{\tan y}{\frac{1}{\tan z}}}{\tan y + \tan z}\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              4. associate-/r/N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\frac{1}{1} - \frac{\tan y}{1} \cdot \tan z}{\tan y + \tan z}\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              5. associate-*l/N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\frac{1}{1} - \frac{\tan y \cdot \tan z}{1}}{\tan y + \tan z}\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              6. div-subN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\frac{1 - \tan y \cdot \tan z}{1}}{\tan y + \tan z}\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              7. div-invN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\left(1 - \tan y \cdot \tan z\right) \cdot \frac{1}{1}}{\tan y + \tan z}\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              8. metadata-evalN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{\left(1 - \tan y \cdot \tan z\right) \cdot 1}{\tan y + \tan z}\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              9. associate-*r/N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\left(1 - \tan y \cdot \tan z\right) \cdot \frac{1}{\tan y + \tan z}\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              10. div-invN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \left(\frac{1 - \tan y \cdot \tan z}{\tan y + \tan z}\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              11. /-lowering-/.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(1 - \tan y \cdot \tan z\right), \left(\tan y + \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              12. --lowering--.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right), \left(\tan y + \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              13. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right), \left(\tan y + \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              14. tan-lowering-tan.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right), \left(\tan y + \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              15. tan-lowering-tan.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right), \left(\tan y + \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              16. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right), \mathsf{+.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              17. tan-lowering-tan.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right), \mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              18. tan-lowering-tan.f6499.7%

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right), \mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
            8. Applied egg-rr99.7%

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

            Alternative 9: 99.7% accurate, 0.4× speedup?

            \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right) \end{array} \]
            NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
            (FPCore (x y z a)
             :precision binary64
             (+ x (- (/ (+ (tan y) (tan z)) (- 1.0 (* (tan y) (tan z)))) (tan a))))
            assert(x < y && y < z && z < a);
            double code(double x, double y, double z, double a) {
            	return x + (((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z)))) - tan(a));
            }
            
            NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
            real(8) function code(x, y, z, a)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: a
                code = x + (((tan(y) + tan(z)) / (1.0d0 - (tan(y) * tan(z)))) - tan(a))
            end function
            
            assert x < y && y < z && z < a;
            public static double code(double x, double y, double z, double a) {
            	return x + (((Math.tan(y) + Math.tan(z)) / (1.0 - (Math.tan(y) * Math.tan(z)))) - Math.tan(a));
            }
            
            [x, y, z, a] = sort([x, y, z, a])
            def code(x, y, z, a):
            	return x + (((math.tan(y) + math.tan(z)) / (1.0 - (math.tan(y) * math.tan(z)))) - math.tan(a))
            
            x, y, z, a = sort([x, y, z, a])
            function code(x, y, z, a)
            	return Float64(x + Float64(Float64(Float64(tan(y) + tan(z)) / Float64(1.0 - Float64(tan(y) * tan(z)))) - tan(a)))
            end
            
            x, y, z, a = num2cell(sort([x, y, z, a])){:}
            function tmp = code(x, y, z, a)
            	tmp = x + (((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z)))) - tan(a));
            end
            
            NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
            code[x_, y_, z_, a_] := N[(x + N[(N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
            \\
            x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)
            \end{array}
            
            Derivation
            1. Initial program 77.3%

              \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. tan-sumN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
              2. /-lowering-/.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
              3. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              4. tan-lowering-tan.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              5. tan-lowering-tan.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              6. --lowering--.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              7. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              8. tan-lowering-tan.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              9. tan-lowering-tan.f6499.7%

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
            4. Applied egg-rr99.7%

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

            Alternative 10: 89.1% accurate, 0.5× speedup?

            \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ \begin{array}{l} t_0 := \tan y + \tan z\\ t_1 := x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - -0.3333333333333333 \cdot \left(z \cdot z\right)}{z}}} - \tan a\right)\\ \mathbf{if}\;a \leq -0.0004:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-54}:\\ \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
            (FPCore (x y z a)
             :precision binary64
             (let* ((t_0 (+ (tan y) (tan z)))
                    (t_1
                     (+
                      x
                      (-
                       (/
                        t_0
                        (+ 1.0 (/ (tan y) (/ (- -1.0 (* -0.3333333333333333 (* z z))) z))))
                       (tan a)))))
               (if (<= a -0.0004)
                 t_1
                 (if (<= a 2.8e-54) (+ x (- (/ t_0 (- 1.0 (* (tan y) (tan z)))) a)) t_1))))
            assert(x < y && y < z && z < a);
            double code(double x, double y, double z, double a) {
            	double t_0 = tan(y) + tan(z);
            	double t_1 = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - tan(a));
            	double tmp;
            	if (a <= -0.0004) {
            		tmp = t_1;
            	} else if (a <= 2.8e-54) {
            		tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
            real(8) function code(x, y, z, a)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8), intent (in) :: a
                real(8) :: t_0
                real(8) :: t_1
                real(8) :: tmp
                t_0 = tan(y) + tan(z)
                t_1 = x + ((t_0 / (1.0d0 + (tan(y) / (((-1.0d0) - ((-0.3333333333333333d0) * (z * z))) / z)))) - tan(a))
                if (a <= (-0.0004d0)) then
                    tmp = t_1
                else if (a <= 2.8d-54) then
                    tmp = x + ((t_0 / (1.0d0 - (tan(y) * tan(z)))) - a)
                else
                    tmp = t_1
                end if
                code = tmp
            end function
            
            assert x < y && y < z && z < a;
            public static double code(double x, double y, double z, double a) {
            	double t_0 = Math.tan(y) + Math.tan(z);
            	double t_1 = x + ((t_0 / (1.0 + (Math.tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - Math.tan(a));
            	double tmp;
            	if (a <= -0.0004) {
            		tmp = t_1;
            	} else if (a <= 2.8e-54) {
            		tmp = x + ((t_0 / (1.0 - (Math.tan(y) * Math.tan(z)))) - a);
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            [x, y, z, a] = sort([x, y, z, a])
            def code(x, y, z, a):
            	t_0 = math.tan(y) + math.tan(z)
            	t_1 = x + ((t_0 / (1.0 + (math.tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - math.tan(a))
            	tmp = 0
            	if a <= -0.0004:
            		tmp = t_1
            	elif a <= 2.8e-54:
            		tmp = x + ((t_0 / (1.0 - (math.tan(y) * math.tan(z)))) - a)
            	else:
            		tmp = t_1
            	return tmp
            
            x, y, z, a = sort([x, y, z, a])
            function code(x, y, z, a)
            	t_0 = Float64(tan(y) + tan(z))
            	t_1 = Float64(x + Float64(Float64(t_0 / Float64(1.0 + Float64(tan(y) / Float64(Float64(-1.0 - Float64(-0.3333333333333333 * Float64(z * z))) / z)))) - tan(a)))
            	tmp = 0.0
            	if (a <= -0.0004)
            		tmp = t_1;
            	elseif (a <= 2.8e-54)
            		tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))) - a));
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            x, y, z, a = num2cell(sort([x, y, z, a])){:}
            function tmp_2 = code(x, y, z, a)
            	t_0 = tan(y) + tan(z);
            	t_1 = x + ((t_0 / (1.0 + (tan(y) / ((-1.0 - (-0.3333333333333333 * (z * z))) / z)))) - tan(a));
            	tmp = 0.0;
            	if (a <= -0.0004)
            		tmp = t_1;
            	elseif (a <= 2.8e-54)
            		tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
            	else
            		tmp = t_1;
            	end
            	tmp_2 = tmp;
            end
            
            NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
            code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(N[(t$95$0 / N[(1.0 + N[(N[Tan[y], $MachinePrecision] / N[(N[(-1.0 - N[(-0.3333333333333333 * N[(z * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.0004], t$95$1, If[LessEqual[a, 2.8e-54], N[(x + N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
            
            \begin{array}{l}
            [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
            \\
            \begin{array}{l}
            t_0 := \tan y + \tan z\\
            t_1 := x + \left(\frac{t\_0}{1 + \frac{\tan y}{\frac{-1 - -0.3333333333333333 \cdot \left(z \cdot z\right)}{z}}} - \tan a\right)\\
            \mathbf{if}\;a \leq -0.0004:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;a \leq 2.8 \cdot 10^{-54}:\\
            \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if a < -4.00000000000000019e-4 or 2.8000000000000002e-54 < a

              1. Initial program 77.5%

                \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. tan-sumN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
                2. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
                3. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                4. tan-lowering-tan.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                5. tan-lowering-tan.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                6. --lowering--.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                7. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                8. tan-lowering-tan.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                9. tan-lowering-tan.f6499.7%

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              4. Applied egg-rr99.7%

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

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \frac{\sin z}{\cos z}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                2. clear-numN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \frac{1}{\frac{\cos z}{\sin z}}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                3. un-div-invN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\frac{\tan y}{\frac{\cos z}{\sin z}}\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                4. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\tan y, \left(\frac{\cos z}{\sin z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                5. tan-lowering-tan.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{\cos z}{\sin z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                6. clear-numN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{1}{\frac{\sin z}{\cos z}}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                7. tan-quotN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\frac{1}{\tan z}\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                8. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(1, \tan z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                9. tan-lowering-tan.f6499.6%

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(1, \mathsf{tan.f64}\left(z\right)\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              6. Applied egg-rr99.6%

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

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

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\left(1 + \frac{-1}{3} \cdot {z}^{2}\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                2. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{3} \cdot {z}^{2}\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                3. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{3}, \left({z}^{2}\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                4. unpow2N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{3}, \left(z \cdot z\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                5. *-lowering-*.f6478.1%

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(z, z\right)\right)\right), z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              9. Simplified78.1%

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

              if -4.00000000000000019e-4 < a < 2.8000000000000002e-54

              1. Initial program 77.1%

                \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. tan-sumN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
                2. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
                3. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                4. tan-lowering-tan.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                5. tan-lowering-tan.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                6. --lowering--.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                7. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                8. tan-lowering-tan.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                9. tan-lowering-tan.f6499.7%

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              4. Applied egg-rr99.7%

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

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \color{blue}{a}\right)\right) \]
              6. Step-by-step derivation
                1. Simplified99.7%

                  \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \color{blue}{a}\right) \]
              7. Recombined 2 regimes into one program.
              8. Final simplification88.3%

                \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -0.0004:\\ \;\;\;\;x + \left(\frac{\tan y + \tan z}{1 + \frac{\tan y}{\frac{-1 - -0.3333333333333333 \cdot \left(z \cdot z\right)}{z}}} - \tan a\right)\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-54}:\\ \;\;\;\;x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\frac{\tan y + \tan z}{1 + \frac{\tan y}{\frac{-1 - -0.3333333333333333 \cdot \left(z \cdot z\right)}{z}}} - \tan a\right)\\ \end{array} \]
              9. Add Preprocessing

              Alternative 11: 79.8% accurate, 0.7× speedup?

              \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ x + \left(\tan \left(y + z\right) - \frac{\sin a}{\cos a}\right) \end{array} \]
              NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
              (FPCore (x y z a)
               :precision binary64
               (+ x (- (tan (+ y z)) (/ (sin a) (cos a)))))
              assert(x < y && y < z && z < a);
              double code(double x, double y, double z, double a) {
              	return x + (tan((y + z)) - (sin(a) / cos(a)));
              }
              
              NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
              real(8) function code(x, y, z, a)
                  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)) - (sin(a) / cos(a)))
              end function
              
              assert x < y && y < z && z < a;
              public static double code(double x, double y, double z, double a) {
              	return x + (Math.tan((y + z)) - (Math.sin(a) / Math.cos(a)));
              }
              
              [x, y, z, a] = sort([x, y, z, a])
              def code(x, y, z, a):
              	return x + (math.tan((y + z)) - (math.sin(a) / math.cos(a)))
              
              x, y, z, a = sort([x, y, z, a])
              function code(x, y, z, a)
              	return Float64(x + Float64(tan(Float64(y + z)) - Float64(sin(a) / cos(a))))
              end
              
              x, y, z, a = num2cell(sort([x, y, z, a])){:}
              function tmp = code(x, y, z, a)
              	tmp = x + (tan((y + z)) - (sin(a) / cos(a)));
              end
              
              NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
              code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sin[a], $MachinePrecision] / N[Cos[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
              
              \begin{array}{l}
              [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
              \\
              x + \left(\tan \left(y + z\right) - \frac{\sin a}{\cos a}\right)
              \end{array}
              
              Derivation
              1. Initial program 77.3%

                \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. tan-quotN/A

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

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{/.f64}\left(\sin a, \color{blue}{\cos a}\right)\right)\right) \]
                3. sin-lowering-sin.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(a\right), \cos \color{blue}{a}\right)\right)\right) \]
                4. cos-lowering-cos.f6477.3%

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{/.f64}\left(\mathsf{sin.f64}\left(a\right), \mathsf{cos.f64}\left(a\right)\right)\right)\right) \]
              4. Applied egg-rr77.3%

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

              Alternative 12: 80.1% accurate, 0.7× speedup?

              \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ x + \left(\left(\tan y + \tan z\right) - \tan a\right) \end{array} \]
              NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
              (FPCore (x y z a) :precision binary64 (+ x (- (+ (tan y) (tan z)) (tan a))))
              assert(x < y && y < z && z < a);
              double code(double x, double y, double z, double a) {
              	return x + ((tan(y) + tan(z)) - tan(a));
              }
              
              NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
              real(8) function code(x, y, z, a)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8), intent (in) :: a
                  code = x + ((tan(y) + tan(z)) - tan(a))
              end function
              
              assert x < y && y < z && z < a;
              public static double code(double x, double y, double z, double a) {
              	return x + ((Math.tan(y) + Math.tan(z)) - Math.tan(a));
              }
              
              [x, y, z, a] = sort([x, y, z, a])
              def code(x, y, z, a):
              	return x + ((math.tan(y) + math.tan(z)) - math.tan(a))
              
              x, y, z, a = sort([x, y, z, a])
              function code(x, y, z, a)
              	return Float64(x + Float64(Float64(tan(y) + tan(z)) - tan(a)))
              end
              
              x, y, z, a = num2cell(sort([x, y, z, a])){:}
              function tmp = code(x, y, z, a)
              	tmp = x + ((tan(y) + tan(z)) - tan(a));
              end
              
              NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
              code[x_, y_, z_, a_] := N[(x + N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
              
              \begin{array}{l}
              [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
              \\
              x + \left(\left(\tan y + \tan z\right) - \tan a\right)
              \end{array}
              
              Derivation
              1. Initial program 77.3%

                \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. tan-sumN/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z}\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
                2. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\left(\tan y + \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(\color{blue}{a}\right)\right)\right) \]
                3. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\tan y, \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                4. tan-lowering-tan.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                5. tan-lowering-tan.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \left(1 - \tan y \cdot \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                6. --lowering--.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \left(\tan y \cdot \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                7. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\tan y, \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                8. tan-lowering-tan.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \tan z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                9. tan-lowering-tan.f6499.7%

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \mathsf{\_.f64}\left(1, \mathsf{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              4. Applied egg-rr99.7%

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

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{tan.f64}\left(z\right)\right), \color{blue}{1}\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              6. Step-by-step derivation
                1. Simplified77.7%

                  \[\leadsto x + \left(\frac{\tan y + \tan z}{\color{blue}{1}} - \tan a\right) \]
                2. Final simplification77.7%

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

                Alternative 13: 69.4% accurate, 1.0× speedup?

                \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ \begin{array}{l} t_0 := x + \left(\tan y - \tan a\right)\\ \mathbf{if}\;a \leq -0.086:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{-41}:\\ \;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot \left(0.13333333333333333 + \left(a \cdot a\right) \cdot 0.05396825396825397\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                (FPCore (x y z a)
                 :precision binary64
                 (let* ((t_0 (+ x (- (tan y) (tan a)))))
                   (if (<= a -0.086)
                     t_0
                     (if (<= a 1.15e-41)
                       (+
                        x
                        (+
                         (tan (+ y z))
                         (*
                          a
                          (-
                           -1.0
                           (*
                            (* a a)
                            (+
                             0.3333333333333333
                             (*
                              (* a a)
                              (+ 0.13333333333333333 (* (* a a) 0.05396825396825397)))))))))
                       t_0))))
                assert(x < y && y < z && z < a);
                double code(double x, double y, double z, double a) {
                	double t_0 = x + (tan(y) - tan(a));
                	double tmp;
                	if (a <= -0.086) {
                		tmp = t_0;
                	} else if (a <= 1.15e-41) {
                		tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                real(8) function code(x, y, z, a)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: a
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = x + (tan(y) - tan(a))
                    if (a <= (-0.086d0)) then
                        tmp = t_0
                    else if (a <= 1.15d-41) then
                        tmp = x + (tan((y + z)) + (a * ((-1.0d0) - ((a * a) * (0.3333333333333333d0 + ((a * a) * (0.13333333333333333d0 + ((a * a) * 0.05396825396825397d0))))))))
                    else
                        tmp = t_0
                    end if
                    code = tmp
                end function
                
                assert x < y && y < z && z < a;
                public static double code(double x, double y, double z, double a) {
                	double t_0 = x + (Math.tan(y) - Math.tan(a));
                	double tmp;
                	if (a <= -0.086) {
                		tmp = t_0;
                	} else if (a <= 1.15e-41) {
                		tmp = x + (Math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                [x, y, z, a] = sort([x, y, z, a])
                def code(x, y, z, a):
                	t_0 = x + (math.tan(y) - math.tan(a))
                	tmp = 0
                	if a <= -0.086:
                		tmp = t_0
                	elif a <= 1.15e-41:
                		tmp = x + (math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))))
                	else:
                		tmp = t_0
                	return tmp
                
                x, y, z, a = sort([x, y, z, a])
                function code(x, y, z, a)
                	t_0 = Float64(x + Float64(tan(y) - tan(a)))
                	tmp = 0.0
                	if (a <= -0.086)
                		tmp = t_0;
                	elseif (a <= 1.15e-41)
                		tmp = Float64(x + Float64(tan(Float64(y + z)) + Float64(a * Float64(-1.0 - Float64(Float64(a * a) * Float64(0.3333333333333333 + Float64(Float64(a * a) * Float64(0.13333333333333333 + Float64(Float64(a * a) * 0.05396825396825397)))))))));
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                x, y, z, a = num2cell(sort([x, y, z, a])){:}
                function tmp_2 = code(x, y, z, a)
                	t_0 = x + (tan(y) - tan(a));
                	tmp = 0.0;
                	if (a <= -0.086)
                		tmp = t_0;
                	elseif (a <= 1.15e-41)
                		tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
                	else
                		tmp = t_0;
                	end
                	tmp_2 = tmp;
                end
                
                NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x + N[(N[Tan[y], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.086], t$95$0, If[LessEqual[a, 1.15e-41], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] + N[(a * N[(-1.0 - N[(N[(a * a), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(a * a), $MachinePrecision] * N[(0.13333333333333333 + N[(N[(a * a), $MachinePrecision] * 0.05396825396825397), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                
                \begin{array}{l}
                [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
                \\
                \begin{array}{l}
                t_0 := x + \left(\tan y - \tan a\right)\\
                \mathbf{if}\;a \leq -0.086:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;a \leq 1.15 \cdot 10^{-41}:\\
                \;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot \left(0.13333333333333333 + \left(a \cdot a\right) \cdot 0.05396825396825397\right)\right)\right)\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if a < -0.085999999999999993 or 1.15000000000000005e-41 < a

                  1. Initial program 76.5%

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

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\color{blue}{y}\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                  4. Step-by-step derivation
                    1. Simplified57.2%

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

                    if -0.085999999999999993 < a < 1.15000000000000005e-41

                    1. Initial program 78.2%

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

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \color{blue}{\left(a \cdot \left(1 + {a}^{2} \cdot \left(\frac{1}{3} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right)\right)\right)}\right)\right) \]
                    4. Step-by-step derivation
                      1. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \color{blue}{\left(1 + {a}^{2} \cdot \left(\frac{1}{3} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right)\right)}\right)\right)\right) \]
                      2. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left({a}^{2} \cdot \left(\frac{1}{3} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right)\right)}\right)\right)\right)\right) \]
                      3. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({a}^{2}\right), \color{blue}{\left(\frac{1}{3} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right)}\right)\right)\right)\right)\right) \]
                      4. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot a\right), \left(\color{blue}{\frac{1}{3}} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right)\right)\right)\right)\right)\right) \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\color{blue}{\frac{1}{3}} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right)\right)\right)\right)\right)\right) \]
                      6. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \color{blue}{\left({a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right)}\right)\right)\right)\right)\right)\right) \]
                      7. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left({a}^{2}\right), \color{blue}{\left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                      8. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(a \cdot a\right), \left(\color{blue}{\frac{2}{15}} + \frac{17}{315} \cdot {a}^{2}\right)\right)\right)\right)\right)\right)\right)\right) \]
                      9. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\color{blue}{\frac{2}{15}} + \frac{17}{315} \cdot {a}^{2}\right)\right)\right)\right)\right)\right)\right)\right) \]
                      10. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{2}{15}, \color{blue}{\left(\frac{17}{315} \cdot {a}^{2}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
                      11. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{2}{15}, \left({a}^{2} \cdot \color{blue}{\frac{17}{315}}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                      12. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{2}{15}, \mathsf{*.f64}\left(\left({a}^{2}\right), \color{blue}{\frac{17}{315}}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                      13. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{2}{15}, \mathsf{*.f64}\left(\left(a \cdot a\right), \frac{17}{315}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                      14. *-lowering-*.f6478.0%

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{2}{15}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \frac{17}{315}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                    5. Simplified78.0%

                      \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a \cdot \left(1 + \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot \left(0.13333333333333333 + \left(a \cdot a\right) \cdot 0.05396825396825397\right)\right)\right)}\right) \]
                  5. Recombined 2 regimes into one program.
                  6. Final simplification67.5%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -0.086:\\ \;\;\;\;x + \left(\tan y - \tan a\right)\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{-41}:\\ \;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot \left(0.13333333333333333 + \left(a \cdot a\right) \cdot 0.05396825396825397\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\tan y - \tan a\right)\\ \end{array} \]
                  7. Add Preprocessing

                  Alternative 14: 79.6% accurate, 1.0× speedup?

                  \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ \begin{array}{l} \mathbf{if}\;y + z \leq -1 \cdot 10^{-10}:\\ \;\;\;\;x + \left(\tan y - \tan a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\tan z - \tan a\right)\\ \end{array} \end{array} \]
                  NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                  (FPCore (x y z a)
                   :precision binary64
                   (if (<= (+ y z) -1e-10) (+ x (- (tan y) (tan a))) (+ x (- (tan z) (tan a)))))
                  assert(x < y && y < z && z < a);
                  double code(double x, double y, double z, double a) {
                  	double tmp;
                  	if ((y + z) <= -1e-10) {
                  		tmp = x + (tan(y) - tan(a));
                  	} else {
                  		tmp = x + (tan(z) - tan(a));
                  	}
                  	return tmp;
                  }
                  
                  NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                  real(8) function code(x, y, z, a)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8), intent (in) :: a
                      real(8) :: tmp
                      if ((y + z) <= (-1d-10)) then
                          tmp = x + (tan(y) - tan(a))
                      else
                          tmp = x + (tan(z) - tan(a))
                      end if
                      code = tmp
                  end function
                  
                  assert x < y && y < z && z < a;
                  public static double code(double x, double y, double z, double a) {
                  	double tmp;
                  	if ((y + z) <= -1e-10) {
                  		tmp = x + (Math.tan(y) - Math.tan(a));
                  	} else {
                  		tmp = x + (Math.tan(z) - Math.tan(a));
                  	}
                  	return tmp;
                  }
                  
                  [x, y, z, a] = sort([x, y, z, a])
                  def code(x, y, z, a):
                  	tmp = 0
                  	if (y + z) <= -1e-10:
                  		tmp = x + (math.tan(y) - math.tan(a))
                  	else:
                  		tmp = x + (math.tan(z) - math.tan(a))
                  	return tmp
                  
                  x, y, z, a = sort([x, y, z, a])
                  function code(x, y, z, a)
                  	tmp = 0.0
                  	if (Float64(y + z) <= -1e-10)
                  		tmp = Float64(x + Float64(tan(y) - tan(a)));
                  	else
                  		tmp = Float64(x + Float64(tan(z) - tan(a)));
                  	end
                  	return tmp
                  end
                  
                  x, y, z, a = num2cell(sort([x, y, z, a])){:}
                  function tmp_2 = code(x, y, z, a)
                  	tmp = 0.0;
                  	if ((y + z) <= -1e-10)
                  		tmp = x + (tan(y) - tan(a));
                  	else
                  		tmp = x + (tan(z) - tan(a));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                  code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -1e-10], N[(x + N[(N[Tan[y], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[Tan[z], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;y + z \leq -1 \cdot 10^{-10}:\\
                  \;\;\;\;x + \left(\tan y - \tan a\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;x + \left(\tan z - \tan a\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (+.f64 y z) < -1.00000000000000004e-10

                    1. Initial program 68.4%

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

                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\color{blue}{y}\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                    4. Step-by-step derivation
                      1. Simplified46.8%

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

                      if -1.00000000000000004e-10 < (+.f64 y z)

                      1. Initial program 83.6%

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

                        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\color{blue}{z}\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                      4. Step-by-step derivation
                        1. Simplified67.2%

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

                      Alternative 15: 79.8% accurate, 1.0× speedup?

                      \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ x + \left(\tan \left(y + z\right) - \tan a\right) \end{array} \]
                      NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                      (FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
                      assert(x < y && y < z && z < a);
                      double code(double x, double y, double z, double a) {
                      	return x + (tan((y + z)) - tan(a));
                      }
                      
                      NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                      real(8) function code(x, y, z, a)
                          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
                      
                      assert x < y && y < z && z < a;
                      public static double code(double x, double y, double z, double a) {
                      	return x + (Math.tan((y + z)) - Math.tan(a));
                      }
                      
                      [x, y, z, a] = sort([x, y, z, a])
                      def code(x, y, z, a):
                      	return x + (math.tan((y + z)) - math.tan(a))
                      
                      x, y, z, a = sort([x, y, z, a])
                      function code(x, y, z, a)
                      	return Float64(x + Float64(tan(Float64(y + z)) - tan(a)))
                      end
                      
                      x, y, z, a = num2cell(sort([x, y, z, a])){:}
                      function tmp = code(x, y, z, a)
                      	tmp = x + (tan((y + z)) - tan(a));
                      end
                      
                      NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                      code[x_, y_, z_, a_] := N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                      
                      \begin{array}{l}
                      [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
                      \\
                      x + \left(\tan \left(y + z\right) - \tan a\right)
                      \end{array}
                      
                      Derivation
                      1. Initial program 77.3%

                        \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                      2. Add Preprocessing
                      3. Add Preprocessing

                      Alternative 16: 60.6% accurate, 1.5× speedup?

                      \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ \begin{array}{l} t_0 := x - \tan a\\ \mathbf{if}\;a \leq -0.47:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\ \;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot \left(0.13333333333333333 + \left(a \cdot a\right) \cdot 0.05396825396825397\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                      NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                      (FPCore (x y z a)
                       :precision binary64
                       (let* ((t_0 (- x (tan a))))
                         (if (<= a -0.47)
                           t_0
                           (if (<= a 6.5e-6)
                             (+
                              x
                              (+
                               (tan (+ y z))
                               (*
                                a
                                (-
                                 -1.0
                                 (*
                                  (* a a)
                                  (+
                                   0.3333333333333333
                                   (*
                                    (* a a)
                                    (+ 0.13333333333333333 (* (* a a) 0.05396825396825397)))))))))
                             t_0))))
                      assert(x < y && y < z && z < a);
                      double code(double x, double y, double z, double a) {
                      	double t_0 = x - tan(a);
                      	double tmp;
                      	if (a <= -0.47) {
                      		tmp = t_0;
                      	} else if (a <= 6.5e-6) {
                      		tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
                      	} else {
                      		tmp = t_0;
                      	}
                      	return tmp;
                      }
                      
                      NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                      real(8) function code(x, y, z, a)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          real(8), intent (in) :: z
                          real(8), intent (in) :: a
                          real(8) :: t_0
                          real(8) :: tmp
                          t_0 = x - tan(a)
                          if (a <= (-0.47d0)) then
                              tmp = t_0
                          else if (a <= 6.5d-6) then
                              tmp = x + (tan((y + z)) + (a * ((-1.0d0) - ((a * a) * (0.3333333333333333d0 + ((a * a) * (0.13333333333333333d0 + ((a * a) * 0.05396825396825397d0))))))))
                          else
                              tmp = t_0
                          end if
                          code = tmp
                      end function
                      
                      assert x < y && y < z && z < a;
                      public static double code(double x, double y, double z, double a) {
                      	double t_0 = x - Math.tan(a);
                      	double tmp;
                      	if (a <= -0.47) {
                      		tmp = t_0;
                      	} else if (a <= 6.5e-6) {
                      		tmp = x + (Math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
                      	} else {
                      		tmp = t_0;
                      	}
                      	return tmp;
                      }
                      
                      [x, y, z, a] = sort([x, y, z, a])
                      def code(x, y, z, a):
                      	t_0 = x - math.tan(a)
                      	tmp = 0
                      	if a <= -0.47:
                      		tmp = t_0
                      	elif a <= 6.5e-6:
                      		tmp = x + (math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))))
                      	else:
                      		tmp = t_0
                      	return tmp
                      
                      x, y, z, a = sort([x, y, z, a])
                      function code(x, y, z, a)
                      	t_0 = Float64(x - tan(a))
                      	tmp = 0.0
                      	if (a <= -0.47)
                      		tmp = t_0;
                      	elseif (a <= 6.5e-6)
                      		tmp = Float64(x + Float64(tan(Float64(y + z)) + Float64(a * Float64(-1.0 - Float64(Float64(a * a) * Float64(0.3333333333333333 + Float64(Float64(a * a) * Float64(0.13333333333333333 + Float64(Float64(a * a) * 0.05396825396825397)))))))));
                      	else
                      		tmp = t_0;
                      	end
                      	return tmp
                      end
                      
                      x, y, z, a = num2cell(sort([x, y, z, a])){:}
                      function tmp_2 = code(x, y, z, a)
                      	t_0 = x - tan(a);
                      	tmp = 0.0;
                      	if (a <= -0.47)
                      		tmp = t_0;
                      	elseif (a <= 6.5e-6)
                      		tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * (0.13333333333333333 + ((a * a) * 0.05396825396825397))))))));
                      	else
                      		tmp = t_0;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                      code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.47], t$95$0, If[LessEqual[a, 6.5e-6], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] + N[(a * N[(-1.0 - N[(N[(a * a), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(a * a), $MachinePrecision] * N[(0.13333333333333333 + N[(N[(a * a), $MachinePrecision] * 0.05396825396825397), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                      
                      \begin{array}{l}
                      [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
                      \\
                      \begin{array}{l}
                      t_0 := x - \tan a\\
                      \mathbf{if}\;a \leq -0.47:\\
                      \;\;\;\;t\_0\\
                      
                      \mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\
                      \;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot \left(0.13333333333333333 + \left(a \cdot a\right) \cdot 0.05396825396825397\right)\right)\right)\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_0\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if a < -0.46999999999999997 or 6.4999999999999996e-6 < a

                        1. Initial program 76.1%

                          \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                        2. Add Preprocessing
                        3. Step-by-step derivation
                          1. associate-+r-N/A

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

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

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

                            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\left(y + z\right)\right)\right), \tan a\right) \]
                          5. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \tan a\right) \]
                          6. tan-lowering-tan.f6476.0%

                            \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right) \]
                        4. Applied egg-rr76.0%

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

                          \[\leadsto \mathsf{\_.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(a\right)\right) \]
                        6. Step-by-step derivation
                          1. Simplified39.4%

                            \[\leadsto \color{blue}{x} - \tan a \]

                          if -0.46999999999999997 < a < 6.4999999999999996e-6

                          1. Initial program 78.5%

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

                            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \color{blue}{\left(a \cdot \left(1 + {a}^{2} \cdot \left(\frac{1}{3} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right)\right)\right)}\right)\right) \]
                          4. Step-by-step derivation
                            1. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \color{blue}{\left(1 + {a}^{2} \cdot \left(\frac{1}{3} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right)\right)}\right)\right)\right) \]
                            2. +-lowering-+.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left({a}^{2} \cdot \left(\frac{1}{3} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right)\right)}\right)\right)\right)\right) \]
                            3. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({a}^{2}\right), \color{blue}{\left(\frac{1}{3} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right)}\right)\right)\right)\right)\right) \]
                            4. unpow2N/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot a\right), \left(\color{blue}{\frac{1}{3}} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right)\right)\right)\right)\right)\right) \]
                            5. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\color{blue}{\frac{1}{3}} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right)\right)\right)\right)\right)\right) \]
                            6. +-lowering-+.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \color{blue}{\left({a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right)}\right)\right)\right)\right)\right)\right) \]
                            7. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left({a}^{2}\right), \color{blue}{\left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                            8. unpow2N/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(a \cdot a\right), \left(\color{blue}{\frac{2}{15}} + \frac{17}{315} \cdot {a}^{2}\right)\right)\right)\right)\right)\right)\right)\right) \]
                            9. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\color{blue}{\frac{2}{15}} + \frac{17}{315} \cdot {a}^{2}\right)\right)\right)\right)\right)\right)\right)\right) \]
                            10. +-lowering-+.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{2}{15}, \color{blue}{\left(\frac{17}{315} \cdot {a}^{2}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
                            11. *-commutativeN/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{2}{15}, \left({a}^{2} \cdot \color{blue}{\frac{17}{315}}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                            12. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{2}{15}, \mathsf{*.f64}\left(\left({a}^{2}\right), \color{blue}{\frac{17}{315}}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                            13. unpow2N/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{2}{15}, \mathsf{*.f64}\left(\left(a \cdot a\right), \frac{17}{315}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                            14. *-lowering-*.f6478.4%

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{2}{15}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \frac{17}{315}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                          5. Simplified78.4%

                            \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a \cdot \left(1 + \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot \left(0.13333333333333333 + \left(a \cdot a\right) \cdot 0.05396825396825397\right)\right)\right)}\right) \]
                        7. Recombined 2 regimes into one program.
                        8. Final simplification59.0%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -0.47:\\ \;\;\;\;x - \tan a\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\ \;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot \left(0.13333333333333333 + \left(a \cdot a\right) \cdot 0.05396825396825397\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - \tan a\\ \end{array} \]
                        9. Add Preprocessing

                        Alternative 17: 60.6% accurate, 1.6× speedup?

                        \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ \begin{array}{l} t_0 := x - \tan a\\ \mathbf{if}\;a \leq -0.58:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\ \;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot 0.13333333333333333\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                        NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                        (FPCore (x y z a)
                         :precision binary64
                         (let* ((t_0 (- x (tan a))))
                           (if (<= a -0.58)
                             t_0
                             (if (<= a 6.5e-6)
                               (+
                                x
                                (+
                                 (tan (+ y z))
                                 (*
                                  a
                                  (-
                                   -1.0
                                   (*
                                    (* a a)
                                    (+ 0.3333333333333333 (* (* a a) 0.13333333333333333)))))))
                               t_0))))
                        assert(x < y && y < z && z < a);
                        double code(double x, double y, double z, double a) {
                        	double t_0 = x - tan(a);
                        	double tmp;
                        	if (a <= -0.58) {
                        		tmp = t_0;
                        	} else if (a <= 6.5e-6) {
                        		tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333))))));
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                        real(8) function code(x, y, z, a)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            real(8), intent (in) :: a
                            real(8) :: t_0
                            real(8) :: tmp
                            t_0 = x - tan(a)
                            if (a <= (-0.58d0)) then
                                tmp = t_0
                            else if (a <= 6.5d-6) then
                                tmp = x + (tan((y + z)) + (a * ((-1.0d0) - ((a * a) * (0.3333333333333333d0 + ((a * a) * 0.13333333333333333d0))))))
                            else
                                tmp = t_0
                            end if
                            code = tmp
                        end function
                        
                        assert x < y && y < z && z < a;
                        public static double code(double x, double y, double z, double a) {
                        	double t_0 = x - Math.tan(a);
                        	double tmp;
                        	if (a <= -0.58) {
                        		tmp = t_0;
                        	} else if (a <= 6.5e-6) {
                        		tmp = x + (Math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333))))));
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        [x, y, z, a] = sort([x, y, z, a])
                        def code(x, y, z, a):
                        	t_0 = x - math.tan(a)
                        	tmp = 0
                        	if a <= -0.58:
                        		tmp = t_0
                        	elif a <= 6.5e-6:
                        		tmp = x + (math.tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333))))))
                        	else:
                        		tmp = t_0
                        	return tmp
                        
                        x, y, z, a = sort([x, y, z, a])
                        function code(x, y, z, a)
                        	t_0 = Float64(x - tan(a))
                        	tmp = 0.0
                        	if (a <= -0.58)
                        		tmp = t_0;
                        	elseif (a <= 6.5e-6)
                        		tmp = Float64(x + Float64(tan(Float64(y + z)) + Float64(a * Float64(-1.0 - Float64(Float64(a * a) * Float64(0.3333333333333333 + Float64(Float64(a * a) * 0.13333333333333333)))))));
                        	else
                        		tmp = t_0;
                        	end
                        	return tmp
                        end
                        
                        x, y, z, a = num2cell(sort([x, y, z, a])){:}
                        function tmp_2 = code(x, y, z, a)
                        	t_0 = x - tan(a);
                        	tmp = 0.0;
                        	if (a <= -0.58)
                        		tmp = t_0;
                        	elseif (a <= 6.5e-6)
                        		tmp = x + (tan((y + z)) + (a * (-1.0 - ((a * a) * (0.3333333333333333 + ((a * a) * 0.13333333333333333))))));
                        	else
                        		tmp = t_0;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                        code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.58], t$95$0, If[LessEqual[a, 6.5e-6], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] + N[(a * N[(-1.0 - N[(N[(a * a), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(a * a), $MachinePrecision] * 0.13333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                        
                        \begin{array}{l}
                        [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
                        \\
                        \begin{array}{l}
                        t_0 := x - \tan a\\
                        \mathbf{if}\;a \leq -0.58:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\
                        \;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot 0.13333333333333333\right)\right)\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_0\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if a < -0.57999999999999996 or 6.4999999999999996e-6 < a

                          1. Initial program 76.1%

                            \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                          2. Add Preprocessing
                          3. Step-by-step derivation
                            1. associate-+r-N/A

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

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

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

                              \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\left(y + z\right)\right)\right), \tan a\right) \]
                            5. +-lowering-+.f64N/A

                              \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \tan a\right) \]
                            6. tan-lowering-tan.f6476.0%

                              \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right) \]
                          4. Applied egg-rr76.0%

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

                            \[\leadsto \mathsf{\_.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(a\right)\right) \]
                          6. Step-by-step derivation
                            1. Simplified39.4%

                              \[\leadsto \color{blue}{x} - \tan a \]

                            if -0.57999999999999996 < a < 6.4999999999999996e-6

                            1. Initial program 78.5%

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

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \color{blue}{\left(a \cdot \left(1 + {a}^{2} \cdot \left(\frac{1}{3} + \frac{2}{15} \cdot {a}^{2}\right)\right)\right)}\right)\right) \]
                            4. Step-by-step derivation
                              1. *-lowering-*.f64N/A

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

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

                                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({a}^{2}\right), \color{blue}{\left(\frac{1}{3} + \frac{2}{15} \cdot {a}^{2}\right)}\right)\right)\right)\right)\right) \]
                              4. unpow2N/A

                                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(a \cdot a\right), \left(\color{blue}{\frac{1}{3}} + \frac{2}{15} \cdot {a}^{2}\right)\right)\right)\right)\right)\right) \]
                              5. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \left(\color{blue}{\frac{1}{3}} + \frac{2}{15} \cdot {a}^{2}\right)\right)\right)\right)\right)\right) \]
                              6. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \color{blue}{\left(\frac{2}{15} \cdot {a}^{2}\right)}\right)\right)\right)\right)\right)\right) \]
                              7. *-commutativeN/A

                                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \left({a}^{2} \cdot \color{blue}{\frac{2}{15}}\right)\right)\right)\right)\right)\right)\right) \]
                              8. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left({a}^{2}\right), \color{blue}{\frac{2}{15}}\right)\right)\right)\right)\right)\right)\right) \]
                              9. unpow2N/A

                                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(a \cdot a\right), \frac{2}{15}\right)\right)\right)\right)\right)\right)\right) \]
                              10. *-lowering-*.f6478.3%

                                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \frac{2}{15}\right)\right)\right)\right)\right)\right)\right) \]
                            5. Simplified78.3%

                              \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a \cdot \left(1 + \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot 0.13333333333333333\right)\right)}\right) \]
                          7. Recombined 2 regimes into one program.
                          8. Final simplification59.0%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -0.58:\\ \;\;\;\;x - \tan a\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\ \;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - \left(a \cdot a\right) \cdot \left(0.3333333333333333 + \left(a \cdot a\right) \cdot 0.13333333333333333\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - \tan a\\ \end{array} \]
                          9. Add Preprocessing

                          Alternative 18: 60.6% accurate, 1.7× speedup?

                          \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ \begin{array}{l} t_0 := x - \tan a\\ \mathbf{if}\;a \leq -0.33:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\ \;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - a \cdot \left(a \cdot 0.3333333333333333\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                          NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                          (FPCore (x y z a)
                           :precision binary64
                           (let* ((t_0 (- x (tan a))))
                             (if (<= a -0.33)
                               t_0
                               (if (<= a 6.5e-6)
                                 (+ x (+ (tan (+ y z)) (* a (- -1.0 (* a (* a 0.3333333333333333))))))
                                 t_0))))
                          assert(x < y && y < z && z < a);
                          double code(double x, double y, double z, double a) {
                          	double t_0 = x - tan(a);
                          	double tmp;
                          	if (a <= -0.33) {
                          		tmp = t_0;
                          	} else if (a <= 6.5e-6) {
                          		tmp = x + (tan((y + z)) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
                          	} else {
                          		tmp = t_0;
                          	}
                          	return tmp;
                          }
                          
                          NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                          real(8) function code(x, y, z, a)
                              real(8), intent (in) :: x
                              real(8), intent (in) :: y
                              real(8), intent (in) :: z
                              real(8), intent (in) :: a
                              real(8) :: t_0
                              real(8) :: tmp
                              t_0 = x - tan(a)
                              if (a <= (-0.33d0)) then
                                  tmp = t_0
                              else if (a <= 6.5d-6) then
                                  tmp = x + (tan((y + z)) + (a * ((-1.0d0) - (a * (a * 0.3333333333333333d0)))))
                              else
                                  tmp = t_0
                              end if
                              code = tmp
                          end function
                          
                          assert x < y && y < z && z < a;
                          public static double code(double x, double y, double z, double a) {
                          	double t_0 = x - Math.tan(a);
                          	double tmp;
                          	if (a <= -0.33) {
                          		tmp = t_0;
                          	} else if (a <= 6.5e-6) {
                          		tmp = x + (Math.tan((y + z)) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
                          	} else {
                          		tmp = t_0;
                          	}
                          	return tmp;
                          }
                          
                          [x, y, z, a] = sort([x, y, z, a])
                          def code(x, y, z, a):
                          	t_0 = x - math.tan(a)
                          	tmp = 0
                          	if a <= -0.33:
                          		tmp = t_0
                          	elif a <= 6.5e-6:
                          		tmp = x + (math.tan((y + z)) + (a * (-1.0 - (a * (a * 0.3333333333333333)))))
                          	else:
                          		tmp = t_0
                          	return tmp
                          
                          x, y, z, a = sort([x, y, z, a])
                          function code(x, y, z, a)
                          	t_0 = Float64(x - tan(a))
                          	tmp = 0.0
                          	if (a <= -0.33)
                          		tmp = t_0;
                          	elseif (a <= 6.5e-6)
                          		tmp = Float64(x + Float64(tan(Float64(y + z)) + Float64(a * Float64(-1.0 - Float64(a * Float64(a * 0.3333333333333333))))));
                          	else
                          		tmp = t_0;
                          	end
                          	return tmp
                          end
                          
                          x, y, z, a = num2cell(sort([x, y, z, a])){:}
                          function tmp_2 = code(x, y, z, a)
                          	t_0 = x - tan(a);
                          	tmp = 0.0;
                          	if (a <= -0.33)
                          		tmp = t_0;
                          	elseif (a <= 6.5e-6)
                          		tmp = x + (tan((y + z)) + (a * (-1.0 - (a * (a * 0.3333333333333333)))));
                          	else
                          		tmp = t_0;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                          code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.33], t$95$0, If[LessEqual[a, 6.5e-6], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] + N[(a * N[(-1.0 - N[(a * N[(a * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                          
                          \begin{array}{l}
                          [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
                          \\
                          \begin{array}{l}
                          t_0 := x - \tan a\\
                          \mathbf{if}\;a \leq -0.33:\\
                          \;\;\;\;t\_0\\
                          
                          \mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\
                          \;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - a \cdot \left(a \cdot 0.3333333333333333\right)\right)\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t\_0\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if a < -0.330000000000000016 or 6.4999999999999996e-6 < a

                            1. Initial program 76.1%

                              \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                            2. Add Preprocessing
                            3. Step-by-step derivation
                              1. associate-+r-N/A

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

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

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

                                \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\left(y + z\right)\right)\right), \tan a\right) \]
                              5. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \tan a\right) \]
                              6. tan-lowering-tan.f6476.0%

                                \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right) \]
                            4. Applied egg-rr76.0%

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

                              \[\leadsto \mathsf{\_.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(a\right)\right) \]
                            6. Step-by-step derivation
                              1. Simplified39.4%

                                \[\leadsto \color{blue}{x} - \tan a \]

                              if -0.330000000000000016 < a < 6.4999999999999996e-6

                              1. Initial program 78.5%

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

                                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \color{blue}{\left(a \cdot \left(1 + \frac{1}{3} \cdot {a}^{2}\right)\right)}\right)\right) \]
                              4. Step-by-step derivation
                                1. *-lowering-*.f64N/A

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

                                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{3} \cdot {a}^{2}\right)}\right)\right)\right)\right) \]
                                3. *-commutativeN/A

                                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left({a}^{2} \cdot \color{blue}{\frac{1}{3}}\right)\right)\right)\right)\right) \]
                                4. unpow2N/A

                                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(\left(a \cdot a\right) \cdot \frac{1}{3}\right)\right)\right)\right)\right) \]
                                5. associate-*l*N/A

                                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \left(a \cdot \color{blue}{\left(a \cdot \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
                                6. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(a \cdot \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
                                7. *-lowering-*.f6478.0%

                                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(a, \color{blue}{\frac{1}{3}}\right)\right)\right)\right)\right)\right) \]
                              5. Simplified78.0%

                                \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a \cdot \left(1 + a \cdot \left(a \cdot 0.3333333333333333\right)\right)}\right) \]
                            7. Recombined 2 regimes into one program.
                            8. Final simplification58.9%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -0.33:\\ \;\;\;\;x - \tan a\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\ \;\;\;\;x + \left(\tan \left(y + z\right) + a \cdot \left(-1 - a \cdot \left(a \cdot 0.3333333333333333\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x - \tan a\\ \end{array} \]
                            9. Add Preprocessing

                            Alternative 19: 60.6% accurate, 1.8× speedup?

                            \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ \begin{array}{l} t_0 := x - \tan a\\ \mathbf{if}\;a \leq -0.095:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\ \;\;\;\;\left(x + \tan \left(y + z\right)\right) - a\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                            NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                            (FPCore (x y z a)
                             :precision binary64
                             (let* ((t_0 (- x (tan a))))
                               (if (<= a -0.095) t_0 (if (<= a 6.5e-6) (- (+ x (tan (+ y z))) a) t_0))))
                            assert(x < y && y < z && z < a);
                            double code(double x, double y, double z, double a) {
                            	double t_0 = x - tan(a);
                            	double tmp;
                            	if (a <= -0.095) {
                            		tmp = t_0;
                            	} else if (a <= 6.5e-6) {
                            		tmp = (x + tan((y + z))) - a;
                            	} else {
                            		tmp = t_0;
                            	}
                            	return tmp;
                            }
                            
                            NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                            real(8) function code(x, y, z, a)
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: a
                                real(8) :: t_0
                                real(8) :: tmp
                                t_0 = x - tan(a)
                                if (a <= (-0.095d0)) then
                                    tmp = t_0
                                else if (a <= 6.5d-6) then
                                    tmp = (x + tan((y + z))) - a
                                else
                                    tmp = t_0
                                end if
                                code = tmp
                            end function
                            
                            assert x < y && y < z && z < a;
                            public static double code(double x, double y, double z, double a) {
                            	double t_0 = x - Math.tan(a);
                            	double tmp;
                            	if (a <= -0.095) {
                            		tmp = t_0;
                            	} else if (a <= 6.5e-6) {
                            		tmp = (x + Math.tan((y + z))) - a;
                            	} else {
                            		tmp = t_0;
                            	}
                            	return tmp;
                            }
                            
                            [x, y, z, a] = sort([x, y, z, a])
                            def code(x, y, z, a):
                            	t_0 = x - math.tan(a)
                            	tmp = 0
                            	if a <= -0.095:
                            		tmp = t_0
                            	elif a <= 6.5e-6:
                            		tmp = (x + math.tan((y + z))) - a
                            	else:
                            		tmp = t_0
                            	return tmp
                            
                            x, y, z, a = sort([x, y, z, a])
                            function code(x, y, z, a)
                            	t_0 = Float64(x - tan(a))
                            	tmp = 0.0
                            	if (a <= -0.095)
                            		tmp = t_0;
                            	elseif (a <= 6.5e-6)
                            		tmp = Float64(Float64(x + tan(Float64(y + z))) - a);
                            	else
                            		tmp = t_0;
                            	end
                            	return tmp
                            end
                            
                            x, y, z, a = num2cell(sort([x, y, z, a])){:}
                            function tmp_2 = code(x, y, z, a)
                            	t_0 = x - tan(a);
                            	tmp = 0.0;
                            	if (a <= -0.095)
                            		tmp = t_0;
                            	elseif (a <= 6.5e-6)
                            		tmp = (x + tan((y + z))) - a;
                            	else
                            		tmp = t_0;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                            code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.095], t$95$0, If[LessEqual[a, 6.5e-6], N[(N[(x + N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision], t$95$0]]]
                            
                            \begin{array}{l}
                            [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
                            \\
                            \begin{array}{l}
                            t_0 := x - \tan a\\
                            \mathbf{if}\;a \leq -0.095:\\
                            \;\;\;\;t\_0\\
                            
                            \mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\
                            \;\;\;\;\left(x + \tan \left(y + z\right)\right) - a\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;t\_0\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if a < -0.095000000000000001 or 6.4999999999999996e-6 < a

                              1. Initial program 76.1%

                                \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                              2. Add Preprocessing
                              3. Step-by-step derivation
                                1. associate-+r-N/A

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

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

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

                                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\left(y + z\right)\right)\right), \tan a\right) \]
                                5. +-lowering-+.f64N/A

                                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \tan a\right) \]
                                6. tan-lowering-tan.f6476.0%

                                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right) \]
                              4. Applied egg-rr76.0%

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

                                \[\leadsto \mathsf{\_.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(a\right)\right) \]
                              6. Step-by-step derivation
                                1. Simplified39.4%

                                  \[\leadsto \color{blue}{x} - \tan a \]

                                if -0.095000000000000001 < a < 6.4999999999999996e-6

                                1. Initial program 78.5%

                                  \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                                2. Add Preprocessing
                                3. Step-by-step derivation
                                  1. associate-+r-N/A

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

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

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

                                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\left(y + z\right)\right)\right), \tan a\right) \]
                                  5. +-lowering-+.f64N/A

                                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \tan a\right) \]
                                  6. tan-lowering-tan.f6478.5%

                                    \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right) \]
                                4. Applied egg-rr78.5%

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

                                  \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \color{blue}{a}\right) \]
                                6. Step-by-step derivation
                                  1. Simplified77.7%

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

                                Alternative 20: 60.6% accurate, 1.8× speedup?

                                \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ \begin{array}{l} t_0 := x - \tan a\\ \mathbf{if}\;a \leq -0.068:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\ \;\;\;\;x + \left(\tan \left(y + z\right) - a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                                (FPCore (x y z a)
                                 :precision binary64
                                 (let* ((t_0 (- x (tan a))))
                                   (if (<= a -0.068) t_0 (if (<= a 6.5e-6) (+ x (- (tan (+ y z)) a)) t_0))))
                                assert(x < y && y < z && z < a);
                                double code(double x, double y, double z, double a) {
                                	double t_0 = x - tan(a);
                                	double tmp;
                                	if (a <= -0.068) {
                                		tmp = t_0;
                                	} else if (a <= 6.5e-6) {
                                		tmp = x + (tan((y + z)) - a);
                                	} else {
                                		tmp = t_0;
                                	}
                                	return tmp;
                                }
                                
                                NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                                real(8) function code(x, y, z, a)
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    real(8), intent (in) :: z
                                    real(8), intent (in) :: a
                                    real(8) :: t_0
                                    real(8) :: tmp
                                    t_0 = x - tan(a)
                                    if (a <= (-0.068d0)) then
                                        tmp = t_0
                                    else if (a <= 6.5d-6) then
                                        tmp = x + (tan((y + z)) - a)
                                    else
                                        tmp = t_0
                                    end if
                                    code = tmp
                                end function
                                
                                assert x < y && y < z && z < a;
                                public static double code(double x, double y, double z, double a) {
                                	double t_0 = x - Math.tan(a);
                                	double tmp;
                                	if (a <= -0.068) {
                                		tmp = t_0;
                                	} else if (a <= 6.5e-6) {
                                		tmp = x + (Math.tan((y + z)) - a);
                                	} else {
                                		tmp = t_0;
                                	}
                                	return tmp;
                                }
                                
                                [x, y, z, a] = sort([x, y, z, a])
                                def code(x, y, z, a):
                                	t_0 = x - math.tan(a)
                                	tmp = 0
                                	if a <= -0.068:
                                		tmp = t_0
                                	elif a <= 6.5e-6:
                                		tmp = x + (math.tan((y + z)) - a)
                                	else:
                                		tmp = t_0
                                	return tmp
                                
                                x, y, z, a = sort([x, y, z, a])
                                function code(x, y, z, a)
                                	t_0 = Float64(x - tan(a))
                                	tmp = 0.0
                                	if (a <= -0.068)
                                		tmp = t_0;
                                	elseif (a <= 6.5e-6)
                                		tmp = Float64(x + Float64(tan(Float64(y + z)) - a));
                                	else
                                		tmp = t_0;
                                	end
                                	return tmp
                                end
                                
                                x, y, z, a = num2cell(sort([x, y, z, a])){:}
                                function tmp_2 = code(x, y, z, a)
                                	t_0 = x - tan(a);
                                	tmp = 0.0;
                                	if (a <= -0.068)
                                		tmp = t_0;
                                	elseif (a <= 6.5e-6)
                                		tmp = x + (tan((y + z)) - a);
                                	else
                                		tmp = t_0;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                                code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.068], t$95$0, If[LessEqual[a, 6.5e-6], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                                
                                \begin{array}{l}
                                [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
                                \\
                                \begin{array}{l}
                                t_0 := x - \tan a\\
                                \mathbf{if}\;a \leq -0.068:\\
                                \;\;\;\;t\_0\\
                                
                                \mathbf{elif}\;a \leq 6.5 \cdot 10^{-6}:\\
                                \;\;\;\;x + \left(\tan \left(y + z\right) - a\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;t\_0\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if a < -0.068000000000000005 or 6.4999999999999996e-6 < a

                                  1. Initial program 76.1%

                                    \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                                  2. Add Preprocessing
                                  3. Step-by-step derivation
                                    1. associate-+r-N/A

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

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

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

                                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\left(y + z\right)\right)\right), \tan a\right) \]
                                    5. +-lowering-+.f64N/A

                                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \tan a\right) \]
                                    6. tan-lowering-tan.f6476.0%

                                      \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right) \]
                                  4. Applied egg-rr76.0%

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

                                    \[\leadsto \mathsf{\_.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(a\right)\right) \]
                                  6. Step-by-step derivation
                                    1. Simplified39.4%

                                      \[\leadsto \color{blue}{x} - \tan a \]

                                    if -0.068000000000000005 < a < 6.4999999999999996e-6

                                    1. Initial program 78.5%

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

                                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \color{blue}{a}\right)\right) \]
                                    4. Step-by-step derivation
                                      1. Simplified77.7%

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

                                    Alternative 21: 41.9% accurate, 2.0× speedup?

                                    \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ x - \tan a \end{array} \]
                                    NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                                    (FPCore (x y z a) :precision binary64 (- x (tan a)))
                                    assert(x < y && y < z && z < a);
                                    double code(double x, double y, double z, double a) {
                                    	return x - tan(a);
                                    }
                                    
                                    NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                                    real(8) function code(x, y, z, a)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: y
                                        real(8), intent (in) :: z
                                        real(8), intent (in) :: a
                                        code = x - tan(a)
                                    end function
                                    
                                    assert x < y && y < z && z < a;
                                    public static double code(double x, double y, double z, double a) {
                                    	return x - Math.tan(a);
                                    }
                                    
                                    [x, y, z, a] = sort([x, y, z, a])
                                    def code(x, y, z, a):
                                    	return x - math.tan(a)
                                    
                                    x, y, z, a = sort([x, y, z, a])
                                    function code(x, y, z, a)
                                    	return Float64(x - tan(a))
                                    end
                                    
                                    x, y, z, a = num2cell(sort([x, y, z, a])){:}
                                    function tmp = code(x, y, z, a)
                                    	tmp = x - tan(a);
                                    end
                                    
                                    NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                                    code[x_, y_, z_, a_] := N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]
                                    
                                    \begin{array}{l}
                                    [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
                                    \\
                                    x - \tan a
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 77.3%

                                      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
                                    2. Add Preprocessing
                                    3. Step-by-step derivation
                                      1. associate-+r-N/A

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

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

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

                                        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\left(y + z\right)\right)\right), \tan a\right) \]
                                      5. +-lowering-+.f64N/A

                                        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \tan a\right) \]
                                      6. tan-lowering-tan.f6477.3%

                                        \[\leadsto \mathsf{\_.f64}\left(\mathsf{+.f64}\left(x, \mathsf{tan.f64}\left(\mathsf{+.f64}\left(y, z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right) \]
                                    4. Applied egg-rr77.3%

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

                                      \[\leadsto \mathsf{\_.f64}\left(\color{blue}{x}, \mathsf{tan.f64}\left(a\right)\right) \]
                                    6. Step-by-step derivation
                                      1. Simplified39.5%

                                        \[\leadsto \color{blue}{x} - \tan a \]
                                      2. Add Preprocessing

                                      Alternative 22: 32.0% accurate, 207.0× speedup?

                                      \[\begin{array}{l} [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\ \\ x \end{array} \]
                                      NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                                      (FPCore (x y z a) :precision binary64 x)
                                      assert(x < y && y < z && z < a);
                                      double code(double x, double y, double z, double a) {
                                      	return x;
                                      }
                                      
                                      NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                                      real(8) function code(x, y, z, a)
                                          real(8), intent (in) :: x
                                          real(8), intent (in) :: y
                                          real(8), intent (in) :: z
                                          real(8), intent (in) :: a
                                          code = x
                                      end function
                                      
                                      assert x < y && y < z && z < a;
                                      public static double code(double x, double y, double z, double a) {
                                      	return x;
                                      }
                                      
                                      [x, y, z, a] = sort([x, y, z, a])
                                      def code(x, y, z, a):
                                      	return x
                                      
                                      x, y, z, a = sort([x, y, z, a])
                                      function code(x, y, z, a)
                                      	return x
                                      end
                                      
                                      x, y, z, a = num2cell(sort([x, y, z, a])){:}
                                      function tmp = code(x, y, z, a)
                                      	tmp = x;
                                      end
                                      
                                      NOTE: x, y, z, and a should be sorted in increasing order before calling this function.
                                      code[x_, y_, z_, a_] := x
                                      
                                      \begin{array}{l}
                                      [x, y, z, a] = \mathsf{sort}([x, y, z, a])\\
                                      \\
                                      x
                                      \end{array}
                                      
                                      Derivation
                                      1. Initial program 77.3%

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

                                        \[\leadsto \color{blue}{x} \]
                                      4. Step-by-step derivation
                                        1. Simplified30.5%

                                          \[\leadsto \color{blue}{x} \]
                                        2. Add Preprocessing

                                        Reproduce

                                        ?
                                        herbie shell --seed 2024159 
                                        (FPCore (x y z a)
                                          :name "tan-example (used to crash)"
                                          :precision binary64
                                          :pre (and (and (and (or (== x 0.0) (and (<= 0.5884142 x) (<= x 505.5909))) (or (and (<= -1.796658e+308 y) (<= y -9.425585e-310)) (and (<= 1.284938e-309 y) (<= y 1.751224e+308)))) (or (and (<= -1.776707e+308 z) (<= z -8.599796e-310)) (and (<= 3.293145e-311 z) (<= z 1.725154e+308)))) (or (and (<= -1.796658e+308 a) (<= a -9.425585e-310)) (and (<= 1.284938e-309 a) (<= a 1.751224e+308))))
                                          (+ x (- (tan (+ y z)) (tan a))))