tan-example (used to crash)

Percentage Accurate: 79.1% → 99.7%
Time: 43.4s
Alternatives: 9
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 9 alternatives:

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

Initial Program: 79.1% 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 + \left(\left(\tan y + \tan z\right) \cdot \frac{1}{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 (- 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 / (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 / (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 / (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 / (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(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 / (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[(1.0 - N[(N[Tan[y], $MachinePrecision] * N[Tan[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(\left(\tan y + \tan z\right) \cdot \frac{1}{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-sum99.7%

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

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

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

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

Alternative 2: 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-sum99.7%

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

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

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

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

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

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

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

Alternative 3: 59.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \tan \left(y + z\right)\\ \mathbf{if}\;t\_0 \leq -0.02 \lor \neg \left(t\_0 \leq 5 \cdot 10^{-13}\right):\\ \;\;\;\;x + t\_0\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - \tan a\right)\\ \end{array} \end{array} \]
(FPCore (x y z a)
 :precision binary64
 (let* ((t_0 (tan (+ y z))))
   (if (or (<= t_0 -0.02) (not (<= t_0 5e-13)))
     (+ x t_0)
     (+ x (- y (tan a))))))
double code(double x, double y, double z, double a) {
	double t_0 = tan((y + z));
	double tmp;
	if ((t_0 <= -0.02) || !(t_0 <= 5e-13)) {
		tmp = x + t_0;
	} else {
		tmp = x + (y - 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) :: t_0
    real(8) :: tmp
    t_0 = tan((y + z))
    if ((t_0 <= (-0.02d0)) .or. (.not. (t_0 <= 5d-13))) then
        tmp = x + t_0
    else
        tmp = x + (y - tan(a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double a) {
	double t_0 = Math.tan((y + z));
	double tmp;
	if ((t_0 <= -0.02) || !(t_0 <= 5e-13)) {
		tmp = x + t_0;
	} else {
		tmp = x + (y - Math.tan(a));
	}
	return tmp;
}
def code(x, y, z, a):
	t_0 = math.tan((y + z))
	tmp = 0
	if (t_0 <= -0.02) or not (t_0 <= 5e-13):
		tmp = x + t_0
	else:
		tmp = x + (y - math.tan(a))
	return tmp
function code(x, y, z, a)
	t_0 = tan(Float64(y + z))
	tmp = 0.0
	if ((t_0 <= -0.02) || !(t_0 <= 5e-13))
		tmp = Float64(x + t_0);
	else
		tmp = Float64(x + Float64(y - tan(a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, a)
	t_0 = tan((y + z));
	tmp = 0.0;
	if ((t_0 <= -0.02) || ~((t_0 <= 5e-13)))
		tmp = x + t_0;
	else
		tmp = x + (y - tan(a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, a_] := Block[{t$95$0 = N[Tan[N[(y + z), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[t$95$0, -0.02], N[Not[LessEqual[t$95$0, 5e-13]], $MachinePrecision]], N[(x + t$95$0), $MachinePrecision], N[(x + N[(y - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \tan \left(y + z\right)\\
\mathbf{if}\;t\_0 \leq -0.02 \lor \neg \left(t\_0 \leq 5 \cdot 10^{-13}\right):\\
\;\;\;\;x + t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (tan.f64 (+.f64 y z)) < -0.0200000000000000004 or 4.9999999999999999e-13 < (tan.f64 (+.f64 y z))

    1. Initial program 68.9%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube68.5%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(x + \left(\tan \left(y + z\right) - \tan a\right)\right) \cdot \left(x + \left(\tan \left(y + z\right) - \tan a\right)\right)\right) \cdot \left(x + \left(\tan \left(y + z\right) - \tan a\right)\right)}} \]
      2. pow1/362.3%

        \[\leadsto \color{blue}{{\left(\left(\left(x + \left(\tan \left(y + z\right) - \tan a\right)\right) \cdot \left(x + \left(\tan \left(y + z\right) - \tan a\right)\right)\right) \cdot \left(x + \left(\tan \left(y + z\right) - \tan a\right)\right)\right)}^{0.3333333333333333}} \]
      3. pow362.2%

        \[\leadsto {\color{blue}{\left({\left(x + \left(\tan \left(y + z\right) - \tan a\right)\right)}^{3}\right)}}^{0.3333333333333333} \]
      4. +-commutative62.2%

        \[\leadsto {\left({\color{blue}{\left(\left(\tan \left(y + z\right) - \tan a\right) + x\right)}}^{3}\right)}^{0.3333333333333333} \]
      5. associate-+l-62.3%

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

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

      \[\leadsto {\color{blue}{\left({\left(x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}\right)}^{3}\right)}}^{0.3333333333333333} \]
    6. Step-by-step derivation
      1. unpow1/345.4%

        \[\leadsto \color{blue}{\sqrt[3]{{\left(x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}\right)}^{3}}} \]
      2. rem-cbrt-cube45.6%

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

        \[\leadsto \color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} + x} \]
      4. quot-tan45.6%

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

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

    if -0.0200000000000000004 < (tan.f64 (+.f64 y z)) < 4.9999999999999999e-13

    1. Initial program 99.9%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt47.7%

        \[\leadsto x + \left(\color{blue}{\sqrt{\tan \left(y + z\right)} \cdot \sqrt{\tan \left(y + z\right)}} - \tan a\right) \]
      2. sqrt-unprod99.3%

        \[\leadsto x + \left(\color{blue}{\sqrt{\tan \left(y + z\right) \cdot \tan \left(y + z\right)}} - \tan a\right) \]
      3. pow299.3%

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

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

      \[\leadsto x + \left(\sqrt{{\color{blue}{\left(\frac{\sin y}{\cos y}\right)}}^{2}} - \tan a\right) \]
    6. Taylor expanded in y around 0 99.9%

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

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

Alternative 4: 59.5% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 y z) < 4.9999999999999999e-13

    1. Initial program 80.9%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt36.7%

        \[\leadsto x + \left(\color{blue}{\sqrt{\tan \left(y + z\right)} \cdot \sqrt{\tan \left(y + z\right)}} - \tan a\right) \]
      2. sqrt-unprod64.5%

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

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

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

      \[\leadsto x + \left(\sqrt{{\color{blue}{\left(\frac{\sin y}{\cos y}\right)}}^{2}} - \tan a\right) \]
    6. Step-by-step derivation
      1. tan-quot58.4%

        \[\leadsto x + \left(\sqrt{{\color{blue}{\tan y}}^{2}} - \tan a\right) \]
      2. sqrt-pow166.1%

        \[\leadsto x + \left(\color{blue}{{\tan y}^{\left(\frac{2}{2}\right)}} - \tan a\right) \]
      3. metadata-eval66.1%

        \[\leadsto x + \left({\tan y}^{\color{blue}{1}} - \tan a\right) \]
      4. pow166.1%

        \[\leadsto x + \left(\color{blue}{\tan y} - \tan a\right) \]
      5. *-un-lft-identity66.1%

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

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

        \[\leadsto x + \left(\color{blue}{\tan y} - \tan a\right) \]
    9. Simplified66.1%

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

    if 4.9999999999999999e-13 < (+.f64 y z)

    1. Initial program 69.9%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-cbrt-cube69.5%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\left(x + \left(\tan \left(y + z\right) - \tan a\right)\right) \cdot \left(x + \left(\tan \left(y + z\right) - \tan a\right)\right)\right) \cdot \left(x + \left(\tan \left(y + z\right) - \tan a\right)\right)}} \]
      2. pow1/362.3%

        \[\leadsto \color{blue}{{\left(\left(\left(x + \left(\tan \left(y + z\right) - \tan a\right)\right) \cdot \left(x + \left(\tan \left(y + z\right) - \tan a\right)\right)\right) \cdot \left(x + \left(\tan \left(y + z\right) - \tan a\right)\right)\right)}^{0.3333333333333333}} \]
      3. pow362.2%

        \[\leadsto {\color{blue}{\left({\left(x + \left(\tan \left(y + z\right) - \tan a\right)\right)}^{3}\right)}}^{0.3333333333333333} \]
      4. +-commutative62.2%

        \[\leadsto {\left({\color{blue}{\left(\left(\tan \left(y + z\right) - \tan a\right) + x\right)}}^{3}\right)}^{0.3333333333333333} \]
      5. associate-+l-62.3%

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

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

      \[\leadsto {\color{blue}{\left({\left(x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}\right)}^{3}\right)}}^{0.3333333333333333} \]
    6. Step-by-step derivation
      1. unpow1/342.5%

        \[\leadsto \color{blue}{\sqrt[3]{{\left(x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}\right)}^{3}}} \]
      2. rem-cbrt-cube42.7%

        \[\leadsto \color{blue}{x + \frac{\sin \left(y + z\right)}{\cos \left(y + z\right)}} \]
      3. +-commutative42.7%

        \[\leadsto \color{blue}{\frac{\sin \left(y + z\right)}{\cos \left(y + z\right)} + x} \]
      4. quot-tan42.7%

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

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

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

Alternative 5: 69.3% accurate, 1.0× speedup?

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

    1. Initial program 84.6%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt37.3%

        \[\leadsto x + \left(\color{blue}{\sqrt{\tan \left(y + z\right)} \cdot \sqrt{\tan \left(y + z\right)}} - \tan a\right) \]
      2. sqrt-unprod64.0%

        \[\leadsto x + \left(\color{blue}{\sqrt{\tan \left(y + z\right) \cdot \tan \left(y + z\right)}} - \tan a\right) \]
      3. pow264.0%

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

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

      \[\leadsto x + \left(\sqrt{{\color{blue}{\left(\frac{\sin y}{\cos y}\right)}}^{2}} - \tan a\right) \]
    6. Step-by-step derivation
      1. tan-quot58.5%

        \[\leadsto x + \left(\sqrt{{\color{blue}{\tan y}}^{2}} - \tan a\right) \]
      2. sqrt-pow171.5%

        \[\leadsto x + \left(\color{blue}{{\tan y}^{\left(\frac{2}{2}\right)}} - \tan a\right) \]
      3. metadata-eval71.5%

        \[\leadsto x + \left({\tan y}^{\color{blue}{1}} - \tan a\right) \]
      4. pow171.5%

        \[\leadsto x + \left(\color{blue}{\tan y} - \tan a\right) \]
      5. *-un-lft-identity71.5%

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

      \[\leadsto x + \left(\color{blue}{1 \cdot \tan y} - \tan a\right) \]
    8. Step-by-step derivation
      1. *-lft-identity71.5%

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

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

    if 2.39999999999999979e-7 < z

    1. Initial program 56.8%

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

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

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

        \[\leadsto \left(x + \color{blue}{\tan z}\right) - \tan a \]
      3. associate-+r-56.9%

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

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

        \[\leadsto \color{blue}{\left(\frac{\sin z}{\cos z} - \tan a\right) + x} \]
      6. tan-quot56.9%

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

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

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

Alternative 6: 69.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 6.8 \cdot 10^{-7}:\\ \;\;\;\;\left(x + \tan y\right) - \tan a\\ \mathbf{else}:\\ \;\;\;\;x + \left(\tan z - \tan a\right)\\ \end{array} \end{array} \]
(FPCore (x y z a)
 :precision binary64
 (if (<= z 6.8e-7) (- (+ x (tan y)) (tan a)) (+ x (- (tan z) (tan a)))))
double code(double x, double y, double z, double a) {
	double tmp;
	if (z <= 6.8e-7) {
		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 <= 6.8d-7) 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 <= 6.8e-7) {
		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 <= 6.8e-7:
		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 <= 6.8e-7)
		tmp = Float64(Float64(x + 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 <= 6.8e-7)
		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, 6.8e-7], N[(N[(x + N[Tan[y], $MachinePrecision]), $MachinePrecision] - N[Tan[a], $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 6.8 \cdot 10^{-7}:\\
\;\;\;\;\left(x + \tan y\right) - \tan a\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 6.79999999999999948e-7

    1. Initial program 84.6%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt37.3%

        \[\leadsto x + \left(\color{blue}{\sqrt{\tan \left(y + z\right)} \cdot \sqrt{\tan \left(y + z\right)}} - \tan a\right) \]
      2. sqrt-unprod64.0%

        \[\leadsto x + \left(\color{blue}{\sqrt{\tan \left(y + z\right) \cdot \tan \left(y + z\right)}} - \tan a\right) \]
      3. pow264.0%

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

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

      \[\leadsto x + \left(\sqrt{{\color{blue}{\left(\frac{\sin y}{\cos y}\right)}}^{2}} - \tan a\right) \]
    6. Step-by-step derivation
      1. tan-quot58.5%

        \[\leadsto x + \left(\sqrt{{\color{blue}{\tan y}}^{2}} - \tan a\right) \]
      2. sqrt-pow171.5%

        \[\leadsto x + \left(\color{blue}{{\tan y}^{\left(\frac{2}{2}\right)}} - \tan a\right) \]
      3. metadata-eval71.5%

        \[\leadsto x + \left({\tan y}^{\color{blue}{1}} - \tan a\right) \]
      4. pow171.5%

        \[\leadsto x + \left(\color{blue}{\tan y} - \tan a\right) \]
      5. log1p-expm1-u71.2%

        \[\leadsto x + \left(\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\tan y\right)\right)} - \tan a\right) \]
    7. Applied egg-rr71.2%

      \[\leadsto x + \left(\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\tan y\right)\right)} - \tan a\right) \]
    8. Step-by-step derivation
      1. log1p-expm1-u71.5%

        \[\leadsto x + \left(\color{blue}{\tan y} - \tan a\right) \]
      2. associate-+r-71.4%

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

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

    if 6.79999999999999948e-7 < z

    1. Initial program 56.8%

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

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

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

        \[\leadsto \left(x + \color{blue}{\tan z}\right) - \tan a \]
      3. associate-+r-56.9%

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

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

        \[\leadsto \color{blue}{\left(\frac{\sin z}{\cos z} - \tan a\right) + x} \]
      6. tan-quot56.9%

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

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

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

Alternative 7: 79.1% 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. Final simplification77.0%

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

Alternative 8: 37.1% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.15:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - \tan a\right)\\ \end{array} \end{array} \]
(FPCore (x y z a) :precision binary64 (if (<= y -1.15) x (+ x (- y (tan a)))))
double code(double x, double y, double z, double a) {
	double tmp;
	if (y <= -1.15) {
		tmp = x;
	} else {
		tmp = x + (y - tan(a));
	}
	return tmp;
}
real(8) function code(x, y, z, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: a
    real(8) :: tmp
    if (y <= (-1.15d0)) then
        tmp = x
    else
        tmp = x + (y - tan(a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double a) {
	double tmp;
	if (y <= -1.15) {
		tmp = x;
	} else {
		tmp = x + (y - Math.tan(a));
	}
	return tmp;
}
def code(x, y, z, a):
	tmp = 0
	if y <= -1.15:
		tmp = x
	else:
		tmp = x + (y - math.tan(a))
	return tmp
function code(x, y, z, a)
	tmp = 0.0
	if (y <= -1.15)
		tmp = x;
	else
		tmp = Float64(x + Float64(y - tan(a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, a)
	tmp = 0.0;
	if (y <= -1.15)
		tmp = x;
	else
		tmp = x + (y - tan(a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, a_] := If[LessEqual[y, -1.15], x, N[(x + N[(y - N[Tan[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15:\\
\;\;\;\;x\\

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


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

    1. Initial program 51.8%

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

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

    if -1.1499999999999999 < y

    1. Initial program 85.6%

      \[x + \left(\tan \left(y + z\right) - \tan a\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt40.3%

        \[\leadsto x + \left(\color{blue}{\sqrt{\tan \left(y + z\right)} \cdot \sqrt{\tan \left(y + z\right)}} - \tan a\right) \]
      2. sqrt-unprod65.9%

        \[\leadsto x + \left(\color{blue}{\sqrt{\tan \left(y + z\right) \cdot \tan \left(y + z\right)}} - \tan a\right) \]
      3. pow265.9%

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

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

      \[\leadsto x + \left(\sqrt{{\color{blue}{\left(\frac{\sin y}{\cos y}\right)}}^{2}} - \tan a\right) \]
    6. Taylor expanded in y around 0 44.1%

      \[\leadsto x + \left(\color{blue}{y} - \tan a\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification39.0%

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

Alternative 9: 31.8% accurate, 207.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z a) :precision binary64 x)
double code(double x, double y, double z, double a) {
	return x;
}
real(8) function code(x, y, z, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: a
    code = x
end function
public static double code(double x, double y, double z, double a) {
	return x;
}
def code(x, y, z, a):
	return x
function code(x, y, z, a)
	return x
end
function tmp = code(x, y, z, a)
	tmp = x;
end
code[x_, y_, z_, a_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 77.0%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification31.9%

    \[\leadsto x \]
  5. Add Preprocessing

Reproduce

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