SynthBasics:moogVCF from YampaSynth-0.2

Percentage Accurate: 93.4% → 96.8%
Time: 13.5s
Alternatives: 10
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))
double code(double x, double y, double z, double t) {
	return x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y * z) * (tanh((t / y)) - tanh((x / y))))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y * z) * (Math.tanh((t / y)) - Math.tanh((x / y))));
}
def code(x, y, z, t):
	return x + ((y * z) * (math.tanh((t / y)) - math.tanh((x / y))))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y * z) * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y)))))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * z), $MachinePrecision] * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\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 10 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: 93.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))
double code(double x, double y, double z, double t) {
	return x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y * z) * (tanh((t / y)) - tanh((x / y))))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y * z) * (Math.tanh((t / y)) - Math.tanh((x / y))));
}
def code(x, y, z, t):
	return x + ((y * z) * (math.tanh((t / y)) - math.tanh((x / y))))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y * z) * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y)))))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y * z) * (tanh((t / y)) - tanh((x / y))));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * z), $MachinePrecision] * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)
\end{array}

Alternative 1: 96.8% accurate, 1.0× speedup?

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

\\
\mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \tanh \left(\frac{x}{y}\right) \cdot \left(-z\right)\right), y, x\right)
\end{array}
Derivation
  1. Initial program 93.6%

    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

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

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

      \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
    7. lift-*.f64N/A

      \[\leadsto x + \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
    8. +-commutativeN/A

      \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x} \]
    9. lift-*.f64N/A

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

      \[\leadsto \color{blue}{\left(y \cdot z\right)} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x \]
    11. associate-*l*N/A

      \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
    12. *-commutativeN/A

      \[\leadsto \color{blue}{\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \cdot y} + x \]
    13. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), y, x\right)} \]
    14. lower-*.f6498.0

      \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}, y, x\right) \]
  4. Applied rewrites98.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), y, x\right)} \]
  5. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \mathsf{fma}\left(z \cdot \left(\tanh \color{blue}{\left(\frac{t}{y}\right)} - \tanh \left(\frac{x}{y}\right)\right), y, x\right) \]
    2. lift-tanh.f64N/A

      \[\leadsto \mathsf{fma}\left(z \cdot \left(\color{blue}{\tanh \left(\frac{t}{y}\right)} - \tanh \left(\frac{x}{y}\right)\right), y, x\right) \]
    3. lift-/.f64N/A

      \[\leadsto \mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \color{blue}{\left(\frac{x}{y}\right)}\right), y, x\right) \]
    4. lift-tanh.f64N/A

      \[\leadsto \mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \color{blue}{\tanh \left(\frac{x}{y}\right)}\right), y, x\right) \]
    5. sub-negN/A

      \[\leadsto \mathsf{fma}\left(z \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) + \left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right)\right)}, y, x\right) \]
    6. distribute-rgt-inN/A

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

      \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right) \cdot z\right)}, y, x\right) \]
    8. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{\left(\mathsf{neg}\left(\tanh \left(\frac{x}{y}\right)\right)\right) \cdot z}\right), y, x\right) \]
    9. lower-neg.f6498.1

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \color{blue}{\left(-\tanh \left(\frac{x}{y}\right)\right)} \cdot z\right), y, x\right) \]
  6. Applied rewrites98.1%

    \[\leadsto \mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \left(-\tanh \left(\frac{x}{y}\right)\right) \cdot z\right)}, y, x\right) \]
  7. Final simplification98.1%

    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\tanh \left(\frac{t}{y}\right), z, \tanh \left(\frac{x}{y}\right) \cdot \left(-z\right)\right), y, x\right) \]
  8. Add Preprocessing

Alternative 2: 96.8% accurate, 1.0× speedup?

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

\\
\mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), y, x\right)
\end{array}
Derivation
  1. Initial program 93.6%

    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f64N/A

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

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

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

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

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

      \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
    7. lift-*.f64N/A

      \[\leadsto x + \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
    8. +-commutativeN/A

      \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x} \]
    9. lift-*.f64N/A

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

      \[\leadsto \color{blue}{\left(y \cdot z\right)} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x \]
    11. associate-*l*N/A

      \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
    12. *-commutativeN/A

      \[\leadsto \color{blue}{\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \cdot y} + x \]
    13. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), y, x\right)} \]
    14. lower-*.f6498.0

      \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}, y, x\right) \]
  4. Applied rewrites98.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), y, x\right)} \]
  5. Add Preprocessing

Alternative 3: 75.4% accurate, 1.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{z}{x \cdot x}\\ \mathbf{if}\;x \leq -7.8 \cdot 10^{+59}:\\ \;\;\;\;x + x \cdot \left(\mathsf{fma}\left(t, t\_1, -z\right) - \mathsf{fma}\left(t, t\_1, \frac{t \cdot \left(-z\right)}{x}\right)\right)\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{+113}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right), z, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (/ z (* x x)))))
   (if (<= x -7.8e+59)
     (+ x (* x (- (fma t t_1 (- z)) (fma t t_1 (/ (* t (- z)) x)))))
     (if (<= x 8.2e+113)
       (fma (* y (- (tanh (/ t y)) (/ x y))) z x)
       (+ x (* t z))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (z / (x * x));
	double tmp;
	if (x <= -7.8e+59) {
		tmp = x + (x * (fma(t, t_1, -z) - fma(t, t_1, ((t * -z) / x))));
	} else if (x <= 8.2e+113) {
		tmp = fma((y * (tanh((t / y)) - (x / y))), z, x);
	} else {
		tmp = x + (t * z);
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(t * Float64(z / Float64(x * x)))
	tmp = 0.0
	if (x <= -7.8e+59)
		tmp = Float64(x + Float64(x * Float64(fma(t, t_1, Float64(-z)) - fma(t, t_1, Float64(Float64(t * Float64(-z)) / x)))));
	elseif (x <= 8.2e+113)
		tmp = fma(Float64(y * Float64(tanh(Float64(t / y)) - Float64(x / y))), z, x);
	else
		tmp = Float64(x + Float64(t * z));
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(z / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.8e+59], N[(x + N[(x * N[(N[(t * t$95$1 + (-z)), $MachinePrecision] - N[(t * t$95$1 + N[(N[(t * (-z)), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8.2e+113], N[(N[(y * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision], N[(x + N[(t * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \frac{z}{x \cdot x}\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{+59}:\\
\;\;\;\;x + x \cdot \left(\mathsf{fma}\left(t, t\_1, -z\right) - \mathsf{fma}\left(t, t\_1, \frac{t \cdot \left(-z\right)}{x}\right)\right)\\

\mathbf{elif}\;x \leq 8.2 \cdot 10^{+113}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right), z, x\right)\\

\mathbf{else}:\\
\;\;\;\;x + t \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -7.80000000000000043e59

    1. Initial program 100.0%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
      2. lower--.f6451.6

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\color{blue}{t - x}}{y} \]
    5. Applied rewrites51.6%

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

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

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \left(\frac{t}{y} - \color{blue}{\frac{x}{y}}\right) \]
      4. flip--N/A

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

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

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

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

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\frac{t}{y} \cdot \frac{t}{y} - \frac{x}{y} \cdot \color{blue}{\frac{x}{y}}}{\frac{t}{y} + \frac{x}{y}} \]
      10. frac-timesN/A

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

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

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\frac{t}{y} \cdot \frac{t}{y} - \color{blue}{\frac{x \cdot x}{y \cdot y}}}{\frac{t}{y} + \frac{x}{y}} \]
      14. lower-+.f6417.8

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\frac{t}{y} \cdot \frac{t}{y} - \frac{x \cdot x}{y \cdot y}}{\color{blue}{\frac{t}{y} + \frac{x}{y}}} \]
    7. Applied rewrites17.8%

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

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\frac{t}{y} \cdot \color{blue}{\frac{t}{y}} - \frac{x \cdot x}{y \cdot y}}{\frac{t}{y} + \frac{x}{y}} \]
      3. times-fracN/A

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

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\frac{t}{y} \cdot \frac{t}{y} - \frac{x}{y} \cdot \color{blue}{\frac{x}{y}}}{\frac{t}{y} + \frac{x}{y}} \]
      6. difference-of-squaresN/A

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

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

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

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\left(\color{blue}{\frac{t}{y}} + \frac{x}{y}\right) \cdot \left(\frac{t}{y} - \frac{x}{y}\right)}{\frac{t}{y} + \frac{x}{y}} \]
      11. div-invN/A

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\left(t \cdot \frac{1}{y} + \color{blue}{\frac{x}{y}}\right) \cdot \left(\frac{t}{y} - \frac{x}{y}\right)}{\frac{t}{y} + \frac{x}{y}} \]
      13. div-invN/A

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\left(t \cdot \frac{1}{y} + \color{blue}{x \cdot \frac{1}{y}}\right) \cdot \left(\frac{t}{y} - \frac{x}{y}\right)}{\frac{t}{y} + \frac{x}{y}} \]
      14. distribute-rgt-outN/A

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

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

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

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

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\left(\frac{1}{y} \cdot \left(t + x\right)\right) \cdot \left(\frac{t}{y} - \color{blue}{\frac{x}{y}}\right)}{\frac{t}{y} + \frac{x}{y}} \]
      20. sub-divN/A

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\left(\frac{1}{y} \cdot \left(t + x\right)\right) \cdot \frac{\color{blue}{t - x}}{y}}{\frac{t}{y} + \frac{x}{y}} \]
      22. lower-/.f6432.5

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

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

      \[\leadsto x + \color{blue}{x \cdot \left(\left(-1 \cdot z + \left(\frac{z \cdot \left(t + -1 \cdot t\right)}{x} + \frac{{t}^{2} \cdot z}{{x}^{2}}\right)\right) - \left(-1 \cdot \frac{t \cdot z}{x} + \frac{t \cdot \left(z \cdot \left(t + -1 \cdot t\right) - -1 \cdot \left(t \cdot z\right)\right)}{{x}^{2}}\right)\right)} \]
    11. Applied rewrites78.2%

      \[\leadsto x + \color{blue}{x \cdot \left(\mathsf{fma}\left(t, t \cdot \frac{z}{x \cdot x}, -z\right) - \mathsf{fma}\left(t, t \cdot \frac{z}{x \cdot x}, \frac{t \cdot \left(-z\right)}{x}\right)\right)} \]

    if -7.80000000000000043e59 < x < 8.19999999999999985e113

    1. Initial program 90.2%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \color{blue}{\frac{x}{y}}\right) \]
    4. Step-by-step derivation
      1. lower-/.f6474.9

        \[\leadsto x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \color{blue}{\frac{x}{y}}\right) \]
    5. Applied rewrites74.9%

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

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

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

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

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right)} \]
      6. lift-*.f64N/A

        \[\leadsto x + \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right)} \]
      7. +-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) + x} \]
      8. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right)} + x \]
      9. *-commutativeN/A

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

        \[\leadsto \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) \cdot \color{blue}{\left(y \cdot z\right)} + x \]
      11. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) \cdot y\right) \cdot z} + x \]
      12. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) \cdot y, z, x\right)} \]
      13. lower-*.f6481.8

        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) \cdot y}, z, x\right) \]
    7. Applied rewrites81.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) \cdot y, z, x\right)} \]

    if 8.19999999999999985e113 < x

    1. Initial program 99.9%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
      2. lower--.f6443.1

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

      \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
    6. Taylor expanded in t around inf

      \[\leadsto x + \color{blue}{t \cdot z} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto x + \color{blue}{z \cdot t} \]
      2. lower-*.f6482.0

        \[\leadsto x + \color{blue}{z \cdot t} \]
    8. Applied rewrites82.0%

      \[\leadsto x + \color{blue}{z \cdot t} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification81.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.8 \cdot 10^{+59}:\\ \;\;\;\;x + x \cdot \left(\mathsf{fma}\left(t, t \cdot \frac{z}{x \cdot x}, -z\right) - \mathsf{fma}\left(t, t \cdot \frac{z}{x \cdot x}, \frac{t \cdot \left(-z\right)}{x}\right)\right)\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{+113}:\\ \;\;\;\;\mathsf{fma}\left(y \cdot \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right), z, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 59.3% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 3.2 \cdot 10^{-68}:\\ \;\;\;\;\mathsf{fma}\left(z, -x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z \cdot \left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right), y, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y 3.2e-68)
   (fma z (- x) x)
   (fma (* z (- (/ t y) (tanh (/ x y)))) y x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 3.2e-68) {
		tmp = fma(z, -x, x);
	} else {
		tmp = fma((z * ((t / y) - tanh((x / y)))), y, x);
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 3.2e-68)
		tmp = fma(z, Float64(-x), x);
	else
		tmp = fma(Float64(z * Float64(Float64(t / y) - tanh(Float64(x / y)))), y, x);
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.2e-68], N[(z * (-x) + x), $MachinePrecision], N[(N[(z * N[(N[(t / y), $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.2 \cdot 10^{-68}:\\
\;\;\;\;\mathsf{fma}\left(z, -x, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot \left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right), y, x\right)\\


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

    1. Initial program 94.5%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
      3. lower--.f6454.8

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{t - x}, x\right) \]
    5. Applied rewrites54.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
    6. Taylor expanded in t around 0

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{-1 \cdot x}, x\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{neg}\left(x\right)}, x\right) \]
      2. lower-neg.f6449.6

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{-x}, x\right) \]
    8. Applied rewrites49.6%

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{-x}, x\right) \]

    if 3.1999999999999999e-68 < y

    1. Initial program 91.8%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
      7. lift-*.f64N/A

        \[\leadsto x + \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
      8. +-commutativeN/A

        \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x} \]
      9. lift-*.f64N/A

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

        \[\leadsto \color{blue}{\left(y \cdot z\right)} \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x \]
      11. associate-*l*N/A

        \[\leadsto \color{blue}{y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)} + x \]
      12. *-commutativeN/A

        \[\leadsto \color{blue}{\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \cdot y} + x \]
      13. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right), y, x\right)} \]
      14. lower-*.f6496.3

        \[\leadsto \mathsf{fma}\left(\color{blue}{z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)}, y, x\right) \]
    4. Applied rewrites96.3%

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

      \[\leadsto \mathsf{fma}\left(z \cdot \left(\color{blue}{\frac{t}{y}} - \tanh \left(\frac{x}{y}\right)\right), y, x\right) \]
    6. Step-by-step derivation
      1. lower-/.f6480.2

        \[\leadsto \mathsf{fma}\left(z \cdot \left(\color{blue}{\frac{t}{y}} - \tanh \left(\frac{x}{y}\right)\right), y, x\right) \]
    7. Applied rewrites80.2%

      \[\leadsto \mathsf{fma}\left(z \cdot \left(\color{blue}{\frac{t}{y}} - \tanh \left(\frac{x}{y}\right)\right), y, x\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 62.7% accurate, 11.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(t - x\right)\\ \mathbf{if}\;z \leq -4.2 \cdot 10^{-10}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6800:\\ \;\;\;\;\mathsf{fma}\left(z, -x, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t x))))
   (if (<= z -4.2e-10) t_1 (if (<= z 6800.0) (fma z (- x) x) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (t - x);
	double tmp;
	if (z <= -4.2e-10) {
		tmp = t_1;
	} else if (z <= 6800.0) {
		tmp = fma(z, -x, x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(z * Float64(t - x))
	tmp = 0.0
	if (z <= -4.2e-10)
		tmp = t_1;
	elseif (z <= 6800.0)
		tmp = fma(z, Float64(-x), x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e-10], t$95$1, If[LessEqual[z, 6800.0], N[(z * (-x) + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \left(t - x\right)\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 6800:\\
\;\;\;\;\mathsf{fma}\left(z, -x, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.2e-10 or 6800 < z

    1. Initial program 88.6%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
      3. lower--.f6446.7

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{t - x}, x\right) \]
    5. Applied rewrites46.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
    6. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(t - x\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{z \cdot \left(t - x\right)} \]
      2. lower--.f6446.4

        \[\leadsto z \cdot \color{blue}{\left(t - x\right)} \]
    8. Applied rewrites46.4%

      \[\leadsto \color{blue}{z \cdot \left(t - x\right)} \]

    if -4.2e-10 < z < 6800

    1. Initial program 99.2%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
      3. lower--.f6478.7

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{t - x}, x\right) \]
    5. Applied rewrites78.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
    6. Taylor expanded in t around 0

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{-1 \cdot x}, x\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{neg}\left(x\right)}, x\right) \]
      2. lower-neg.f6486.1

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{-x}, x\right) \]
    8. Applied rewrites86.1%

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{-x}, x\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 61.2% accurate, 11.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(t - x\right)\\ \mathbf{if}\;z \leq -2.65 \cdot 10^{+36}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 360000:\\ \;\;\;\;x + t \cdot z\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t x))))
   (if (<= z -2.65e+36) t_1 (if (<= z 360000.0) (+ x (* t z)) t_1))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (t - x);
	double tmp;
	if (z <= -2.65e+36) {
		tmp = t_1;
	} else if (z <= 360000.0) {
		tmp = x + (t * z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * (t - x)
    if (z <= (-2.65d+36)) then
        tmp = t_1
    else if (z <= 360000.0d0) then
        tmp = x + (t * z)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * (t - x);
	double tmp;
	if (z <= -2.65e+36) {
		tmp = t_1;
	} else if (z <= 360000.0) {
		tmp = x + (t * z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (t - x)
	tmp = 0
	if z <= -2.65e+36:
		tmp = t_1
	elif z <= 360000.0:
		tmp = x + (t * z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(t - x))
	tmp = 0.0
	if (z <= -2.65e+36)
		tmp = t_1;
	elseif (z <= 360000.0)
		tmp = Float64(x + Float64(t * z));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (t - x);
	tmp = 0.0;
	if (z <= -2.65e+36)
		tmp = t_1;
	elseif (z <= 360000.0)
		tmp = x + (t * z);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.65e+36], t$95$1, If[LessEqual[z, 360000.0], N[(x + N[(t * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \left(t - x\right)\\
\mathbf{if}\;z \leq -2.65 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 360000:\\
\;\;\;\;x + t \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.65e36 or 3.6e5 < z

    1. Initial program 87.9%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
      3. lower--.f6447.1

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{t - x}, x\right) \]
    5. Applied rewrites47.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
    6. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(t - x\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{z \cdot \left(t - x\right)} \]
      2. lower--.f6447.1

        \[\leadsto z \cdot \color{blue}{\left(t - x\right)} \]
    8. Applied rewrites47.1%

      \[\leadsto \color{blue}{z \cdot \left(t - x\right)} \]

    if -2.65e36 < z < 3.6e5

    1. Initial program 99.2%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

        \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
      2. lower--.f6460.0

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{\color{blue}{t - x}}{y} \]
    5. Applied rewrites60.0%

      \[\leadsto x + \left(y \cdot z\right) \cdot \color{blue}{\frac{t - x}{y}} \]
    6. Taylor expanded in t around inf

      \[\leadsto x + \color{blue}{t \cdot z} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto x + \color{blue}{z \cdot t} \]
      2. lower-*.f6478.0

        \[\leadsto x + \color{blue}{z \cdot t} \]
    8. Applied rewrites78.0%

      \[\leadsto x + \color{blue}{z \cdot t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.65 \cdot 10^{+36}:\\ \;\;\;\;z \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 360000:\\ \;\;\;\;x + t \cdot z\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 20.6% accurate, 11.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -6 \cdot 10^{-161}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-123}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -6e-161) (* t z) (if (<= t 1.35e-123) (* z (- x)) (* t z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -6e-161) {
		tmp = t * z;
	} else if (t <= 1.35e-123) {
		tmp = z * -x;
	} else {
		tmp = t * z;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-6d-161)) then
        tmp = t * z
    else if (t <= 1.35d-123) then
        tmp = z * -x
    else
        tmp = t * z
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -6e-161) {
		tmp = t * z;
	} else if (t <= 1.35e-123) {
		tmp = z * -x;
	} else {
		tmp = t * z;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -6e-161:
		tmp = t * z
	elif t <= 1.35e-123:
		tmp = z * -x
	else:
		tmp = t * z
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -6e-161)
		tmp = Float64(t * z);
	elseif (t <= 1.35e-123)
		tmp = Float64(z * Float64(-x));
	else
		tmp = Float64(t * z);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -6e-161)
		tmp = t * z;
	elseif (t <= 1.35e-123)
		tmp = z * -x;
	else
		tmp = t * z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -6e-161], N[(t * z), $MachinePrecision], If[LessEqual[t, 1.35e-123], N[(z * (-x)), $MachinePrecision], N[(t * z), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{-161}:\\
\;\;\;\;t \cdot z\\

\mathbf{elif}\;t \leq 1.35 \cdot 10^{-123}:\\
\;\;\;\;z \cdot \left(-x\right)\\

\mathbf{else}:\\
\;\;\;\;t \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.99999999999999977e-161 or 1.35e-123 < t

    1. Initial program 95.4%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
      3. lower--.f6453.6

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{t - x}, x\right) \]
    5. Applied rewrites53.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
    6. Taylor expanded in t around inf

      \[\leadsto \color{blue}{t \cdot z} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{z \cdot t} \]
      2. lower-*.f6423.8

        \[\leadsto \color{blue}{z \cdot t} \]
    8. Applied rewrites23.8%

      \[\leadsto \color{blue}{z \cdot t} \]

    if -5.99999999999999977e-161 < t < 1.35e-123

    1. Initial program 89.0%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
      3. lower--.f6484.1

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{t - x}, x\right) \]
    5. Applied rewrites84.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
    6. Taylor expanded in z around inf

      \[\leadsto \color{blue}{z \cdot \left(t - x\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \color{blue}{z \cdot \left(t - x\right)} \]
      2. lower--.f6438.3

        \[\leadsto z \cdot \color{blue}{\left(t - x\right)} \]
    8. Applied rewrites38.3%

      \[\leadsto \color{blue}{z \cdot \left(t - x\right)} \]
    9. Taylor expanded in t around 0

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

        \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \]
      2. lower-neg.f6430.3

        \[\leadsto z \cdot \color{blue}{\left(-x\right)} \]
    11. Applied rewrites30.3%

      \[\leadsto z \cdot \color{blue}{\left(-x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification25.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6 \cdot 10^{-161}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;t \leq 1.35 \cdot 10^{-123}:\\ \;\;\;\;z \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 59.1% accurate, 14.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq 7.5 \cdot 10^{-68}:\\ \;\;\;\;\mathsf{fma}\left(z, -x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t - x, x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y 7.5e-68) (fma z (- x) x) (fma z (- t x) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 7.5e-68) {
		tmp = fma(z, -x, x);
	} else {
		tmp = fma(z, (t - x), x);
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (y <= 7.5e-68)
		tmp = fma(z, Float64(-x), x);
	else
		tmp = fma(z, Float64(t - x), x);
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[y, 7.5e-68], N[(z * (-x) + x), $MachinePrecision], N[(z * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.5 \cdot 10^{-68}:\\
\;\;\;\;\mathsf{fma}\left(z, -x, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t - x, x\right)\\


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

    1. Initial program 94.5%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
      3. lower--.f6454.8

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{t - x}, x\right) \]
    5. Applied rewrites54.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
    6. Taylor expanded in t around 0

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{-1 \cdot x}, x\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\mathsf{neg}\left(x\right)}, x\right) \]
      2. lower-neg.f6449.6

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{-x}, x\right) \]
    8. Applied rewrites49.6%

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{-x}, x\right) \]

    if 7.50000000000000081e-68 < y

    1. Initial program 91.8%

      \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf

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

        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
      3. lower--.f6477.0

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{t - x}, x\right) \]
    5. Applied rewrites77.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 26.4% accurate, 26.6× speedup?

\[\begin{array}{l} \\ z \cdot \left(t - x\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (* z (- t x)))
double code(double x, double y, double z, double t) {
	return z * (t - x);
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = z * (t - x)
end function
public static double code(double x, double y, double z, double t) {
	return z * (t - x);
}
def code(x, y, z, t):
	return z * (t - x)
function code(x, y, z, t)
	return Float64(z * Float64(t - x))
end
function tmp = code(x, y, z, t)
	tmp = z * (t - x);
end
code[x_, y_, z_, t_] := N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
z \cdot \left(t - x\right)
\end{array}
Derivation
  1. Initial program 93.6%

    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
  2. Add Preprocessing
  3. Taylor expanded in y around inf

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

      \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
    2. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
    3. lower--.f6462.0

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{t - x}, x\right) \]
  5. Applied rewrites62.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
  6. Taylor expanded in z around inf

    \[\leadsto \color{blue}{z \cdot \left(t - x\right)} \]
  7. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \color{blue}{z \cdot \left(t - x\right)} \]
    2. lower--.f6428.7

      \[\leadsto z \cdot \color{blue}{\left(t - x\right)} \]
  8. Applied rewrites28.7%

    \[\leadsto \color{blue}{z \cdot \left(t - x\right)} \]
  9. Add Preprocessing

Alternative 10: 17.1% accurate, 39.8× speedup?

\[\begin{array}{l} \\ t \cdot z \end{array} \]
(FPCore (x y z t) :precision binary64 (* t z))
double code(double x, double y, double z, double t) {
	return t * z;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = t * z
end function
public static double code(double x, double y, double z, double t) {
	return t * z;
}
def code(x, y, z, t):
	return t * z
function code(x, y, z, t)
	return Float64(t * z)
end
function tmp = code(x, y, z, t)
	tmp = t * z;
end
code[x_, y_, z_, t_] := N[(t * z), $MachinePrecision]
\begin{array}{l}

\\
t \cdot z
\end{array}
Derivation
  1. Initial program 93.6%

    \[x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) \]
  2. Add Preprocessing
  3. Taylor expanded in y around inf

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

      \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
    2. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
    3. lower--.f6462.0

      \[\leadsto \mathsf{fma}\left(z, \color{blue}{t - x}, x\right) \]
  5. Applied rewrites62.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(z, t - x, x\right)} \]
  6. Taylor expanded in t around inf

    \[\leadsto \color{blue}{t \cdot z} \]
  7. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \color{blue}{z \cdot t} \]
    2. lower-*.f6420.2

      \[\leadsto \color{blue}{z \cdot t} \]
  8. Applied rewrites20.2%

    \[\leadsto \color{blue}{z \cdot t} \]
  9. Final simplification20.2%

    \[\leadsto t \cdot z \]
  10. Add Preprocessing

Developer Target 1: 96.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y)))))))
double code(double x, double y, double z, double t) {
	return x + (y * (z * (tanh((t / y)) - tanh((x / y)))));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + (y * (z * (tanh((t / y)) - tanh((x / y)))))
end function
public static double code(double x, double y, double z, double t) {
	return x + (y * (z * (Math.tanh((t / y)) - Math.tanh((x / y)))));
}
def code(x, y, z, t):
	return x + (y * (z * (math.tanh((t / y)) - math.tanh((x / y)))))
function code(x, y, z, t)
	return Float64(x + Float64(y * Float64(z * Float64(tanh(Float64(t / y)) - tanh(Float64(x / y))))))
end
function tmp = code(x, y, z, t)
	tmp = x + (y * (z * (tanh((t / y)) - tanh((x / y)))));
end
code[x_, y_, z_, t_] := N[(x + N[(y * N[(z * N[(N[Tanh[N[(t / y), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + y \cdot \left(z \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)\right)
\end{array}

Reproduce

?
herbie shell --seed 2024219 
(FPCore (x y z t)
  :name "SynthBasics:moogVCF from YampaSynth-0.2"
  :precision binary64

  :alt
  (! :herbie-platform default (+ x (* y (* z (- (tanh (/ t y)) (tanh (/ x y)))))))

  (+ x (* (* y z) (- (tanh (/ t y)) (tanh (/ x y))))))