SynthBasics:moogVCF from YampaSynth-0.2

Percentage Accurate: 93.4% → 97.3%
Time: 10.3s
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: 97.3% accurate, 0.7× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 3.5 \cdot 10^{+153}:\\ \;\;\;\;\mathsf{fma}\left(y\_m, z \cdot \left(\tanh \left(\frac{t}{y\_m}\right) - \tanh \left(\frac{x}{y\_m}\right)\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t - x, x\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= y_m 3.5e+153)
   (fma y_m (* z (- (tanh (/ t y_m)) (tanh (/ x y_m)))) x)
   (fma z (- t x) x)))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (y_m <= 3.5e+153) {
		tmp = fma(y_m, (z * (tanh((t / y_m)) - tanh((x / y_m)))), x);
	} else {
		tmp = fma(z, (t - x), x);
	}
	return tmp;
}
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (y_m <= 3.5e+153)
		tmp = fma(y_m, Float64(z * Float64(tanh(Float64(t / y_m)) - tanh(Float64(x / y_m)))), x);
	else
		tmp = fma(z, Float64(t - x), x);
	end
	return tmp
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 3.5e+153], N[(y$95$m * N[(z * N[(N[Tanh[N[(t / y$95$m), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(z * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 3.5 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(y\_m, z \cdot \left(\tanh \left(\frac{t}{y\_m}\right) - \tanh \left(\frac{x}{y\_m}\right)\right), 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 < 3.4999999999999999e153

    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. Step-by-step derivation
      1. +-commutative97.3%

        \[\leadsto \color{blue}{\left(y \cdot z\right) \cdot \left(\tanh \left(\frac{t}{y}\right) - \tanh \left(\frac{x}{y}\right)\right) + x} \]
      2. associate-*l*97.6%

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

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

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

    if 3.4999999999999999e153 < y

    1. Initial program 62.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 97.6%

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

        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
      2. fma-define97.7%

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

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

Alternative 2: 96.2% accurate, 1.0× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 8.2 \cdot 10^{+152}:\\ \;\;\;\;x + \left(\tanh \left(\frac{t}{y\_m}\right) - \tanh \left(\frac{x}{y\_m}\right)\right) \cdot \left(y\_m \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t - x, x\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= y_m 8.2e+152)
   (+ x (* (- (tanh (/ t y_m)) (tanh (/ x y_m))) (* y_m z)))
   (fma z (- t x) x)))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (y_m <= 8.2e+152) {
		tmp = x + ((tanh((t / y_m)) - tanh((x / y_m))) * (y_m * z));
	} else {
		tmp = fma(z, (t - x), x);
	}
	return tmp;
}
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (y_m <= 8.2e+152)
		tmp = Float64(x + Float64(Float64(tanh(Float64(t / y_m)) - tanh(Float64(x / y_m))) * Float64(y_m * z)));
	else
		tmp = fma(z, Float64(t - x), x);
	end
	return tmp
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 8.2e+152], N[(x + N[(N[(N[Tanh[N[(t / y$95$m), $MachinePrecision]], $MachinePrecision] - N[Tanh[N[(x / y$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(y$95$m * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 8.2 \cdot 10^{+152}:\\
\;\;\;\;x + \left(\tanh \left(\frac{t}{y\_m}\right) - \tanh \left(\frac{x}{y\_m}\right)\right) \cdot \left(y\_m \cdot z\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 < 8.1999999999999996e152

    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

    if 8.1999999999999996e152 < y

    1. Initial program 62.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 97.6%

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

        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
      2. fma-define97.7%

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

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

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

Alternative 3: 85.8% accurate, 1.9× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 10^{+128}:\\ \;\;\;\;x + y\_m \cdot \left(z \cdot \tanh \left(\frac{t}{y\_m}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t - x, x\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= y_m 1e+128) (+ x (* y_m (* z (tanh (/ t y_m))))) (fma z (- t x) x)))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (y_m <= 1e+128) {
		tmp = x + (y_m * (z * tanh((t / y_m))));
	} else {
		tmp = fma(z, (t - x), x);
	}
	return tmp;
}
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (y_m <= 1e+128)
		tmp = Float64(x + Float64(y_m * Float64(z * tanh(Float64(t / y_m)))));
	else
		tmp = fma(z, Float64(t - x), x);
	end
	return tmp
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 1e+128], N[(x + N[(y$95$m * N[(z * N[Tanh[N[(t / y$95$m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 10^{+128}:\\
\;\;\;\;x + y\_m \cdot \left(z \cdot \tanh \left(\frac{t}{y\_m}\right)\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 < 1.0000000000000001e128

    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. Taylor expanded in x around 0 27.8%

      \[\leadsto x + \color{blue}{y \cdot \left(z \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{1}{e^{\frac{t}{y}} \cdot \left(e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}\right)}\right)\right)} \]
    4. Step-by-step derivation
      1. associate-/r*27.8%

        \[\leadsto x + y \cdot \left(z \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \color{blue}{\frac{\frac{1}{e^{\frac{t}{y}}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}}}\right)\right) \]
      2. rec-exp27.9%

        \[\leadsto x + y \cdot \left(z \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{\color{blue}{e^{-\frac{t}{y}}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}}\right)\right) \]
      3. div-sub27.9%

        \[\leadsto x + y \cdot \left(z \cdot \color{blue}{\frac{e^{\frac{t}{y}} - e^{-\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}}}\right) \]
      4. rec-exp27.9%

        \[\leadsto x + y \cdot \left(z \cdot \frac{e^{\frac{t}{y}} - e^{-\frac{t}{y}}}{e^{\frac{t}{y}} + \color{blue}{e^{-\frac{t}{y}}}}\right) \]
      5. tanh-def-a82.5%

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

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

    if 1.0000000000000001e128 < y

    1. Initial program 63.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 97.7%

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

        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
      2. fma-define97.8%

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

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

Alternative 4: 78.1% accurate, 1.9× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 5.2 \cdot 10^{+15}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t - x, x\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= y_m 5.2e+15) x (fma z (- t x) x)))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (y_m <= 5.2e+15) {
		tmp = x;
	} else {
		tmp = fma(z, (t - x), x);
	}
	return tmp;
}
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (y_m <= 5.2e+15)
		tmp = x;
	else
		tmp = fma(z, Float64(t - x), x);
	end
	return tmp
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 5.2e+15], x, N[(z * N[(t - x), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 5.2 \cdot 10^{+15}:\\
\;\;\;\;x\\

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


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

    1. Initial program 97.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 x around inf 67.6%

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

    if 5.2e15 < y

    1. Initial program 74.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 89.8%

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

        \[\leadsto \color{blue}{z \cdot \left(t - x\right) + x} \]
      2. fma-define89.8%

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

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

Alternative 5: 63.2% accurate, 10.6× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 3.2 \cdot 10^{+29} \lor \neg \left(y\_m \leq 2.25 \cdot 10^{+69}\right) \land y\_m \leq 2.5 \cdot 10^{+116}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t - x\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (or (<= y_m 3.2e+29) (and (not (<= y_m 2.25e+69)) (<= y_m 2.5e+116)))
   x
   (* z (- t x))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if ((y_m <= 3.2e+29) || (!(y_m <= 2.25e+69) && (y_m <= 2.5e+116))) {
		tmp = x;
	} else {
		tmp = z * (t - x);
	}
	return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((y_m <= 3.2d+29) .or. (.not. (y_m <= 2.25d+69)) .and. (y_m <= 2.5d+116)) then
        tmp = x
    else
        tmp = z * (t - x)
    end if
    code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
	double tmp;
	if ((y_m <= 3.2e+29) || (!(y_m <= 2.25e+69) && (y_m <= 2.5e+116))) {
		tmp = x;
	} else {
		tmp = z * (t - x);
	}
	return tmp;
}
y_m = math.fabs(y)
def code(x, y_m, z, t):
	tmp = 0
	if (y_m <= 3.2e+29) or (not (y_m <= 2.25e+69) and (y_m <= 2.5e+116)):
		tmp = x
	else:
		tmp = z * (t - x)
	return tmp
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if ((y_m <= 3.2e+29) || (!(y_m <= 2.25e+69) && (y_m <= 2.5e+116)))
		tmp = x;
	else
		tmp = Float64(z * Float64(t - x));
	end
	return tmp
end
y_m = abs(y);
function tmp_2 = code(x, y_m, z, t)
	tmp = 0.0;
	if ((y_m <= 3.2e+29) || (~((y_m <= 2.25e+69)) && (y_m <= 2.5e+116)))
		tmp = x;
	else
		tmp = z * (t - x);
	end
	tmp_2 = tmp;
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[Or[LessEqual[y$95$m, 3.2e+29], And[N[Not[LessEqual[y$95$m, 2.25e+69]], $MachinePrecision], LessEqual[y$95$m, 2.5e+116]]], x, N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 3.2 \cdot 10^{+29} \lor \neg \left(y\_m \leq 2.25 \cdot 10^{+69}\right) \land y\_m \leq 2.5 \cdot 10^{+116}:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(t - x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 3.19999999999999987e29 or 2.25e69 < y < 2.50000000000000013e116

    1. Initial program 97.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 x around inf 68.1%

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

    if 3.19999999999999987e29 < y < 2.25e69 or 2.50000000000000013e116 < y

    1. Initial program 73.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 91.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3.2 \cdot 10^{+29} \lor \neg \left(y \leq 2.25 \cdot 10^{+69}\right) \land y \leq 2.5 \cdot 10^{+116}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 70.2% accurate, 10.6× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 1.52 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{elif}\;y\_m \leq 1.7 \cdot 10^{+263}:\\ \;\;\;\;x + z \cdot t\\ \mathbf{elif}\;y\_m \leq 8.2 \cdot 10^{+281}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t - x\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= y_m 1.52e+16)
   x
   (if (<= y_m 1.7e+263)
     (+ x (* z t))
     (if (<= y_m 8.2e+281) (* x (- 1.0 z)) (* z (- t x))))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (y_m <= 1.52e+16) {
		tmp = x;
	} else if (y_m <= 1.7e+263) {
		tmp = x + (z * t);
	} else if (y_m <= 8.2e+281) {
		tmp = x * (1.0 - z);
	} else {
		tmp = z * (t - x);
	}
	return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y_m <= 1.52d+16) then
        tmp = x
    else if (y_m <= 1.7d+263) then
        tmp = x + (z * t)
    else if (y_m <= 8.2d+281) then
        tmp = x * (1.0d0 - z)
    else
        tmp = z * (t - x)
    end if
    code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
	double tmp;
	if (y_m <= 1.52e+16) {
		tmp = x;
	} else if (y_m <= 1.7e+263) {
		tmp = x + (z * t);
	} else if (y_m <= 8.2e+281) {
		tmp = x * (1.0 - z);
	} else {
		tmp = z * (t - x);
	}
	return tmp;
}
y_m = math.fabs(y)
def code(x, y_m, z, t):
	tmp = 0
	if y_m <= 1.52e+16:
		tmp = x
	elif y_m <= 1.7e+263:
		tmp = x + (z * t)
	elif y_m <= 8.2e+281:
		tmp = x * (1.0 - z)
	else:
		tmp = z * (t - x)
	return tmp
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (y_m <= 1.52e+16)
		tmp = x;
	elseif (y_m <= 1.7e+263)
		tmp = Float64(x + Float64(z * t));
	elseif (y_m <= 8.2e+281)
		tmp = Float64(x * Float64(1.0 - z));
	else
		tmp = Float64(z * Float64(t - x));
	end
	return tmp
end
y_m = abs(y);
function tmp_2 = code(x, y_m, z, t)
	tmp = 0.0;
	if (y_m <= 1.52e+16)
		tmp = x;
	elseif (y_m <= 1.7e+263)
		tmp = x + (z * t);
	elseif (y_m <= 8.2e+281)
		tmp = x * (1.0 - z);
	else
		tmp = z * (t - x);
	end
	tmp_2 = tmp;
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 1.52e+16], x, If[LessEqual[y$95$m, 1.7e+263], N[(x + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$95$m, 8.2e+281], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 1.52 \cdot 10^{+16}:\\
\;\;\;\;x\\

\mathbf{elif}\;y\_m \leq 1.7 \cdot 10^{+263}:\\
\;\;\;\;x + z \cdot t\\

\mathbf{elif}\;y\_m \leq 8.2 \cdot 10^{+281}:\\
\;\;\;\;x \cdot \left(1 - z\right)\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(t - x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < 1.52e16

    1. Initial program 97.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 x around inf 67.6%

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

    if 1.52e16 < y < 1.7000000000000001e263

    1. Initial program 76.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 x around 0 31.2%

      \[\leadsto x + \color{blue}{y \cdot \left(z \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{1}{e^{\frac{t}{y}} \cdot \left(e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}\right)}\right)\right)} \]
    4. Step-by-step derivation
      1. associate-/r*31.2%

        \[\leadsto x + y \cdot \left(z \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \color{blue}{\frac{\frac{1}{e^{\frac{t}{y}}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}}}\right)\right) \]
      2. rec-exp31.3%

        \[\leadsto x + y \cdot \left(z \cdot \left(\frac{e^{\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}} - \frac{\color{blue}{e^{-\frac{t}{y}}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}}\right)\right) \]
      3. div-sub31.3%

        \[\leadsto x + y \cdot \left(z \cdot \color{blue}{\frac{e^{\frac{t}{y}} - e^{-\frac{t}{y}}}{e^{\frac{t}{y}} + \frac{1}{e^{\frac{t}{y}}}}}\right) \]
      4. rec-exp31.3%

        \[\leadsto x + y \cdot \left(z \cdot \frac{e^{\frac{t}{y}} - e^{-\frac{t}{y}}}{e^{\frac{t}{y}} + \color{blue}{e^{-\frac{t}{y}}}}\right) \]
      5. tanh-def-a67.5%

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

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

      \[\leadsto \color{blue}{x + t \cdot z} \]
    7. Step-by-step derivation
      1. +-commutative72.3%

        \[\leadsto \color{blue}{t \cdot z + x} \]
      2. *-commutative72.3%

        \[\leadsto \color{blue}{z \cdot t} + x \]
    8. Simplified72.3%

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

    if 1.7000000000000001e263 < y < 8.19999999999999962e281

    1. Initial program 83.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 100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot z\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg100.0%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-z\right)}\right) \]
      2. unsub-neg100.0%

        \[\leadsto x \cdot \color{blue}{\left(1 - z\right)} \]
    6. Simplified100.0%

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

    if 8.19999999999999962e281 < y

    1. Initial program 51.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 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.52 \cdot 10^{+16}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+263}:\\ \;\;\;\;x + z \cdot t\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{+281}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 66.2% accurate, 14.2× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 2100000000:\\ \;\;\;\;x\\ \mathbf{elif}\;y\_m \leq 1.05 \cdot 10^{+282}:\\ \;\;\;\;x \cdot \left(1 - z\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot t\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= y_m 2100000000.0) x (if (<= y_m 1.05e+282) (* x (- 1.0 z)) (* z t))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (y_m <= 2100000000.0) {
		tmp = x;
	} else if (y_m <= 1.05e+282) {
		tmp = x * (1.0 - z);
	} else {
		tmp = z * t;
	}
	return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y_m <= 2100000000.0d0) then
        tmp = x
    else if (y_m <= 1.05d+282) then
        tmp = x * (1.0d0 - z)
    else
        tmp = z * t
    end if
    code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
	double tmp;
	if (y_m <= 2100000000.0) {
		tmp = x;
	} else if (y_m <= 1.05e+282) {
		tmp = x * (1.0 - z);
	} else {
		tmp = z * t;
	}
	return tmp;
}
y_m = math.fabs(y)
def code(x, y_m, z, t):
	tmp = 0
	if y_m <= 2100000000.0:
		tmp = x
	elif y_m <= 1.05e+282:
		tmp = x * (1.0 - z)
	else:
		tmp = z * t
	return tmp
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (y_m <= 2100000000.0)
		tmp = x;
	elseif (y_m <= 1.05e+282)
		tmp = Float64(x * Float64(1.0 - z));
	else
		tmp = Float64(z * t);
	end
	return tmp
end
y_m = abs(y);
function tmp_2 = code(x, y_m, z, t)
	tmp = 0.0;
	if (y_m <= 2100000000.0)
		tmp = x;
	elseif (y_m <= 1.05e+282)
		tmp = x * (1.0 - z);
	else
		tmp = z * t;
	end
	tmp_2 = tmp;
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 2100000000.0], x, If[LessEqual[y$95$m, 1.05e+282], N[(x * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(z * t), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 2100000000:\\
\;\;\;\;x\\

\mathbf{elif}\;y\_m \leq 1.05 \cdot 10^{+282}:\\
\;\;\;\;x \cdot \left(1 - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 2.1e9

    1. Initial program 97.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 x around inf 67.6%

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

    if 2.1e9 < y < 1.04999999999999994e282

    1. Initial program 77.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 88.6%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot z\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg54.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-z\right)}\right) \]
      2. unsub-neg54.5%

        \[\leadsto x \cdot \color{blue}{\left(1 - z\right)} \]
    6. Simplified54.5%

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

    if 1.04999999999999994e282 < y

    1. Initial program 51.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 100.0%

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

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

      \[\leadsto z \cdot \color{blue}{t} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 60.7% accurate, 16.3× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;x \leq -8.4 \cdot 10^{-209}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.68 \cdot 10^{-190}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= x -8.4e-209) x (if (<= x 1.68e-190) (* z t) x)))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (x <= -8.4e-209) {
		tmp = x;
	} else if (x <= 1.68e-190) {
		tmp = z * t;
	} else {
		tmp = x;
	}
	return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (x <= (-8.4d-209)) then
        tmp = x
    else if (x <= 1.68d-190) then
        tmp = z * t
    else
        tmp = x
    end if
    code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
	double tmp;
	if (x <= -8.4e-209) {
		tmp = x;
	} else if (x <= 1.68e-190) {
		tmp = z * t;
	} else {
		tmp = x;
	}
	return tmp;
}
y_m = math.fabs(y)
def code(x, y_m, z, t):
	tmp = 0
	if x <= -8.4e-209:
		tmp = x
	elif x <= 1.68e-190:
		tmp = z * t
	else:
		tmp = x
	return tmp
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (x <= -8.4e-209)
		tmp = x;
	elseif (x <= 1.68e-190)
		tmp = Float64(z * t);
	else
		tmp = x;
	end
	return tmp
end
y_m = abs(y);
function tmp_2 = code(x, y_m, z, t)
	tmp = 0.0;
	if (x <= -8.4e-209)
		tmp = x;
	elseif (x <= 1.68e-190)
		tmp = z * t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[x, -8.4e-209], x, If[LessEqual[x, 1.68e-190], N[(z * t), $MachinePrecision], x]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.4 \cdot 10^{-209}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.68 \cdot 10^{-190}:\\
\;\;\;\;z \cdot t\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.39999999999999983e-209 or 1.67999999999999988e-190 < x

    1. Initial program 94.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 x around inf 68.0%

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

    if -8.39999999999999983e-209 < x < 1.67999999999999988e-190

    1. Initial program 82.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 67.7%

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

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

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

Alternative 9: 78.1% accurate, 17.7× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ \begin{array}{l} \mathbf{if}\;y\_m \leq 4.4 \cdot 10^{+17}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(t - x\right)\\ \end{array} \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
 :precision binary64
 (if (<= y_m 4.4e+17) x (+ x (* z (- t x)))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	double tmp;
	if (y_m <= 4.4e+17) {
		tmp = x;
	} else {
		tmp = x + (z * (t - x));
	}
	return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (y_m <= 4.4d+17) then
        tmp = x
    else
        tmp = x + (z * (t - x))
    end if
    code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
	double tmp;
	if (y_m <= 4.4e+17) {
		tmp = x;
	} else {
		tmp = x + (z * (t - x));
	}
	return tmp;
}
y_m = math.fabs(y)
def code(x, y_m, z, t):
	tmp = 0
	if y_m <= 4.4e+17:
		tmp = x
	else:
		tmp = x + (z * (t - x))
	return tmp
y_m = abs(y)
function code(x, y_m, z, t)
	tmp = 0.0
	if (y_m <= 4.4e+17)
		tmp = x;
	else
		tmp = Float64(x + Float64(z * Float64(t - x)));
	end
	return tmp
end
y_m = abs(y);
function tmp_2 = code(x, y_m, z, t)
	tmp = 0.0;
	if (y_m <= 4.4e+17)
		tmp = x;
	else
		tmp = x + (z * (t - x));
	end
	tmp_2 = tmp;
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 4.4e+17], x, N[(x + N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|

\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 4.4 \cdot 10^{+17}:\\
\;\;\;\;x\\

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


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

    1. Initial program 97.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 x around inf 67.6%

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

    if 4.4e17 < y

    1. Initial program 74.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 89.8%

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

Alternative 10: 60.7% accurate, 213.0× speedup?

\[\begin{array}{l} y_m = \left|y\right| \\ x \end{array} \]
y_m = (fabs.f64 y)
(FPCore (x y_m z t) :precision binary64 x)
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
	return x;
}
y_m = abs(y)
real(8) function code(x, y_m, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y_m
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
	return x;
}
y_m = math.fabs(y)
def code(x, y_m, z, t):
	return x
y_m = abs(y)
function code(x, y_m, z, t)
	return x
end
y_m = abs(y);
function tmp = code(x, y_m, z, t)
	tmp = x;
end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := x
\begin{array}{l}
y_m = \left|y\right|

\\
x
\end{array}
Derivation
  1. Initial program 92.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 x around inf 59.6%

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

Developer target: 97.2% 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 2024096 
(FPCore (x y z t)
  :name "SynthBasics:moogVCF from YampaSynth-0.2"
  :precision binary64

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

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