tan-example (used to crash)

Percentage Accurate: 79.5% → 99.7%
Time: 46.4s
Alternatives: 21
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 21 alternatives:

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

Initial Program: 79.5% accurate, 1.0× speedup?

\[\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.4× speedup?

\[\begin{array}{l} \\ x + \mathsf{fma}\left(\frac{-1}{-1 + \tan y \cdot \tan z}, \tan y + \tan z, -\tan a\right) \end{array} \]
(FPCore (x y z a)
 :precision binary64
 (+
  x
  (fma (/ -1.0 (+ -1.0 (* (tan y) (tan z)))) (+ (tan y) (tan z)) (- (tan a)))))
double code(double x, double y, double z, double a) {
	return x + fma((-1.0 / (-1.0 + (tan(y) * tan(z)))), (tan(y) + tan(z)), -tan(a));
}
function code(x, y, z, a)
	return Float64(x + fma(Float64(-1.0 / Float64(-1.0 + Float64(tan(y) * tan(z)))), Float64(tan(y) + tan(z)), Float64(-tan(a))))
end
code[x_, y_, z_, a_] := N[(x + N[(N[(-1.0 / N[(-1.0 + N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision] + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \mathsf{fma}\left(\frac{-1}{-1 + \tan y \cdot \tan z}, \tan y + \tan z, -\tan a\right)
\end{array}
Derivation
  1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan y + \tan z\\ t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\ \mathbf{if}\;\tan a \leq -0.1:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\tan a \leq 2 \cdot 10^{-37}:\\ \;\;\;\;x + \frac{t\_0}{1 - \tan y \cdot \tan z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z a)
 :precision binary64
 (let* ((t_0 (+ (tan y) (tan z))) (t_1 (+ x (fma 1.0 t_0 (- (tan a))))))
   (if (<= (tan a) -0.1)
     t_1
     (if (<= (tan a) 2e-37) (+ x (/ t_0 (- 1.0 (* (tan y) (tan z))))) t_1))))
double code(double x, double y, double z, double a) {
	double t_0 = tan(y) + tan(z);
	double t_1 = x + fma(1.0, t_0, -tan(a));
	double tmp;
	if (tan(a) <= -0.1) {
		tmp = t_1;
	} else if (tan(a) <= 2e-37) {
		tmp = x + (t_0 / (1.0 - (tan(y) * tan(z))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, a)
	t_0 = Float64(tan(y) + tan(z))
	t_1 = Float64(x + fma(1.0, t_0, Float64(-tan(a))))
	tmp = 0.0
	if (tan(a) <= -0.1)
		tmp = t_1;
	elseif (tan(a) <= 2e-37)
		tmp = Float64(x + Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))));
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(1.0 * t$95$0 + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Tan[a], $MachinePrecision], -0.1], t$95$1, If[LessEqual[N[Tan[a], $MachinePrecision], 2e-37], N[(x + N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \tan y + \tan z\\
t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\
\mathbf{if}\;\tan a \leq -0.1:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;\tan a \leq 2 \cdot 10^{-37}:\\
\;\;\;\;x + \frac{t\_0}{1 - \tan y \cdot \tan z}\\

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


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

    1. Initial program 76.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -0.10000000000000001 < (tan.f64 a) < 2.00000000000000013e-37

      1. Initial program 77.6%

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

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

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

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

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

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

          \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\tan a - x\right)} \]
        7. tan-lowering-tan.f6477.6

          \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
      4. Applied egg-rr77.6%

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

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

          \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
        2. neg-lowering-neg.f6477.3

          \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(-x\right)} \]
      7. Simplified77.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\tan y + \tan z}{1 - \color{blue}{\tan y} \cdot \tan z} - \left(\mathsf{neg}\left(x\right)\right) \]
        16. tan-lowering-tan.f6498.5

          \[\leadsto \frac{\tan y + \tan z}{1 - \tan y \cdot \color{blue}{\tan z}} - \left(-x\right) \]
      9. Applied egg-rr98.5%

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

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

    Alternative 3: 99.7% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 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 77.0%

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 89.9% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan y + \tan z\\ t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\ \mathbf{if}\;a \leq -0.075:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 0.47:\\ \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - \mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, \mathsf{fma}\left(a, a \cdot 0.05396825396825397, 0.13333333333333333\right), 0.3333333333333333\right), a \cdot \left(a \cdot a\right), a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z a)
     :precision binary64
     (let* ((t_0 (+ (tan y) (tan z))) (t_1 (+ x (fma 1.0 t_0 (- (tan a))))))
       (if (<= a -0.075)
         t_1
         (if (<= a 0.47)
           (+
            x
            (-
             (/ t_0 (- 1.0 (* (tan y) (tan z))))
             (fma
              (fma
               (* a a)
               (fma a (* a 0.05396825396825397) 0.13333333333333333)
               0.3333333333333333)
              (* a (* a a))
              a)))
           t_1))))
    double code(double x, double y, double z, double a) {
    	double t_0 = tan(y) + tan(z);
    	double t_1 = x + fma(1.0, t_0, -tan(a));
    	double tmp;
    	if (a <= -0.075) {
    		tmp = t_1;
    	} else if (a <= 0.47) {
    		tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - fma(fma((a * a), fma(a, (a * 0.05396825396825397), 0.13333333333333333), 0.3333333333333333), (a * (a * a)), a));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, a)
    	t_0 = Float64(tan(y) + tan(z))
    	t_1 = Float64(x + fma(1.0, t_0, Float64(-tan(a))))
    	tmp = 0.0
    	if (a <= -0.075)
    		tmp = t_1;
    	elseif (a <= 0.47)
    		tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))) - fma(fma(Float64(a * a), fma(a, Float64(a * 0.05396825396825397), 0.13333333333333333), 0.3333333333333333), Float64(a * Float64(a * a)), a)));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(1.0 * t$95$0 + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.075], t$95$1, If[LessEqual[a, 0.47], N[(x + N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a * a), $MachinePrecision] * N[(a * N[(a * 0.05396825396825397), $MachinePrecision] + 0.13333333333333333), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \tan y + \tan z\\
    t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\
    \mathbf{if}\;a \leq -0.075:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;a \leq 0.47:\\
    \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - \mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, \mathsf{fma}\left(a, a \cdot 0.05396825396825397, 0.13333333333333333\right), 0.3333333333333333\right), a \cdot \left(a \cdot a\right), a\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if a < -0.0749999999999999972 or 0.46999999999999997 < a

      1. Initial program 75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -0.0749999999999999972 < a < 0.46999999999999997

        1. Initial program 79.1%

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - a \cdot \color{blue}{\left({a}^{2} \cdot \left(\frac{1}{3} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right) + 1\right)}\right) \]
          2. distribute-rgt-inN/A

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

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

            \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \left(\color{blue}{\left(\left(\frac{1}{3} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right) \cdot {a}^{2}\right)} \cdot a + a\right)\right) \]
          5. associate-*l*N/A

            \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \left(\color{blue}{\left(\frac{1}{3} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right) \cdot \left({a}^{2} \cdot a\right)} + a\right)\right) \]
          6. pow-plusN/A

            \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \left(\left(\frac{1}{3} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right) \cdot \color{blue}{{a}^{\left(2 + 1\right)}} + a\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \left(\left(\frac{1}{3} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right)\right) \cdot {a}^{\color{blue}{3}} + a\right)\right) \]
          8. cube-unmultN/A

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

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

            \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \color{blue}{\mathsf{fma}\left(\frac{1}{3} + {a}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {a}^{2}\right), a \cdot {a}^{2}, a\right)}\right) \]
        7. Simplified99.5%

          \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, \mathsf{fma}\left(a, a \cdot 0.05396825396825397, 0.13333333333333333\right), 0.3333333333333333\right), a \cdot \left(a \cdot a\right), a\right)}\right) \]
      7. Recombined 2 regimes into one program.
      8. Add Preprocessing

      Alternative 6: 89.8% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan y + \tan z\\ t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\ \mathbf{if}\;a \leq -0.048:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 0.47:\\ \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - \mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, 0.13333333333333333, 0.3333333333333333\right), a \cdot \left(a \cdot a\right), a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z a)
       :precision binary64
       (let* ((t_0 (+ (tan y) (tan z))) (t_1 (+ x (fma 1.0 t_0 (- (tan a))))))
         (if (<= a -0.048)
           t_1
           (if (<= a 0.47)
             (+
              x
              (-
               (/ t_0 (- 1.0 (* (tan y) (tan z))))
               (fma
                (fma (* a a) 0.13333333333333333 0.3333333333333333)
                (* a (* a a))
                a)))
             t_1))))
      double code(double x, double y, double z, double a) {
      	double t_0 = tan(y) + tan(z);
      	double t_1 = x + fma(1.0, t_0, -tan(a));
      	double tmp;
      	if (a <= -0.048) {
      		tmp = t_1;
      	} else if (a <= 0.47) {
      		tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - fma(fma((a * a), 0.13333333333333333, 0.3333333333333333), (a * (a * a)), a));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, a)
      	t_0 = Float64(tan(y) + tan(z))
      	t_1 = Float64(x + fma(1.0, t_0, Float64(-tan(a))))
      	tmp = 0.0
      	if (a <= -0.048)
      		tmp = t_1;
      	elseif (a <= 0.47)
      		tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))) - fma(fma(Float64(a * a), 0.13333333333333333, 0.3333333333333333), Float64(a * Float64(a * a)), a)));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(1.0 * t$95$0 + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.048], t$95$1, If[LessEqual[a, 0.47], N[(x + N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a * a), $MachinePrecision] * 0.13333333333333333 + 0.3333333333333333), $MachinePrecision] * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \tan y + \tan z\\
      t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\
      \mathbf{if}\;a \leq -0.048:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;a \leq 0.47:\\
      \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - \mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, 0.13333333333333333, 0.3333333333333333\right), a \cdot \left(a \cdot a\right), a\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if a < -0.048000000000000001 or 0.46999999999999997 < a

        1. Initial program 75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -0.048000000000000001 < a < 0.46999999999999997

          1. Initial program 79.1%

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - a \cdot \color{blue}{\left({a}^{2} \cdot \left(\frac{1}{3} + \frac{2}{15} \cdot {a}^{2}\right) + 1\right)}\right) \]
            2. distribute-rgt-inN/A

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

              \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \left(\color{blue}{\left(\left(\frac{1}{3} + \frac{2}{15} \cdot {a}^{2}\right) \cdot {a}^{2}\right)} \cdot a + 1 \cdot a\right)\right) \]
            4. associate-*l*N/A

              \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \left(\color{blue}{\left(\frac{1}{3} + \frac{2}{15} \cdot {a}^{2}\right) \cdot \left({a}^{2} \cdot a\right)} + 1 \cdot a\right)\right) \]
            5. pow-plusN/A

              \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \left(\left(\frac{1}{3} + \frac{2}{15} \cdot {a}^{2}\right) \cdot \color{blue}{{a}^{\left(2 + 1\right)}} + 1 \cdot a\right)\right) \]
            6. metadata-evalN/A

              \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \left(\left(\frac{1}{3} + \frac{2}{15} \cdot {a}^{2}\right) \cdot {a}^{\color{blue}{3}} + 1 \cdot a\right)\right) \]
            7. cube-unmultN/A

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

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

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

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

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

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

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

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

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

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

              \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, \frac{2}{15}, \frac{1}{3}\right), a \cdot \color{blue}{\left(a \cdot a\right)}, a\right)\right) \]
            18. *-lowering-*.f6499.4

              \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, 0.13333333333333333, 0.3333333333333333\right), a \cdot \color{blue}{\left(a \cdot a\right)}, a\right)\right) \]
          7. Simplified99.4%

            \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(a \cdot a, 0.13333333333333333, 0.3333333333333333\right), a \cdot \left(a \cdot a\right), a\right)}\right) \]
        7. Recombined 2 regimes into one program.
        8. Add Preprocessing

        Alternative 7: 89.8% accurate, 0.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan y + \tan z\\ t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\ \mathbf{if}\;a \leq -0.026:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 0.47:\\ \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - \mathsf{fma}\left(0.3333333333333333, a \cdot \left(a \cdot a\right), a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z a)
         :precision binary64
         (let* ((t_0 (+ (tan y) (tan z))) (t_1 (+ x (fma 1.0 t_0 (- (tan a))))))
           (if (<= a -0.026)
             t_1
             (if (<= a 0.47)
               (+
                x
                (-
                 (/ t_0 (- 1.0 (* (tan y) (tan z))))
                 (fma 0.3333333333333333 (* a (* a a)) a)))
               t_1))))
        double code(double x, double y, double z, double a) {
        	double t_0 = tan(y) + tan(z);
        	double t_1 = x + fma(1.0, t_0, -tan(a));
        	double tmp;
        	if (a <= -0.026) {
        		tmp = t_1;
        	} else if (a <= 0.47) {
        		tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - fma(0.3333333333333333, (a * (a * a)), a));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(x, y, z, a)
        	t_0 = Float64(tan(y) + tan(z))
        	t_1 = Float64(x + fma(1.0, t_0, Float64(-tan(a))))
        	tmp = 0.0
        	if (a <= -0.026)
        		tmp = t_1;
        	elseif (a <= 0.47)
        		tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))) - fma(0.3333333333333333, Float64(a * Float64(a * a)), a)));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(1.0 * t$95$0 + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.026], t$95$1, If[LessEqual[a, 0.47], N[(x + N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(0.3333333333333333 * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \tan y + \tan z\\
        t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\
        \mathbf{if}\;a \leq -0.026:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;a \leq 0.47:\\
        \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - \mathsf{fma}\left(0.3333333333333333, a \cdot \left(a \cdot a\right), a\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if a < -0.0259999999999999988 or 0.46999999999999997 < a

          1. Initial program 75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -0.0259999999999999988 < a < 0.46999999999999997

            1. Initial program 79.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \mathsf{fma}\left(\frac{1}{3}, a \cdot \color{blue}{\left(a \cdot a\right)}, a\right)\right) \]
              12. *-lowering-*.f6499.3

                \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \mathsf{fma}\left(0.3333333333333333, a \cdot \color{blue}{\left(a \cdot a\right)}, a\right)\right) \]
            7. Simplified99.3%

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

          Alternative 8: 89.3% accurate, 0.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan y + \tan z\\ t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\ \mathbf{if}\;a \leq -0.0051:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{-34}:\\ \;\;\;\;x + \mathsf{fma}\left(\frac{-1}{-1 + \tan y \cdot \tan z}, t\_0, -a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z a)
           :precision binary64
           (let* ((t_0 (+ (tan y) (tan z))) (t_1 (+ x (fma 1.0 t_0 (- (tan a))))))
             (if (<= a -0.0051)
               t_1
               (if (<= a 2.6e-34)
                 (+ x (fma (/ -1.0 (+ -1.0 (* (tan y) (tan z)))) t_0 (- a)))
                 t_1))))
          double code(double x, double y, double z, double a) {
          	double t_0 = tan(y) + tan(z);
          	double t_1 = x + fma(1.0, t_0, -tan(a));
          	double tmp;
          	if (a <= -0.0051) {
          		tmp = t_1;
          	} else if (a <= 2.6e-34) {
          		tmp = x + fma((-1.0 / (-1.0 + (tan(y) * tan(z)))), t_0, -a);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, a)
          	t_0 = Float64(tan(y) + tan(z))
          	t_1 = Float64(x + fma(1.0, t_0, Float64(-tan(a))))
          	tmp = 0.0
          	if (a <= -0.0051)
          		tmp = t_1;
          	elseif (a <= 2.6e-34)
          		tmp = Float64(x + fma(Float64(-1.0 / Float64(-1.0 + Float64(tan(y) * tan(z)))), t_0, Float64(-a)));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(1.0 * t$95$0 + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.0051], t$95$1, If[LessEqual[a, 2.6e-34], N[(x + N[(N[(-1.0 / N[(-1.0 + N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0 + (-a)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \tan y + \tan z\\
          t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\
          \mathbf{if}\;a \leq -0.0051:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;a \leq 2.6 \cdot 10^{-34}:\\
          \;\;\;\;x + \mathsf{fma}\left(\frac{-1}{-1 + \tan y \cdot \tan z}, t\_0, -a\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if a < -0.0051000000000000004 or 2.5999999999999999e-34 < a

            1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -0.0051000000000000004 < a < 2.5999999999999999e-34

              1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto x + \mathsf{fma}\left(\frac{1}{1 - \tan y \cdot \tan z}, \tan y + \tan z, \mathsf{neg}\left(\color{blue}{a}\right)\right) \]
              6. Step-by-step derivation
                1. Simplified99.8%

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

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

              Alternative 9: 89.3% accurate, 0.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan y + \tan z\\ t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\ \mathbf{if}\;a \leq -0.00033:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 2.6 \cdot 10^{-34}:\\ \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (x y z a)
               :precision binary64
               (let* ((t_0 (+ (tan y) (tan z))) (t_1 (+ x (fma 1.0 t_0 (- (tan a))))))
                 (if (<= a -0.00033)
                   t_1
                   (if (<= a 2.6e-34) (+ x (- (/ t_0 (- 1.0 (* (tan y) (tan z)))) a)) t_1))))
              double code(double x, double y, double z, double a) {
              	double t_0 = tan(y) + tan(z);
              	double t_1 = x + fma(1.0, t_0, -tan(a));
              	double tmp;
              	if (a <= -0.00033) {
              		tmp = t_1;
              	} else if (a <= 2.6e-34) {
              		tmp = x + ((t_0 / (1.0 - (tan(y) * tan(z)))) - a);
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              function code(x, y, z, a)
              	t_0 = Float64(tan(y) + tan(z))
              	t_1 = Float64(x + fma(1.0, t_0, Float64(-tan(a))))
              	tmp = 0.0
              	if (a <= -0.00033)
              		tmp = t_1;
              	elseif (a <= 2.6e-34)
              		tmp = Float64(x + Float64(Float64(t_0 / Float64(1.0 - Float64(tan(y) * tan(z)))) - a));
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              code[x_, y_, z_, a_] := Block[{t$95$0 = N[(N[Tan[y], $MachinePrecision] + N[Tan[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + N[(1.0 * t$95$0 + (-N[Tan[a], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -0.00033], t$95$1, If[LessEqual[a, 2.6e-34], N[(x + N[(N[(t$95$0 / N[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \tan y + \tan z\\
              t_1 := x + \mathsf{fma}\left(1, t\_0, -\tan a\right)\\
              \mathbf{if}\;a \leq -0.00033:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;a \leq 2.6 \cdot 10^{-34}:\\
              \;\;\;\;x + \left(\frac{t\_0}{1 - \tan y \cdot \tan z} - a\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if a < -3.3e-4 or 2.5999999999999999e-34 < a

                1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if -3.3e-4 < a < 2.5999999999999999e-34

                  1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto x + \left(\frac{\tan y + \tan z}{1 - \tan y \cdot \tan z} - \color{blue}{a}\right) \]
                  6. Step-by-step derivation
                    1. Simplified99.8%

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

                  Alternative 10: 79.9% accurate, 0.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 11: 70.1% accurate, 1.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 4.2 \cdot 10^{-14}:\\ \;\;\;\;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 (<= z 4.2e-14) (+ x (- (tan y) (tan a))) (+ x (- (tan z) (tan a)))))
                    double code(double x, double y, double z, double a) {
                    	double tmp;
                    	if (z <= 4.2e-14) {
                    		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 (z <= 4.2d-14) 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 (z <= 4.2e-14) {
                    		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 z <= 4.2e-14:
                    		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 (z <= 4.2e-14)
                    		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 (z <= 4.2e-14)
                    		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[z, 4.2e-14], 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}\;z \leq 4.2 \cdot 10^{-14}:\\
                    \;\;\;\;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 z < 4.1999999999999998e-14

                      1. Initial program 85.9%

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

                        \[\leadsto x + \left(\tan \color{blue}{y} - \tan a\right) \]
                      4. Step-by-step derivation
                        1. Simplified74.0%

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

                        if 4.1999999999999998e-14 < z

                        1. Initial program 50.9%

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

                          \[\leadsto x + \left(\tan \color{blue}{z} - \tan a\right) \]
                        4. Step-by-step derivation
                          1. Simplified50.9%

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

                        Alternative 12: 65.1% accurate, 1.0× speedup?

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

                          1. Initial program 85.9%

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

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

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

                            if 1e-3 < z

                            1. Initial program 49.9%

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

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

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

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

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

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

                                \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\tan a - x\right)} \]
                              7. tan-lowering-tan.f6449.8

                                \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                            4. Applied egg-rr49.8%

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

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

                                \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                              2. neg-lowering-neg.f6434.3

                                \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(-x\right)} \]
                            7. Simplified34.3%

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

                              \[\leadsto \tan \color{blue}{z} - \left(\mathsf{neg}\left(x\right)\right) \]
                            9. Step-by-step derivation
                              1. Simplified34.8%

                                \[\leadsto \tan \color{blue}{z} - \left(-x\right) \]
                            10. Recombined 2 regimes into one program.
                            11. Final simplification64.2%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 0.001:\\ \;\;\;\;x + \left(\tan y - \tan a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \tan z\\ \end{array} \]
                            12. Add Preprocessing

                            Alternative 13: 79.5% 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 77.0%

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

                            Alternative 14: 50.8% accurate, 1.3× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y + z \leq -50:\\ \;\;\;\;x + \tan y\\ \mathbf{elif}\;y + z \leq 5 \cdot 10^{-5}:\\ \;\;\;\;\mathsf{fma}\left(y, \left(y \cdot y\right) \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.05396825396825397, 0.13333333333333333\right), 0.3333333333333333\right), y\right) + \left(x - \tan a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \tan \left(\mathsf{fma}\left(z, \frac{y}{z}, z\right)\right)\\ \end{array} \end{array} \]
                            (FPCore (x y z a)
                             :precision binary64
                             (if (<= (+ y z) -50.0)
                               (+ x (tan y))
                               (if (<= (+ y z) 5e-5)
                                 (+
                                  (fma
                                   y
                                   (*
                                    (* y y)
                                    (fma
                                     (* y y)
                                     (fma (* y y) 0.05396825396825397 0.13333333333333333)
                                     0.3333333333333333))
                                   y)
                                  (- x (tan a)))
                                 (+ x (tan (fma z (/ y z) z))))))
                            double code(double x, double y, double z, double a) {
                            	double tmp;
                            	if ((y + z) <= -50.0) {
                            		tmp = x + tan(y);
                            	} else if ((y + z) <= 5e-5) {
                            		tmp = fma(y, ((y * y) * fma((y * y), fma((y * y), 0.05396825396825397, 0.13333333333333333), 0.3333333333333333)), y) + (x - tan(a));
                            	} else {
                            		tmp = x + tan(fma(z, (y / z), z));
                            	}
                            	return tmp;
                            }
                            
                            function code(x, y, z, a)
                            	tmp = 0.0
                            	if (Float64(y + z) <= -50.0)
                            		tmp = Float64(x + tan(y));
                            	elseif (Float64(y + z) <= 5e-5)
                            		tmp = Float64(fma(y, Float64(Float64(y * y) * fma(Float64(y * y), fma(Float64(y * y), 0.05396825396825397, 0.13333333333333333), 0.3333333333333333)), y) + Float64(x - tan(a)));
                            	else
                            		tmp = Float64(x + tan(fma(z, Float64(y / z), z)));
                            	end
                            	return tmp
                            end
                            
                            code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -50.0], N[(x + N[Tan[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y + z), $MachinePrecision], 5e-5], N[(N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.05396825396825397 + 0.13333333333333333), $MachinePrecision] + 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Tan[N[(z * N[(y / z), $MachinePrecision] + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;y + z \leq -50:\\
                            \;\;\;\;x + \tan y\\
                            
                            \mathbf{elif}\;y + z \leq 5 \cdot 10^{-5}:\\
                            \;\;\;\;\mathsf{fma}\left(y, \left(y \cdot y\right) \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.05396825396825397, 0.13333333333333333\right), 0.3333333333333333\right), y\right) + \left(x - \tan a\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;x + \tan \left(\mathsf{fma}\left(z, \frac{y}{z}, z\right)\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if (+.f64 y z) < -50

                              1. Initial program 69.4%

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

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

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

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

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

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

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

                                  \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                              4. Applied egg-rr69.4%

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

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

                                  \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                                2. neg-lowering-neg.f6442.6

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

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

                                \[\leadsto \tan \color{blue}{y} - \left(\mathsf{neg}\left(x\right)\right) \]
                              9. Step-by-step derivation
                                1. Simplified30.5%

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

                                    \[\leadsto \color{blue}{\tan y + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
                                  2. remove-double-negN/A

                                    \[\leadsto \tan y + \color{blue}{x} \]
                                  3. +-lowering-+.f64N/A

                                    \[\leadsto \color{blue}{\tan y + x} \]
                                  4. tan-lowering-tan.f6430.5

                                    \[\leadsto \color{blue}{\tan y} + x \]
                                3. Applied egg-rr30.5%

                                  \[\leadsto \color{blue}{\tan y + x} \]

                                if -50 < (+.f64 y z) < 5.00000000000000024e-5

                                1. Initial program 100.0%

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

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

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

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

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

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

                                    \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\tan a - x\right)} \]
                                  7. tan-lowering-tan.f6499.9

                                    \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                4. Applied egg-rr99.9%

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

                                  \[\leadsto \tan \color{blue}{y} - \left(\tan a - x\right) \]
                                6. Step-by-step derivation
                                  1. Simplified97.8%

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

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

                                      \[\leadsto y \cdot \color{blue}{\left({y}^{2} \cdot \left(\frac{1}{3} + {y}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {y}^{2}\right)\right) + 1\right)} - \left(\tan a - x\right) \]
                                    2. distribute-lft-inN/A

                                      \[\leadsto \color{blue}{\left(y \cdot \left({y}^{2} \cdot \left(\frac{1}{3} + {y}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {y}^{2}\right)\right)\right) + y \cdot 1\right)} - \left(\tan a - x\right) \]
                                    3. *-rgt-identityN/A

                                      \[\leadsto \left(y \cdot \left({y}^{2} \cdot \left(\frac{1}{3} + {y}^{2} \cdot \left(\frac{2}{15} + \frac{17}{315} \cdot {y}^{2}\right)\right)\right) + \color{blue}{y}\right) - \left(\tan a - x\right) \]
                                    4. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \mathsf{fma}\left(y, \left(y \cdot y\right) \cdot \mathsf{fma}\left(y \cdot y, \color{blue}{\mathsf{fma}\left({y}^{2}, \frac{17}{315}, \frac{2}{15}\right)}, \frac{1}{3}\right), y\right) - \left(\tan a - x\right) \]
                                    15. unpow2N/A

                                      \[\leadsto \mathsf{fma}\left(y, \left(y \cdot y\right) \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(\color{blue}{y \cdot y}, \frac{17}{315}, \frac{2}{15}\right), \frac{1}{3}\right), y\right) - \left(\tan a - x\right) \]
                                    16. *-lowering-*.f6497.8

                                      \[\leadsto \mathsf{fma}\left(y, \left(y \cdot y\right) \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(\color{blue}{y \cdot y}, 0.05396825396825397, 0.13333333333333333\right), 0.3333333333333333\right), y\right) - \left(\tan a - x\right) \]
                                  4. Simplified97.8%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(y, \left(y \cdot y\right) \cdot \mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(y \cdot y, 0.05396825396825397, 0.13333333333333333\right), 0.3333333333333333\right), y\right)} - \left(\tan a - x\right) \]

                                  if 5.00000000000000024e-5 < (+.f64 y z)

                                  1. Initial program 67.3%

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

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

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

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

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

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

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

                                      \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                  4. Applied egg-rr67.2%

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

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

                                      \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                                    2. neg-lowering-neg.f6445.1

                                      \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(-x\right)} \]
                                  7. Simplified45.1%

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

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

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

                                      \[\leadsto \tan \color{blue}{\left(z \cdot \frac{y}{z} + z \cdot 1\right)} - \left(\mathsf{neg}\left(x\right)\right) \]
                                    3. *-rgt-identityN/A

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

                                      \[\leadsto \tan \color{blue}{\left(\mathsf{fma}\left(z, \frac{y}{z}, z\right)\right)} - \left(\mathsf{neg}\left(x\right)\right) \]
                                    5. /-lowering-/.f6429.1

                                      \[\leadsto \tan \left(\mathsf{fma}\left(z, \color{blue}{\frac{y}{z}}, z\right)\right) - \left(-x\right) \]
                                  10. Simplified29.1%

                                    \[\leadsto \tan \color{blue}{\left(\mathsf{fma}\left(z, \frac{y}{z}, z\right)\right)} - \left(-x\right) \]
                                7. Recombined 3 regimes into one program.
                                8. Final simplification48.4%

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

                                Alternative 15: 50.8% accurate, 1.4× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y + z \leq -50:\\ \;\;\;\;x + \tan y\\ \mathbf{elif}\;y + z \leq 5 \cdot 10^{-5}:\\ \;\;\;\;\mathsf{fma}\left(y, \left(y \cdot y\right) \cdot \mathsf{fma}\left(y \cdot y, 0.13333333333333333, 0.3333333333333333\right), y\right) + \left(x - \tan a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \tan \left(\mathsf{fma}\left(z, \frac{y}{z}, z\right)\right)\\ \end{array} \end{array} \]
                                (FPCore (x y z a)
                                 :precision binary64
                                 (if (<= (+ y z) -50.0)
                                   (+ x (tan y))
                                   (if (<= (+ y z) 5e-5)
                                     (+
                                      (fma
                                       y
                                       (* (* y y) (fma (* y y) 0.13333333333333333 0.3333333333333333))
                                       y)
                                      (- x (tan a)))
                                     (+ x (tan (fma z (/ y z) z))))))
                                double code(double x, double y, double z, double a) {
                                	double tmp;
                                	if ((y + z) <= -50.0) {
                                		tmp = x + tan(y);
                                	} else if ((y + z) <= 5e-5) {
                                		tmp = fma(y, ((y * y) * fma((y * y), 0.13333333333333333, 0.3333333333333333)), y) + (x - tan(a));
                                	} else {
                                		tmp = x + tan(fma(z, (y / z), z));
                                	}
                                	return tmp;
                                }
                                
                                function code(x, y, z, a)
                                	tmp = 0.0
                                	if (Float64(y + z) <= -50.0)
                                		tmp = Float64(x + tan(y));
                                	elseif (Float64(y + z) <= 5e-5)
                                		tmp = Float64(fma(y, Float64(Float64(y * y) * fma(Float64(y * y), 0.13333333333333333, 0.3333333333333333)), y) + Float64(x - tan(a)));
                                	else
                                		tmp = Float64(x + tan(fma(z, Float64(y / z), z)));
                                	end
                                	return tmp
                                end
                                
                                code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -50.0], N[(x + N[Tan[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y + z), $MachinePrecision], 5e-5], N[(N[(y * N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.13333333333333333 + 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Tan[N[(z * N[(y / z), $MachinePrecision] + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;y + z \leq -50:\\
                                \;\;\;\;x + \tan y\\
                                
                                \mathbf{elif}\;y + z \leq 5 \cdot 10^{-5}:\\
                                \;\;\;\;\mathsf{fma}\left(y, \left(y \cdot y\right) \cdot \mathsf{fma}\left(y \cdot y, 0.13333333333333333, 0.3333333333333333\right), y\right) + \left(x - \tan a\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;x + \tan \left(\mathsf{fma}\left(z, \frac{y}{z}, z\right)\right)\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if (+.f64 y z) < -50

                                  1. Initial program 69.4%

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

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

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

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

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

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

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

                                      \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                  4. Applied egg-rr69.4%

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

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

                                      \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                                    2. neg-lowering-neg.f6442.6

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

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

                                    \[\leadsto \tan \color{blue}{y} - \left(\mathsf{neg}\left(x\right)\right) \]
                                  9. Step-by-step derivation
                                    1. Simplified30.5%

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

                                        \[\leadsto \color{blue}{\tan y + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
                                      2. remove-double-negN/A

                                        \[\leadsto \tan y + \color{blue}{x} \]
                                      3. +-lowering-+.f64N/A

                                        \[\leadsto \color{blue}{\tan y + x} \]
                                      4. tan-lowering-tan.f6430.5

                                        \[\leadsto \color{blue}{\tan y} + x \]
                                    3. Applied egg-rr30.5%

                                      \[\leadsto \color{blue}{\tan y + x} \]

                                    if -50 < (+.f64 y z) < 5.00000000000000024e-5

                                    1. Initial program 100.0%

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

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

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

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

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

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

                                        \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\tan a - x\right)} \]
                                      7. tan-lowering-tan.f6499.9

                                        \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                    4. Applied egg-rr99.9%

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

                                      \[\leadsto \tan \color{blue}{y} - \left(\tan a - x\right) \]
                                    6. Step-by-step derivation
                                      1. Simplified97.8%

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

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

                                          \[\leadsto y \cdot \color{blue}{\left({y}^{2} \cdot \left(\frac{1}{3} + \frac{2}{15} \cdot {y}^{2}\right) + 1\right)} - \left(\tan a - x\right) \]
                                        2. distribute-lft-inN/A

                                          \[\leadsto \color{blue}{\left(y \cdot \left({y}^{2} \cdot \left(\frac{1}{3} + \frac{2}{15} \cdot {y}^{2}\right)\right) + y \cdot 1\right)} - \left(\tan a - x\right) \]
                                        3. *-rgt-identityN/A

                                          \[\leadsto \left(y \cdot \left({y}^{2} \cdot \left(\frac{1}{3} + \frac{2}{15} \cdot {y}^{2}\right)\right) + \color{blue}{y}\right) - \left(\tan a - x\right) \]
                                        4. accelerator-lowering-fma.f64N/A

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

                                          \[\leadsto \mathsf{fma}\left(y, \color{blue}{{y}^{2} \cdot \left(\frac{1}{3} + \frac{2}{15} \cdot {y}^{2}\right)}, y\right) - \left(\tan a - x\right) \]
                                        6. unpow2N/A

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

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

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

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

                                          \[\leadsto \mathsf{fma}\left(y, \left(y \cdot y\right) \cdot \color{blue}{\mathsf{fma}\left({y}^{2}, \frac{2}{15}, \frac{1}{3}\right)}, y\right) - \left(\tan a - x\right) \]
                                        11. unpow2N/A

                                          \[\leadsto \mathsf{fma}\left(y, \left(y \cdot y\right) \cdot \mathsf{fma}\left(\color{blue}{y \cdot y}, \frac{2}{15}, \frac{1}{3}\right), y\right) - \left(\tan a - x\right) \]
                                        12. *-lowering-*.f6497.8

                                          \[\leadsto \mathsf{fma}\left(y, \left(y \cdot y\right) \cdot \mathsf{fma}\left(\color{blue}{y \cdot y}, 0.13333333333333333, 0.3333333333333333\right), y\right) - \left(\tan a - x\right) \]
                                      4. Simplified97.8%

                                        \[\leadsto \color{blue}{\mathsf{fma}\left(y, \left(y \cdot y\right) \cdot \mathsf{fma}\left(y \cdot y, 0.13333333333333333, 0.3333333333333333\right), y\right)} - \left(\tan a - x\right) \]

                                      if 5.00000000000000024e-5 < (+.f64 y z)

                                      1. Initial program 67.3%

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

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

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

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

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

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

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

                                          \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                      4. Applied egg-rr67.2%

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

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

                                          \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                                        2. neg-lowering-neg.f6445.1

                                          \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(-x\right)} \]
                                      7. Simplified45.1%

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

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

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

                                          \[\leadsto \tan \color{blue}{\left(z \cdot \frac{y}{z} + z \cdot 1\right)} - \left(\mathsf{neg}\left(x\right)\right) \]
                                        3. *-rgt-identityN/A

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

                                          \[\leadsto \tan \color{blue}{\left(\mathsf{fma}\left(z, \frac{y}{z}, z\right)\right)} - \left(\mathsf{neg}\left(x\right)\right) \]
                                        5. /-lowering-/.f6429.1

                                          \[\leadsto \tan \left(\mathsf{fma}\left(z, \color{blue}{\frac{y}{z}}, z\right)\right) - \left(-x\right) \]
                                      10. Simplified29.1%

                                        \[\leadsto \tan \color{blue}{\left(\mathsf{fma}\left(z, \frac{y}{z}, z\right)\right)} - \left(-x\right) \]
                                    7. Recombined 3 regimes into one program.
                                    8. Final simplification48.4%

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

                                    Alternative 16: 50.8% accurate, 1.5× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y + z \leq -0.002:\\ \;\;\;\;x + \tan y\\ \mathbf{elif}\;y + z \leq 5 \cdot 10^{-5}:\\ \;\;\;\;y + \left(x - \tan a\right)\\ \mathbf{else}:\\ \;\;\;\;x + \tan \left(\mathsf{fma}\left(z, \frac{y}{z}, z\right)\right)\\ \end{array} \end{array} \]
                                    (FPCore (x y z a)
                                     :precision binary64
                                     (if (<= (+ y z) -0.002)
                                       (+ x (tan y))
                                       (if (<= (+ y z) 5e-5) (+ y (- x (tan a))) (+ x (tan (fma z (/ y z) z))))))
                                    double code(double x, double y, double z, double a) {
                                    	double tmp;
                                    	if ((y + z) <= -0.002) {
                                    		tmp = x + tan(y);
                                    	} else if ((y + z) <= 5e-5) {
                                    		tmp = y + (x - tan(a));
                                    	} else {
                                    		tmp = x + tan(fma(z, (y / z), z));
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(x, y, z, a)
                                    	tmp = 0.0
                                    	if (Float64(y + z) <= -0.002)
                                    		tmp = Float64(x + tan(y));
                                    	elseif (Float64(y + z) <= 5e-5)
                                    		tmp = Float64(y + Float64(x - tan(a)));
                                    	else
                                    		tmp = Float64(x + tan(fma(z, Float64(y / z), z)));
                                    	end
                                    	return tmp
                                    end
                                    
                                    code[x_, y_, z_, a_] := If[LessEqual[N[(y + z), $MachinePrecision], -0.002], N[(x + N[Tan[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y + z), $MachinePrecision], 5e-5], N[(y + N[(x - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Tan[N[(z * N[(y / z), $MachinePrecision] + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;y + z \leq -0.002:\\
                                    \;\;\;\;x + \tan y\\
                                    
                                    \mathbf{elif}\;y + z \leq 5 \cdot 10^{-5}:\\
                                    \;\;\;\;y + \left(x - \tan a\right)\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;x + \tan \left(\mathsf{fma}\left(z, \frac{y}{z}, z\right)\right)\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 3 regimes
                                    2. if (+.f64 y z) < -2e-3

                                      1. Initial program 70.1%

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

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

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

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

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

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

                                          \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\tan a - x\right)} \]
                                        7. tan-lowering-tan.f6470.0

                                          \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                      4. Applied egg-rr70.0%

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

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

                                          \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                                        2. neg-lowering-neg.f6443.1

                                          \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(-x\right)} \]
                                      7. Simplified43.1%

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

                                        \[\leadsto \tan \color{blue}{y} - \left(\mathsf{neg}\left(x\right)\right) \]
                                      9. Step-by-step derivation
                                        1. Simplified31.2%

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

                                            \[\leadsto \color{blue}{\tan y + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
                                          2. remove-double-negN/A

                                            \[\leadsto \tan y + \color{blue}{x} \]
                                          3. +-lowering-+.f64N/A

                                            \[\leadsto \color{blue}{\tan y + x} \]
                                          4. tan-lowering-tan.f6431.2

                                            \[\leadsto \color{blue}{\tan y} + x \]
                                        3. Applied egg-rr31.2%

                                          \[\leadsto \color{blue}{\tan y + x} \]

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

                                        1. Initial program 100.0%

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

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

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

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

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

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

                                            \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\tan a - x\right)} \]
                                          7. tan-lowering-tan.f64100.0

                                            \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                        4. Applied egg-rr100.0%

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

                                          \[\leadsto \tan \color{blue}{y} - \left(\tan a - x\right) \]
                                        6. Step-by-step derivation
                                          1. Simplified98.7%

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

                                            \[\leadsto \color{blue}{y} - \left(\tan a - x\right) \]
                                          3. Step-by-step derivation
                                            1. Simplified98.7%

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

                                            if 5.00000000000000024e-5 < (+.f64 y z)

                                            1. Initial program 67.3%

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

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

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

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

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

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

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

                                                \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                            4. Applied egg-rr67.2%

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

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

                                                \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                                              2. neg-lowering-neg.f6445.1

                                                \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(-x\right)} \]
                                            7. Simplified45.1%

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

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

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

                                                \[\leadsto \tan \color{blue}{\left(z \cdot \frac{y}{z} + z \cdot 1\right)} - \left(\mathsf{neg}\left(x\right)\right) \]
                                              3. *-rgt-identityN/A

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

                                                \[\leadsto \tan \color{blue}{\left(\mathsf{fma}\left(z, \frac{y}{z}, z\right)\right)} - \left(\mathsf{neg}\left(x\right)\right) \]
                                              5. /-lowering-/.f6429.1

                                                \[\leadsto \tan \left(\mathsf{fma}\left(z, \color{blue}{\frac{y}{z}}, z\right)\right) - \left(-x\right) \]
                                            10. Simplified29.1%

                                              \[\leadsto \tan \color{blue}{\left(\mathsf{fma}\left(z, \frac{y}{z}, z\right)\right)} - \left(-x\right) \]
                                          4. Recombined 3 regimes into one program.
                                          5. Final simplification48.4%

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

                                          Alternative 17: 54.7% accurate, 1.7× speedup?

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

                                            1. Initial program 70.1%

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

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

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

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

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

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

                                                \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\tan a - x\right)} \]
                                              7. tan-lowering-tan.f6470.0

                                                \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                            4. Applied egg-rr70.0%

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

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

                                                \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                                              2. neg-lowering-neg.f6443.1

                                                \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(-x\right)} \]
                                            7. Simplified43.1%

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

                                              \[\leadsto \tan \color{blue}{y} - \left(\mathsf{neg}\left(x\right)\right) \]
                                            9. Step-by-step derivation
                                              1. Simplified31.2%

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

                                                  \[\leadsto \color{blue}{\tan y + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
                                                2. remove-double-negN/A

                                                  \[\leadsto \tan y + \color{blue}{x} \]
                                                3. +-lowering-+.f64N/A

                                                  \[\leadsto \color{blue}{\tan y + x} \]
                                                4. tan-lowering-tan.f6431.2

                                                  \[\leadsto \color{blue}{\tan y} + x \]
                                              3. Applied egg-rr31.2%

                                                \[\leadsto \color{blue}{\tan y + x} \]

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

                                              1. Initial program 100.0%

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

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

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

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

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

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

                                                  \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\tan a - x\right)} \]
                                                7. tan-lowering-tan.f64100.0

                                                  \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                              4. Applied egg-rr100.0%

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

                                                \[\leadsto \tan \color{blue}{y} - \left(\tan a - x\right) \]
                                              6. Step-by-step derivation
                                                1. Simplified98.7%

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

                                                  \[\leadsto \color{blue}{y} - \left(\tan a - x\right) \]
                                                3. Step-by-step derivation
                                                  1. Simplified98.7%

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

                                                  if 5.00000000000000024e-5 < (+.f64 y z)

                                                  1. Initial program 67.3%

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

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

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

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

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

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

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

                                                      \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                                  4. Applied egg-rr67.2%

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

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

                                                      \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                                                    2. neg-lowering-neg.f6445.1

                                                      \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(-x\right)} \]
                                                  7. Simplified45.1%

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

                                                      \[\leadsto \color{blue}{\tan \left(y + z\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
                                                    2. remove-double-negN/A

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

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

                                                      \[\leadsto \color{blue}{\tan \left(y + z\right)} + x \]
                                                    5. +-lowering-+.f6445.1

                                                      \[\leadsto \tan \color{blue}{\left(y + z\right)} + x \]
                                                  9. Applied egg-rr45.1%

                                                    \[\leadsto \color{blue}{\tan \left(y + z\right) + x} \]
                                                4. Recombined 3 regimes into one program.
                                                5. Final simplification54.1%

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

                                                Alternative 18: 45.1% accurate, 1.9× speedup?

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

                                                  1. Initial program 85.9%

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

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

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

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

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

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

                                                      \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\tan a - x\right)} \]
                                                    7. tan-lowering-tan.f6485.9

                                                      \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                                  4. Applied egg-rr85.9%

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

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

                                                      \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                                                    2. neg-lowering-neg.f6453.2

                                                      \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(-x\right)} \]
                                                  7. Simplified53.2%

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

                                                    \[\leadsto \tan \color{blue}{y} - \left(\mathsf{neg}\left(x\right)\right) \]
                                                  9. Step-by-step derivation
                                                    1. Simplified47.0%

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

                                                        \[\leadsto \color{blue}{\tan y + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
                                                      2. remove-double-negN/A

                                                        \[\leadsto \tan y + \color{blue}{x} \]
                                                      3. +-lowering-+.f64N/A

                                                        \[\leadsto \color{blue}{\tan y + x} \]
                                                      4. tan-lowering-tan.f6447.0

                                                        \[\leadsto \color{blue}{\tan y} + x \]
                                                    3. Applied egg-rr47.0%

                                                      \[\leadsto \color{blue}{\tan y + x} \]

                                                    if 4.1999999999999998e-14 < z

                                                    1. Initial program 50.9%

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

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

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

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

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

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

                                                        \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\tan a - x\right)} \]
                                                      7. tan-lowering-tan.f6450.8

                                                        \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                                    4. Applied egg-rr50.8%

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

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

                                                        \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                                                      2. neg-lowering-neg.f6433.6

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

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

                                                      \[\leadsto \tan \color{blue}{z} - \left(\mathsf{neg}\left(x\right)\right) \]
                                                    9. Step-by-step derivation
                                                      1. Simplified34.1%

                                                        \[\leadsto \tan \color{blue}{z} - \left(-x\right) \]
                                                    10. Recombined 2 regimes into one program.
                                                    11. Final simplification43.7%

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 4.2 \cdot 10^{-14}:\\ \;\;\;\;x + \tan y\\ \mathbf{else}:\\ \;\;\;\;x + \tan z\\ \end{array} \]
                                                    12. Add Preprocessing

                                                    Alternative 19: 49.7% accurate, 2.0× speedup?

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

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

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

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

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

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

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

                                                        \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\tan a - x\right)} \]
                                                      7. tan-lowering-tan.f6477.0

                                                        \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                                    4. Applied egg-rr77.0%

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

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

                                                        \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                                                      2. neg-lowering-neg.f6448.2

                                                        \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(-x\right)} \]
                                                    7. Simplified48.2%

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

                                                        \[\leadsto \color{blue}{\tan \left(y + z\right) + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
                                                      2. remove-double-negN/A

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

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

                                                        \[\leadsto \color{blue}{\tan \left(y + z\right)} + x \]
                                                      5. +-lowering-+.f6448.2

                                                        \[\leadsto \tan \color{blue}{\left(y + z\right)} + x \]
                                                    9. Applied egg-rr48.2%

                                                      \[\leadsto \color{blue}{\tan \left(y + z\right) + x} \]
                                                    10. Final simplification48.2%

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

                                                    Alternative 20: 40.6% accurate, 2.0× speedup?

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

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

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

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

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

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

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

                                                        \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\tan a - x\right)} \]
                                                      7. tan-lowering-tan.f6477.0

                                                        \[\leadsto \tan \left(y + z\right) - \left(\color{blue}{\tan a} - x\right) \]
                                                    4. Applied egg-rr77.0%

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

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

                                                        \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
                                                      2. neg-lowering-neg.f6448.2

                                                        \[\leadsto \tan \left(y + z\right) - \color{blue}{\left(-x\right)} \]
                                                    7. Simplified48.2%

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

                                                      \[\leadsto \tan \color{blue}{y} - \left(\mathsf{neg}\left(x\right)\right) \]
                                                    9. Step-by-step derivation
                                                      1. Simplified40.8%

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

                                                          \[\leadsto \color{blue}{\tan y + \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right)} \]
                                                        2. remove-double-negN/A

                                                          \[\leadsto \tan y + \color{blue}{x} \]
                                                        3. +-lowering-+.f64N/A

                                                          \[\leadsto \color{blue}{\tan y + x} \]
                                                        4. tan-lowering-tan.f6440.8

                                                          \[\leadsto \color{blue}{\tan y} + x \]
                                                      3. Applied egg-rr40.8%

                                                        \[\leadsto \color{blue}{\tan y + x} \]
                                                      4. Final simplification40.8%

                                                        \[\leadsto x + \tan y \]
                                                      5. Add Preprocessing

                                                      Alternative 21: 31.8% accurate, 210.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 77.0%

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

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

                                                        Reproduce

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