SynthBasics:moogVCF from YampaSynth-0.2

Percentage Accurate: 92.9% → 98.8%
Time: 8.8s
Alternatives: 9
Speedup: 0.5×

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 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: 92.9% 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: 98.8% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y))))) < 1.00000000000000002e306

    1. Initial program 97.3%

      \[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 \color{blue}{x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
      2. +-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} \]
      3. 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 \]
      4. *-commutativeN/A

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

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

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

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

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

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

    if 1.00000000000000002e306 < (+.f64 x (*.f64 (*.f64 y z) (-.f64 (tanh.f64 (/.f64 t y)) (tanh.f64 (/.f64 x y)))))

    1. Initial program 48.1%

      \[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. *-commutativeN/A

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

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

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

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

Alternative 2: 78.7% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{+34} \lor \neg \left(x \leq 1.6 \cdot 10^{+44}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.4500000000000001e34 or 1.60000000000000002e44 < x

    1. Initial program 98.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. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
      2. +-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} \]
      3. 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 \]
      4. *-commutativeN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(\frac{\color{blue}{\frac{1}{2} \cdot \frac{-1 \cdot {t}^{2} + {t}^{2}}{y} + t}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left(\left(\frac{\color{blue}{\frac{\frac{1}{2} \cdot \left(-1 \cdot {t}^{2} + {t}^{2}\right)}{y}} + t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
      5. distribute-lft1-inN/A

        \[\leadsto \mathsf{fma}\left(\left(\frac{\frac{\frac{1}{2} \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot {t}^{2}\right)}}{y} + t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\left(\frac{\frac{\frac{1}{2} \cdot \left(\color{blue}{0} \cdot {t}^{2}\right)}{y} + t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
      7. mul0-lftN/A

        \[\leadsto \mathsf{fma}\left(\left(\frac{\frac{\frac{1}{2} \cdot \color{blue}{0}}{y} + t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\left(\frac{\frac{\color{blue}{0}}{y} + t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
      9. lower-/.f6480.3

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

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

    if -2.4500000000000001e34 < x < 1.60000000000000002e44

    1. Initial program 90.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 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 \color{blue}{x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.45 \cdot 10^{+34} \lor \neg \left(x \leq 1.6 \cdot 10^{+44}\right):\\ \;\;\;\;\mathsf{fma}\left(\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) \cdot z, y, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 77.5% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{+34} \lor \neg \left(x \leq 6.5 \cdot 10^{+45}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right), z \cdot y, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.4500000000000001e34 or 6.50000000000000034e45 < x

    1. Initial program 98.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. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
      2. +-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} \]
      3. 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 \]
      4. *-commutativeN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(\frac{\color{blue}{\frac{1}{2} \cdot \frac{-1 \cdot {t}^{2} + {t}^{2}}{y} + t}}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
      4. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left(\left(\frac{\color{blue}{\frac{\frac{1}{2} \cdot \left(-1 \cdot {t}^{2} + {t}^{2}\right)}{y}} + t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
      5. distribute-lft1-inN/A

        \[\leadsto \mathsf{fma}\left(\left(\frac{\frac{\frac{1}{2} \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot {t}^{2}\right)}}{y} + t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\left(\frac{\frac{\frac{1}{2} \cdot \left(\color{blue}{0} \cdot {t}^{2}\right)}{y} + t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
      7. mul0-lftN/A

        \[\leadsto \mathsf{fma}\left(\left(\frac{\frac{\frac{1}{2} \cdot \color{blue}{0}}{y} + t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(\left(\frac{\frac{\color{blue}{0}}{y} + t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot y, z, x\right) \]
      9. lower-/.f6480.3

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

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

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

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

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

        \[\leadsto \left(\frac{\frac{0}{y} + t}{y} - \tanh \left(\frac{x}{y}\right)\right) \cdot \color{blue}{\left(y \cdot z\right)} + x \]
      5. lower-fma.f6478.4

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{Rewrite=>}\left(+-lft-identity, t\right)}{y} - \tanh \left(\frac{x}{y}\right), \color{blue}{y \cdot z}, x\right) \]
      7. *-commutativeN/A

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

        \[\leadsto \mathsf{fma}\left(\frac{\mathsf{Rewrite=>}\left(+-lft-identity, t\right)}{y} - \tanh \left(\frac{x}{y}\right), \color{blue}{z \cdot y}, x\right) \]
    9. Applied rewrites78.4%

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

    if -2.4500000000000001e34 < x < 6.50000000000000034e45

    1. Initial program 90.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 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 \color{blue}{x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.45 \cdot 10^{+34} \lor \neg \left(x \leq 6.5 \cdot 10^{+45}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{t}{y} - \tanh \left(\frac{x}{y}\right), z \cdot y, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right) \cdot z, y, x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 72.6% accurate, 1.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55 \cdot 10^{+135}:\\
\;\;\;\;\mathsf{fma}\left(t - x, z, x\right)\\

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

\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot z\right) \cdot \frac{t}{y}\\


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

    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 \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. *-commutativeN/A

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

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

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

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

    if -1.55000000000000011e135 < x < 3.60000000000000016e132

    1. Initial program 91.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-/.f6472.9

        \[\leadsto x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \color{blue}{\frac{x}{y}}\right) \]
    5. Applied rewrites72.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 \color{blue}{x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \frac{x}{y}\right)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

    if 3.60000000000000016e132 < x

    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--.f6437.8

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

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

      \[\leadsto x + \left(y \cdot z\right) \cdot \frac{t}{\color{blue}{y}} \]
    7. Step-by-step derivation
      1. Applied rewrites72.3%

        \[\leadsto x + \left(y \cdot z\right) \cdot \frac{t}{\color{blue}{y}} \]
    8. Recombined 3 regimes into one program.
    9. Add Preprocessing

    Alternative 5: 52.4% accurate, 6.5× speedup?

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

      1. Initial program 94.3%

        \[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. *-commutativeN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-1 \cdot x, z, x\right) \]
      7. Step-by-step derivation
        1. Applied rewrites50.3%

          \[\leadsto \mathsf{fma}\left(-x, z, x\right) \]
        2. Step-by-step derivation
          1. Applied rewrites43.1%

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

          if 1.75e-247 < y < 2.1e7

          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--.f6437.7

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

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

            \[\leadsto x + \left(y \cdot z\right) \cdot \frac{t}{\color{blue}{y}} \]
          7. Step-by-step derivation
            1. Applied rewrites52.1%

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

            if 2.1e7 < y

            1. Initial program 85.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. *-commutativeN/A

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

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

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

              \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
          8. Recombined 3 regimes into one program.
          9. Final simplification55.4%

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

          Alternative 6: 59.3% accurate, 6.8× speedup?

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

            1. Initial program 94.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. *-commutativeN/A

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

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

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

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

              \[\leadsto \mathsf{fma}\left(-1 \cdot x, z, x\right) \]
            7. Step-by-step derivation
              1. Applied rewrites50.2%

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

              if 1.65e-164 < y < 2.1e7

              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. Step-by-step derivation
                1. lift-+.f64N/A

                  \[\leadsto \color{blue}{x + \left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right)} \]
                2. +-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} \]
                3. 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 \]
                4. *-commutativeN/A

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\left(-1 \cdot \frac{-1 \cdot t - -1 \cdot x}{y}\right)} \cdot y, z, x\right) \]
              6. Step-by-step derivation
                1. associate-*r/N/A

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

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

                  \[\leadsto \mathsf{fma}\left(\frac{\color{blue}{\mathsf{neg}\left(\left(-1 \cdot t - -1 \cdot x\right)\right)}}{y} \cdot y, z, x\right) \]
                4. distribute-lft-out--N/A

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

                  \[\leadsto \mathsf{fma}\left(\frac{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right)}\right)}{y} \cdot y, z, x\right) \]
                6. remove-double-negN/A

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

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

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

                \[\leadsto \mathsf{fma}\left(\frac{t}{\color{blue}{y}} \cdot y, z, x\right) \]
              9. Step-by-step derivation
                1. Applied rewrites58.0%

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

                if 2.1e7 < y

                1. Initial program 85.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. *-commutativeN/A

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

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

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

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

              Alternative 7: 59.2% accurate, 14.9× speedup?

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

                1. Initial program 95.7%

                  \[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. *-commutativeN/A

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(-1 \cdot x, z, x\right) \]
                7. Step-by-step derivation
                  1. Applied rewrites49.9%

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

                  if 8.8000000000000005e-48 < y

                  1. Initial program 88.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. *-commutativeN/A

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

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

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

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

                Alternative 8: 53.3% accurate, 15.9× speedup?

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

                  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. *-commutativeN/A

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

                      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, z, x\right)} \]
                    4. lower--.f6465.9

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

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

                    \[\leadsto \mathsf{fma}\left(-1 \cdot x, z, x\right) \]
                  7. Step-by-step derivation
                    1. Applied rewrites65.4%

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

                    if 1.70000000000000001e-14 < z

                    1. Initial program 88.7%

                      \[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. *-commutativeN/A

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

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

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

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

                      \[\leadsto t \cdot \color{blue}{z} \]
                    7. Step-by-step derivation
                      1. Applied rewrites27.4%

                        \[\leadsto z \cdot \color{blue}{t} \]
                    8. Recombined 2 regimes into one program.
                    9. Add Preprocessing

                    Alternative 9: 17.2% accurate, 39.8× speedup?

                    \[\begin{array}{l} \\ z \cdot t \end{array} \]
                    (FPCore (x y z t) :precision binary64 (* z t))
                    double code(double x, double y, double z, double t) {
                    	return z * t;
                    }
                    
                    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
                    end function
                    
                    public static double code(double x, double y, double z, double t) {
                    	return z * t;
                    }
                    
                    def code(x, y, z, t):
                    	return z * t
                    
                    function code(x, y, z, t)
                    	return Float64(z * t)
                    end
                    
                    function tmp = code(x, y, z, t)
                    	tmp = z * t;
                    end
                    
                    code[x_, y_, z_, t_] := N[(z * t), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    z \cdot t
                    \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. *-commutativeN/A

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

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

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

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

                      \[\leadsto t \cdot \color{blue}{z} \]
                    7. Step-by-step derivation
                      1. Applied rewrites16.1%

                        \[\leadsto z \cdot \color{blue}{t} \]
                      2. Add Preprocessing

                      Developer Target 1: 96.7% 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 2024296 
                      (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))))))