tan-example (used to crash)

Percentage Accurate: 79.4% → 99.7%
Time: 23.2s
Alternatives: 14
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 14 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 79.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(\tan \left(y + z\right) - \tan a\right) \end{array} \]
(FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
double code(double x, double y, double z, double a) {
	return x + (tan((y + z)) - tan(a));
}
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} \\ \begin{array}{l} t_0 := \tan y \cdot \tan z\\ x + \left(\frac{\tan y + \tan z}{1 - {t\_0}^{2}} \cdot \left(1 + t\_0\right) - \tan a\right) \end{array} \end{array} \]
(FPCore (x y z a)
 :precision binary64
 (let* ((t_0 (* (tan y) (tan z))))
   (+
    x
    (-
     (* (/ (+ (tan y) (tan z)) (- 1.0 (pow t_0 2.0))) (+ 1.0 t_0))
     (tan a)))))
double code(double x, double y, double z, double a) {
	double t_0 = tan(y) * tan(z);
	return x + ((((tan(y) + tan(z)) / (1.0 - pow(t_0, 2.0))) * (1.0 + t_0)) - 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
    real(8) :: t_0
    t_0 = tan(y) * tan(z)
    code = x + ((((tan(y) + tan(z)) / (1.0d0 - (t_0 ** 2.0d0))) * (1.0d0 + t_0)) - tan(a))
end function
public static double code(double x, double y, double z, double a) {
	double t_0 = Math.tan(y) * Math.tan(z);
	return x + ((((Math.tan(y) + Math.tan(z)) / (1.0 - Math.pow(t_0, 2.0))) * (1.0 + t_0)) - Math.tan(a));
}
def code(x, y, z, a):
	t_0 = math.tan(y) * math.tan(z)
	return x + ((((math.tan(y) + math.tan(z)) / (1.0 - math.pow(t_0, 2.0))) * (1.0 + t_0)) - math.tan(a))
function code(x, y, z, a)
	t_0 = Float64(tan(y) * tan(z))
	return Float64(x + Float64(Float64(Float64(Float64(tan(y) + tan(z)) / Float64(1.0 - (t_0 ^ 2.0))) * Float64(1.0 + t_0)) - tan(a)))
end
function tmp = code(x, y, z, a)
	t_0 = tan(y) * tan(z);
	tmp = x + ((((tan(y) + tan(z)) / (1.0 - (t_0 ^ 2.0))) * (1.0 + t_0)) - tan(a));
end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]}, N[(x + N[(N[(N[(N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \tan y \cdot \tan z\\
x + \left(\frac{\tan y + \tan z}{1 - {t\_0}^{2}} \cdot \left(1 + t\_0\right) - \tan a\right)
\end{array}
\end{array}
Derivation
  1. Initial program 79.4%

    \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
  2. 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. flip--N/A

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

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

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

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

Alternative 2: 99.7% accurate, 0.3× speedup?

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

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

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

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

    \[\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. associate-*r/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, \left(\frac{\tan y \cdot \sin z}{\cos z}\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(\left(\tan y \cdot \sin z\right), \cos 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(\mathsf{*.f64}\left(\tan y, \sin z\right), \cos z\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{*.f64}\left(\mathsf{tan.f64}\left(y\right), \sin z\right), \cos z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    6. sin-lowering-sin.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{*.f64}\left(\mathsf{tan.f64}\left(y\right), \mathsf{sin.f64}\left(z\right)\right), \cos z\right)\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    7. cos-lowering-cos.f6499.8%

      \[\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{*.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{tan.f64}\left(a\right)\right)\right) \]
  6. Applied egg-rr99.8%

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

Alternative 3: 99.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right) \end{array} \]
(FPCore (x y z a)
 :precision binary64
 (+ x (- (/ (+ (tan y) (tan z)) (- 1.0 (* (tan y) (tan z)))) (tan 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));
}
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
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));
}
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))
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
function tmp = code(x, y, z, a)
	tmp = x + (((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z)))) - tan(a));
end
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 + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \tan a\right)
\end{array}
Derivation
  1. Initial program 79.4%

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

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

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

Alternative 4: 89.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{-19}:\\
\;\;\;\;x + \left(\frac{\sin \left(y + z\right)}{\cos z \cdot \cos y} - \tan a\right)\\

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

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


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

    1. Initial program 83.8%

      \[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. clear-numN/A

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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, \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      11. tan-lowering-tan.f64N/A

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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 z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
      12. tan-lowering-tan.f6499.7%

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
    4. Applied egg-rr99.7%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{sin.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \left(\cos z \cdot \cos y\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(\mathsf{sin.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(\cos z, \cos y\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        12. cos-lowering-cos.f64N/A

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

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

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

      if -2.60000000000000013e-19 < a < 2.79999999999999996e-5

      1. Initial program 78.1%

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

          \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a}\right) \]
        2. 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), a\right)\right) \]
          2. *-lft-identityN/A

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), a\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), a\right)\right) \]
          8. tan-lowering-tan.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), a\right)\right) \]
          9. tan-lowering-tan.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), a\right)\right) \]
          10. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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, \tan z\right)\right), a\right)\right) \]
          11. tan-lowering-tan.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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 z\right)\right), a\right)\right) \]
          12. tan-lowering-tan.f6499.9%

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), a\right)\right) \]
        3. Applied egg-rr99.9%

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

        if 2.79999999999999996e-5 < a

        1. Initial program 78.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. clear-numN/A

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          10. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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, \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          11. tan-lowering-tan.f64N/A

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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 z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          12. tan-lowering-tan.f6499.7%

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
        4. Applied egg-rr99.7%

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\tan z + \left(\mathsf{neg}\left(\tan a\right)\right)\right)\right), x\right) \]
            8. *-rgt-identityN/A

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

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\mathsf{fma}\left(\tan z, 1, \mathsf{neg}\left(\tan a\right)\right)\right)\right), x\right) \]
            10. fmm-defN/A

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

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

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

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

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

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

              \[\leadsto \left(\left(\tan z - \tan a\right) + \tan y\right) + x \]
            2. associate-+l+N/A

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

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

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

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

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

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

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

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

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

        Alternative 5: 89.2% accurate, 0.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{-19}:\\ \;\;\;\;x + \left(\frac{\sin \left(y + z\right)}{\cos z \cdot \cos y} - \tan a\right)\\ \mathbf{elif}\;a \leq 2.8 \cdot 10^{-5}:\\ \;\;\;\;x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - a\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\tan z - \tan a\right) + \left(x + \tan y\right)\\ \end{array} \end{array} \]
        (FPCore (x y z a)
         :precision binary64
         (if (<= a -2e-19)
           (+ x (- (/ (sin (+ y z)) (* (cos z) (cos y))) (tan a)))
           (if (<= a 2.8e-5)
             (+ x (- (/ (+ (tan y) (tan z)) (- 1.0 (* (tan y) (tan z)))) a))
             (+ (- (tan z) (tan a)) (+ x (tan y))))))
        double code(double x, double y, double z, double a) {
        	double tmp;
        	if (a <= -2e-19) {
        		tmp = x + ((sin((y + z)) / (cos(z) * cos(y))) - tan(a));
        	} else if (a <= 2.8e-5) {
        		tmp = x + (((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z)))) - a);
        	} else {
        		tmp = (tan(z) - tan(a)) + (x + tan(y));
        	}
        	return tmp;
        }
        
        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 (a <= (-2d-19)) then
                tmp = x + ((sin((y + z)) / (cos(z) * cos(y))) - tan(a))
            else if (a <= 2.8d-5) then
                tmp = x + (((tan(y) + tan(z)) / (1.0d0 - (tan(y) * tan(z)))) - a)
            else
                tmp = (tan(z) - tan(a)) + (x + tan(y))
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double a) {
        	double tmp;
        	if (a <= -2e-19) {
        		tmp = x + ((Math.sin((y + z)) / (Math.cos(z) * Math.cos(y))) - Math.tan(a));
        	} else if (a <= 2.8e-5) {
        		tmp = x + (((Math.tan(y) + Math.tan(z)) / (1.0 - (Math.tan(y) * Math.tan(z)))) - a);
        	} else {
        		tmp = (Math.tan(z) - Math.tan(a)) + (x + Math.tan(y));
        	}
        	return tmp;
        }
        
        def code(x, y, z, a):
        	tmp = 0
        	if a <= -2e-19:
        		tmp = x + ((math.sin((y + z)) / (math.cos(z) * math.cos(y))) - math.tan(a))
        	elif a <= 2.8e-5:
        		tmp = x + (((math.tan(y) + math.tan(z)) / (1.0 - (math.tan(y) * math.tan(z)))) - a)
        	else:
        		tmp = (math.tan(z) - math.tan(a)) + (x + math.tan(y))
        	return tmp
        
        function code(x, y, z, a)
        	tmp = 0.0
        	if (a <= -2e-19)
        		tmp = Float64(x + Float64(Float64(sin(Float64(y + z)) / Float64(cos(z) * cos(y))) - tan(a)));
        	elseif (a <= 2.8e-5)
        		tmp = Float64(x + Float64(Float64(Float64(tan(y) + tan(z)) / Float64(1.0 - Float64(tan(y) * tan(z)))) - a));
        	else
        		tmp = Float64(Float64(tan(z) - tan(a)) + Float64(x + tan(y)));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, a)
        	tmp = 0.0;
        	if (a <= -2e-19)
        		tmp = x + ((sin((y + z)) / (cos(z) * cos(y))) - tan(a));
        	elseif (a <= 2.8e-5)
        		tmp = x + (((tan(y) + tan(z)) / (1.0 - (tan(y) * tan(z)))) - a);
        	else
        		tmp = (tan(z) - tan(a)) + (x + tan(y));
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, a_] := If[LessEqual[a, -2e-19], N[(x + N[(N[(N[Sin[N[(y + z), $MachinePrecision]], $MachinePrecision] / N[(N[Cos[z], $MachinePrecision] * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.8e-5], 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] - a), $MachinePrecision]), $MachinePrecision], N[(N[(N[Tan[z], $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision] + N[(x + N[Tan[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;a \leq -2 \cdot 10^{-19}:\\
        \;\;\;\;x + \left(\frac{\sin \left(y + z\right)}{\cos z \cdot \cos y} - \tan a\right)\\
        
        \mathbf{elif}\;a \leq 2.8 \cdot 10^{-5}:\\
        \;\;\;\;x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - a\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\tan z - \tan a\right) + \left(x + \tan y\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if a < -2e-19

          1. Initial program 83.8%

            \[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. clear-numN/A

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
            10. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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, \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
            11. tan-lowering-tan.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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 z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
            12. tan-lowering-tan.f6499.7%

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
          4. Applied egg-rr99.7%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{sin.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \left(\cos z \cdot \cos y\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(\mathsf{sin.f64}\left(\mathsf{+.f64}\left(y, z\right)\right), \mathsf{*.f64}\left(\cos z, \cos y\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              12. cos-lowering-cos.f64N/A

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

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

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

            if -2e-19 < a < 2.79999999999999996e-5

            1. Initial program 78.1%

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

                \[\leadsto x + \left(\tan \left(y + z\right) - \color{blue}{a}\right) \]
              2. 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), a\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), a\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), a\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), a\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), a\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), a\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), a\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), a\right)\right) \]
                9. tan-lowering-tan.f6499.9%

                  \[\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), a\right)\right) \]
              3. Applied egg-rr99.9%

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

              if 2.79999999999999996e-5 < a

              1. Initial program 78.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. clear-numN/A

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

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

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

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

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                10. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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, \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                11. tan-lowering-tan.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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 z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                12. tan-lowering-tan.f6499.7%

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              4. Applied egg-rr99.7%

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\tan z + \left(\mathsf{neg}\left(\tan a\right)\right)\right)\right), x\right) \]
                  8. *-rgt-identityN/A

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

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{tan.f64}\left(y\right), \left(\mathsf{fma}\left(\tan z, 1, \mathsf{neg}\left(\tan a\right)\right)\right)\right), x\right) \]
                  10. fmm-defN/A

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

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

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

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

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

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

                    \[\leadsto \left(\left(\tan z - \tan a\right) + \tan y\right) + x \]
                  2. associate-+l+N/A

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

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

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

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

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

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

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

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

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

              Alternative 6: 79.8% accurate, 0.7× speedup?

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

                \[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. clear-numN/A

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

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

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

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

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                10. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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, \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                11. tan-lowering-tan.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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 z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                12. tan-lowering-tan.f6499.8%

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
              4. Applied egg-rr99.8%

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{+.f64}\left(\mathsf{tan.f64}\left(z\right), \left(\color{blue}{\tan y} + \left(\mathsf{neg}\left(\tan a\right)\right)\right)\right)\right) \]
                  7. *-rgt-identityN/A

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

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

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

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

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

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

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

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

                Alternative 7: 69.7% accurate, 1.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \left(\tan y - \tan a\right)\\ \mathbf{if}\;a \leq -0.0066:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{-8}:\\ \;\;\;\;x + \left(\tan \left(y + z\right) - a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (x y z a)
                 :precision binary64
                 (let* ((t_0 (+ x (- (tan y) (tan a)))))
                   (if (<= a -0.0066) t_0 (if (<= a 2.9e-8) (+ x (- (tan (+ y z)) a)) t_0))))
                double code(double x, double y, double z, double a) {
                	double t_0 = x + (tan(y) - tan(a));
                	double tmp;
                	if (a <= -0.0066) {
                		tmp = t_0;
                	} else if (a <= 2.9e-8) {
                		tmp = x + (tan((y + z)) - a);
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                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.0066d0)) then
                        tmp = t_0
                    else if (a <= 2.9d-8) then
                        tmp = x + (tan((y + z)) - a)
                    else
                        tmp = t_0
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z, double a) {
                	double t_0 = x + (Math.tan(y) - Math.tan(a));
                	double tmp;
                	if (a <= -0.0066) {
                		tmp = t_0;
                	} else if (a <= 2.9e-8) {
                		tmp = x + (Math.tan((y + z)) - a);
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                def code(x, y, z, a):
                	t_0 = x + (math.tan(y) - math.tan(a))
                	tmp = 0
                	if a <= -0.0066:
                		tmp = t_0
                	elif a <= 2.9e-8:
                		tmp = x + (math.tan((y + z)) - a)
                	else:
                		tmp = t_0
                	return tmp
                
                function code(x, y, z, a)
                	t_0 = Float64(x + Float64(tan(y) - tan(a)))
                	tmp = 0.0
                	if (a <= -0.0066)
                		tmp = t_0;
                	elseif (a <= 2.9e-8)
                		tmp = Float64(x + Float64(tan(Float64(y + z)) - a));
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z, a)
                	t_0 = x + (tan(y) - tan(a));
                	tmp = 0.0;
                	if (a <= -0.0066)
                		tmp = t_0;
                	elseif (a <= 2.9e-8)
                		tmp = x + (tan((y + z)) - a);
                	else
                		tmp = t_0;
                	end
                	tmp_2 = tmp;
                end
                
                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.0066], t$95$0, If[LessEqual[a, 2.9e-8], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := x + \left(\tan y - \tan a\right)\\
                \mathbf{if}\;a \leq -0.0066:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;a \leq 2.9 \cdot 10^{-8}:\\
                \;\;\;\;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.0066 or 2.9000000000000002e-8 < a

                  1. Initial program 80.1%

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

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

                    if -0.0066 < a < 2.9000000000000002e-8

                    1. Initial program 78.7%

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

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

                    Alternative 8: 60.2% accurate, 1.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y + z \leq -2 \cdot 10^{-12}:\\ \;\;\;\;x + \left(\tan y - \tan a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\tan z - \tan a\right)\\ \end{array} \end{array} \]
                    (FPCore (x y z a)
                     :precision binary64
                     (if (<= (+ y z) -2e-12) (+ x (- (tan y) (tan a))) (+ x (- (tan z) (tan a)))))
                    double code(double x, double y, double z, double a) {
                    	double tmp;
                    	if ((y + z) <= -2e-12) {
                    		tmp = x + (tan(y) - tan(a));
                    	} else {
                    		tmp = x + (tan(z) - tan(a));
                    	}
                    	return tmp;
                    }
                    
                    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) <= (-2d-12)) then
                            tmp = x + (tan(y) - tan(a))
                        else
                            tmp = x + (tan(z) - tan(a))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x, double y, double z, double a) {
                    	double tmp;
                    	if ((y + z) <= -2e-12) {
                    		tmp = x + (Math.tan(y) - Math.tan(a));
                    	} else {
                    		tmp = x + (Math.tan(z) - Math.tan(a));
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z, a):
                    	tmp = 0
                    	if (y + z) <= -2e-12:
                    		tmp = x + (math.tan(y) - math.tan(a))
                    	else:
                    		tmp = x + (math.tan(z) - math.tan(a))
                    	return tmp
                    
                    function code(x, y, z, a)
                    	tmp = 0.0
                    	if (Float64(y + z) <= -2e-12)
                    		tmp = Float64(x + Float64(tan(y) - tan(a)));
                    	else
                    		tmp = Float64(x + Float64(tan(z) - tan(a)));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z, a)
                    	tmp = 0.0;
                    	if ((y + z) <= -2e-12)
                    		tmp = x + (tan(y) - tan(a));
                    	else
                    		tmp = x + (tan(z) - tan(a));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -2e-12], 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}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;y + z \leq -2 \cdot 10^{-12}:\\
                    \;\;\;\;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.99999999999999996e-12

                      1. Initial program 72.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. Simplified47.9%

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

                        if -1.99999999999999996e-12 < (+.f64 y z)

                        1. Initial program 82.5%

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

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

                        Alternative 9: 79.4% accurate, 1.0× speedup?

                        \[\begin{array}{l} \\ x + \left(\tan \left(y + z\right) - \tan a\right) \end{array} \]
                        (FPCore (x y z a) :precision binary64 (+ x (- (tan (+ y z)) (tan a))))
                        double code(double x, double y, double z, double a) {
                        	return x + (tan((y + z)) - tan(a));
                        }
                        
                        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}
                        
                        Derivation
                        1. Initial program 79.4%

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

                        Alternative 10: 55.1% accurate, 1.8× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \left(y - \tan a\right)\\ \mathbf{if}\;a \leq -470000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 0.0132:\\ \;\;\;\;x + \left(\tan \left(y + z\right) - a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                        (FPCore (x y z a)
                         :precision binary64
                         (let* ((t_0 (+ x (- y (tan a)))))
                           (if (<= a -470000000.0)
                             t_0
                             (if (<= a 0.0132) (+ x (- (tan (+ y z)) a)) t_0))))
                        double code(double x, double y, double z, double a) {
                        	double t_0 = x + (y - tan(a));
                        	double tmp;
                        	if (a <= -470000000.0) {
                        		tmp = t_0;
                        	} else if (a <= 0.0132) {
                        		tmp = x + (tan((y + z)) - a);
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        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 + (y - tan(a))
                            if (a <= (-470000000.0d0)) then
                                tmp = t_0
                            else if (a <= 0.0132d0) then
                                tmp = x + (tan((y + z)) - a)
                            else
                                tmp = t_0
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double x, double y, double z, double a) {
                        	double t_0 = x + (y - Math.tan(a));
                        	double tmp;
                        	if (a <= -470000000.0) {
                        		tmp = t_0;
                        	} else if (a <= 0.0132) {
                        		tmp = x + (Math.tan((y + z)) - a);
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        def code(x, y, z, a):
                        	t_0 = x + (y - math.tan(a))
                        	tmp = 0
                        	if a <= -470000000.0:
                        		tmp = t_0
                        	elif a <= 0.0132:
                        		tmp = x + (math.tan((y + z)) - a)
                        	else:
                        		tmp = t_0
                        	return tmp
                        
                        function code(x, y, z, a)
                        	t_0 = Float64(x + Float64(y - tan(a)))
                        	tmp = 0.0
                        	if (a <= -470000000.0)
                        		tmp = t_0;
                        	elseif (a <= 0.0132)
                        		tmp = Float64(x + Float64(tan(Float64(y + z)) - a));
                        	else
                        		tmp = t_0;
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(x, y, z, a)
                        	t_0 = x + (y - tan(a));
                        	tmp = 0.0;
                        	if (a <= -470000000.0)
                        		tmp = t_0;
                        	elseif (a <= 0.0132)
                        		tmp = x + (tan((y + z)) - a);
                        	else
                        		tmp = t_0;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x + N[(y - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -470000000.0], t$95$0, If[LessEqual[a, 0.0132], N[(x + N[(N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := x + \left(y - \tan a\right)\\
                        \mathbf{if}\;a \leq -470000000:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;a \leq 0.0132:\\
                        \;\;\;\;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 < -4.7e8 or 0.0132 < a

                          1. Initial program 80.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. clear-numN/A

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

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

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

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

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                            10. +-lowering-+.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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, \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                            11. tan-lowering-tan.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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 z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                            12. tan-lowering-tan.f6499.7%

                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                          4. Applied egg-rr99.7%

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

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

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

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

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

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

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

                                if -4.7e8 < a < 0.0132

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

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

                                Alternative 11: 45.2% accurate, 1.8× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \left(y - \tan a\right)\\ \mathbf{if}\;a \leq -470000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq 0.084:\\ \;\;\;\;x + \left(\tan z - a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                (FPCore (x y z a)
                                 :precision binary64
                                 (let* ((t_0 (+ x (- y (tan a)))))
                                   (if (<= a -470000000.0) t_0 (if (<= a 0.084) (+ x (- (tan z) a)) t_0))))
                                double code(double x, double y, double z, double a) {
                                	double t_0 = x + (y - tan(a));
                                	double tmp;
                                	if (a <= -470000000.0) {
                                		tmp = t_0;
                                	} else if (a <= 0.084) {
                                		tmp = x + (tan(z) - a);
                                	} else {
                                		tmp = t_0;
                                	}
                                	return tmp;
                                }
                                
                                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 + (y - tan(a))
                                    if (a <= (-470000000.0d0)) then
                                        tmp = t_0
                                    else if (a <= 0.084d0) then
                                        tmp = x + (tan(z) - a)
                                    else
                                        tmp = t_0
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double x, double y, double z, double a) {
                                	double t_0 = x + (y - Math.tan(a));
                                	double tmp;
                                	if (a <= -470000000.0) {
                                		tmp = t_0;
                                	} else if (a <= 0.084) {
                                		tmp = x + (Math.tan(z) - a);
                                	} else {
                                		tmp = t_0;
                                	}
                                	return tmp;
                                }
                                
                                def code(x, y, z, a):
                                	t_0 = x + (y - math.tan(a))
                                	tmp = 0
                                	if a <= -470000000.0:
                                		tmp = t_0
                                	elif a <= 0.084:
                                		tmp = x + (math.tan(z) - a)
                                	else:
                                		tmp = t_0
                                	return tmp
                                
                                function code(x, y, z, a)
                                	t_0 = Float64(x + Float64(y - tan(a)))
                                	tmp = 0.0
                                	if (a <= -470000000.0)
                                		tmp = t_0;
                                	elseif (a <= 0.084)
                                		tmp = Float64(x + Float64(tan(z) - a));
                                	else
                                		tmp = t_0;
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(x, y, z, a)
                                	t_0 = x + (y - tan(a));
                                	tmp = 0.0;
                                	if (a <= -470000000.0)
                                		tmp = t_0;
                                	elseif (a <= 0.084)
                                		tmp = x + (tan(z) - a);
                                	else
                                		tmp = t_0;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[x_, y_, z_, a_] := Block[{t$95$0 = N[(x + N[(y - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -470000000.0], t$95$0, If[LessEqual[a, 0.084], N[(x + N[(N[Tan[z], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                t_0 := x + \left(y - \tan a\right)\\
                                \mathbf{if}\;a \leq -470000000:\\
                                \;\;\;\;t\_0\\
                                
                                \mathbf{elif}\;a \leq 0.084:\\
                                \;\;\;\;x + \left(\tan z - a\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;t\_0\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if a < -4.7e8 or 0.0840000000000000052 < a

                                  1. Initial program 80.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. clear-numN/A

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

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

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

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

                                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                                    10. +-lowering-+.f64N/A

                                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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, \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                                    11. tan-lowering-tan.f64N/A

                                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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 z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                                    12. tan-lowering-tan.f6499.7%

                                      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                                  4. Applied egg-rr99.7%

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

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

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

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

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

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

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

                                        if -4.7e8 < a < 0.0840000000000000052

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

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

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

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

                                          Alternative 12: 43.6% accurate, 1.8× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.6:\\ \;\;\;\;x + \left(\tan y - a\right)\\ \mathbf{elif}\;y \leq 1.35:\\ \;\;\;\;x + \left(y - \tan a\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                                          (FPCore (x y z a)
                                           :precision binary64
                                           (if (<= y -2.6) (+ x (- (tan y) a)) (if (<= y 1.35) (+ x (- y (tan a))) x)))
                                          double code(double x, double y, double z, double a) {
                                          	double tmp;
                                          	if (y <= -2.6) {
                                          		tmp = x + (tan(y) - a);
                                          	} else if (y <= 1.35) {
                                          		tmp = x + (y - tan(a));
                                          	} else {
                                          		tmp = x;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          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 <= (-2.6d0)) then
                                                  tmp = x + (tan(y) - a)
                                              else if (y <= 1.35d0) then
                                                  tmp = x + (y - tan(a))
                                              else
                                                  tmp = x
                                              end if
                                              code = tmp
                                          end function
                                          
                                          public static double code(double x, double y, double z, double a) {
                                          	double tmp;
                                          	if (y <= -2.6) {
                                          		tmp = x + (Math.tan(y) - a);
                                          	} else if (y <= 1.35) {
                                          		tmp = x + (y - Math.tan(a));
                                          	} else {
                                          		tmp = x;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(x, y, z, a):
                                          	tmp = 0
                                          	if y <= -2.6:
                                          		tmp = x + (math.tan(y) - a)
                                          	elif y <= 1.35:
                                          		tmp = x + (y - math.tan(a))
                                          	else:
                                          		tmp = x
                                          	return tmp
                                          
                                          function code(x, y, z, a)
                                          	tmp = 0.0
                                          	if (y <= -2.6)
                                          		tmp = Float64(x + Float64(tan(y) - a));
                                          	elseif (y <= 1.35)
                                          		tmp = Float64(x + Float64(y - tan(a)));
                                          	else
                                          		tmp = x;
                                          	end
                                          	return tmp
                                          end
                                          
                                          function tmp_2 = code(x, y, z, a)
                                          	tmp = 0.0;
                                          	if (y <= -2.6)
                                          		tmp = x + (tan(y) - a);
                                          	elseif (y <= 1.35)
                                          		tmp = x + (y - tan(a));
                                          	else
                                          		tmp = x;
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[x_, y_, z_, a_] := If[LessEqual[y, -2.6], N[(x + N[(N[Tan[y], $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35], N[(x + N[(y - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;y \leq -2.6:\\
                                          \;\;\;\;x + \left(\tan y - a\right)\\
                                          
                                          \mathbf{elif}\;y \leq 1.35:\\
                                          \;\;\;\;x + \left(y - \tan a\right)\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;x\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if y < -2.60000000000000009

                                            1. Initial program 57.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. Simplified34.4%

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

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

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

                                                if -2.60000000000000009 < y < 1.3500000000000001

                                                1. Initial program 99.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. clear-numN/A

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

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

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

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

                                                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                                                  10. +-lowering-+.f64N/A

                                                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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, \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                                                  11. tan-lowering-tan.f64N/A

                                                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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 z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                                                  12. tan-lowering-tan.f6499.9%

                                                    \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                                                4. Applied egg-rr99.9%

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

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

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

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

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

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

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

                                                      if 1.3500000000000001 < y

                                                      1. Initial program 58.2%

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

                                                          \[\leadsto \color{blue}{x} \]
                                                      5. Recombined 3 regimes into one program.
                                                      6. Add Preprocessing

                                                      Alternative 13: 41.4% accurate, 1.8× speedup?

                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.25:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.1:\\ \;\;\;\;x + \left(y - \tan a\right)\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
                                                      (FPCore (x y z a)
                                                       :precision binary64
                                                       (if (<= y -1.25) x (if (<= y 2.1) (+ x (- y (tan a))) x)))
                                                      double code(double x, double y, double z, double a) {
                                                      	double tmp;
                                                      	if (y <= -1.25) {
                                                      		tmp = x;
                                                      	} else if (y <= 2.1) {
                                                      		tmp = x + (y - tan(a));
                                                      	} else {
                                                      		tmp = x;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      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 <= (-1.25d0)) then
                                                              tmp = x
                                                          else if (y <= 2.1d0) then
                                                              tmp = x + (y - tan(a))
                                                          else
                                                              tmp = x
                                                          end if
                                                          code = tmp
                                                      end function
                                                      
                                                      public static double code(double x, double y, double z, double a) {
                                                      	double tmp;
                                                      	if (y <= -1.25) {
                                                      		tmp = x;
                                                      	} else if (y <= 2.1) {
                                                      		tmp = x + (y - Math.tan(a));
                                                      	} else {
                                                      		tmp = x;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      def code(x, y, z, a):
                                                      	tmp = 0
                                                      	if y <= -1.25:
                                                      		tmp = x
                                                      	elif y <= 2.1:
                                                      		tmp = x + (y - math.tan(a))
                                                      	else:
                                                      		tmp = x
                                                      	return tmp
                                                      
                                                      function code(x, y, z, a)
                                                      	tmp = 0.0
                                                      	if (y <= -1.25)
                                                      		tmp = x;
                                                      	elseif (y <= 2.1)
                                                      		tmp = Float64(x + Float64(y - tan(a)));
                                                      	else
                                                      		tmp = x;
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      function tmp_2 = code(x, y, z, a)
                                                      	tmp = 0.0;
                                                      	if (y <= -1.25)
                                                      		tmp = x;
                                                      	elseif (y <= 2.1)
                                                      		tmp = x + (y - tan(a));
                                                      	else
                                                      		tmp = x;
                                                      	end
                                                      	tmp_2 = tmp;
                                                      end
                                                      
                                                      code[x_, y_, z_, a_] := If[LessEqual[y, -1.25], x, If[LessEqual[y, 2.1], N[(x + N[(y - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
                                                      
                                                      \begin{array}{l}
                                                      
                                                      \\
                                                      \begin{array}{l}
                                                      \mathbf{if}\;y \leq -1.25:\\
                                                      \;\;\;\;x\\
                                                      
                                                      \mathbf{elif}\;y \leq 2.1:\\
                                                      \;\;\;\;x + \left(y - \tan a\right)\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;x\\
                                                      
                                                      
                                                      \end{array}
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Split input into 2 regimes
                                                      2. if y < -1.25 or 2.10000000000000009 < y

                                                        1. Initial program 57.2%

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

                                                            \[\leadsto \color{blue}{x} \]

                                                          if -1.25 < y < 2.10000000000000009

                                                          1. Initial program 99.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. clear-numN/A

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

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

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

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

                                                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                                                            10. +-lowering-+.f64N/A

                                                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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, \tan z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                                                            11. tan-lowering-tan.f64N/A

                                                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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 z\right)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                                                            12. tan-lowering-tan.f6499.9%

                                                              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{\_.f64}\left(\mathsf{*.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)\right), \mathsf{tan.f64}\left(a\right)\right)\right) \]
                                                          4. Applied egg-rr99.9%

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

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

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

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

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

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

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

                                                              Alternative 14: 31.5% accurate, 207.0× speedup?

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

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

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

                                                                Reproduce

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