Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4

Percentage Accurate: 97.4% → 97.5%
Time: 6.7s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

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

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

Alternative 1: 97.5% accurate, 1.0× speedup?

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

\\
x + \frac{y - x}{\frac{t}{z}}
\end{array}
Derivation
  1. Initial program 98.0%

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

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

      \[\leadsto x + \color{blue}{\left(\frac{y \cdot z}{t} + -1 \cdot \frac{x \cdot z}{t}\right)} \]
    2. mul-1-neg90.6%

      \[\leadsto x + \left(\frac{y \cdot z}{t} + \color{blue}{\left(-\frac{x \cdot z}{t}\right)}\right) \]
    3. sub-neg90.6%

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

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

      \[\leadsto x + \left(\frac{y}{\frac{t}{z}} - \color{blue}{\frac{x}{\frac{t}{z}}}\right) \]
    6. div-sub98.1%

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
  4. Simplified98.1%

    \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
  5. Final simplification98.1%

    \[\leadsto x + \frac{y - x}{\frac{t}{z}} \]

Alternative 2: 63.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+220}:\\ \;\;\;\;\frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;\frac{z}{t} \leq -2 \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-19}\right):\\ \;\;\;\;-x \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ z t) -2e+220)
   (/ z (/ t y))
   (if (or (<= (/ z t) -2.0) (not (<= (/ z t) 2e-19))) (- (* x (/ z t))) x)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -2e+220) {
		tmp = z / (t / y);
	} else if (((z / t) <= -2.0) || !((z / t) <= 2e-19)) {
		tmp = -(x * (z / t));
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z / t) <= (-2d+220)) then
        tmp = z / (t / y)
    else if (((z / t) <= (-2.0d0)) .or. (.not. ((z / t) <= 2d-19))) then
        tmp = -(x * (z / t))
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -2e+220) {
		tmp = z / (t / y);
	} else if (((z / t) <= -2.0) || !((z / t) <= 2e-19)) {
		tmp = -(x * (z / t));
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z / t) <= -2e+220:
		tmp = z / (t / y)
	elif ((z / t) <= -2.0) or not ((z / t) <= 2e-19):
		tmp = -(x * (z / t))
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z / t) <= -2e+220)
		tmp = Float64(z / Float64(t / y));
	elseif ((Float64(z / t) <= -2.0) || !(Float64(z / t) <= 2e-19))
		tmp = Float64(-Float64(x * Float64(z / t)));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z / t) <= -2e+220)
		tmp = z / (t / y);
	elseif (((z / t) <= -2.0) || ~(((z / t) <= 2e-19)))
		tmp = -(x * (z / t));
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -2e+220], N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(z / t), $MachinePrecision], -2.0], N[Not[LessEqual[N[(z / t), $MachinePrecision], 2e-19]], $MachinePrecision]], (-N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]), x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+220}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\

\mathbf{elif}\;\frac{z}{t} \leq -2 \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-19}\right):\\
\;\;\;\;-x \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 z t) < -2e220

    1. Initial program 93.5%

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

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. clear-num83.2%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      2. un-div-inv83.2%

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    5. Applied egg-rr83.2%

      \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]

    if -2e220 < (/.f64 z t) < -2 or 2e-19 < (/.f64 z t)

    1. Initial program 98.1%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z}{t}\right)} \]
    4. Simplified62.0%

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

      \[\leadsto x \cdot \color{blue}{\left(-1 \cdot \frac{z}{t}\right)} \]
    6. Step-by-step derivation
      1. neg-mul-158.6%

        \[\leadsto x \cdot \color{blue}{\left(-\frac{z}{t}\right)} \]
      2. distribute-neg-frac58.6%

        \[\leadsto x \cdot \color{blue}{\frac{-z}{t}} \]
    7. Simplified58.6%

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

    if -2 < (/.f64 z t) < 2e-19

    1. Initial program 99.1%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification70.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{+220}:\\ \;\;\;\;\frac{z}{\frac{t}{y}}\\ \mathbf{elif}\;\frac{z}{t} \leq -2 \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-19}\right):\\ \;\;\;\;-x \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 3: 94.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-19}\right):\\ \;\;\;\;\frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= (/ z t) -2.0) (not (<= (/ z t) 2e-19)))
   (/ (* (- y x) z) t)
   (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((z / t) <= -2.0) || !((z / t) <= 2e-19)) {
		tmp = ((y - x) * z) / t;
	} else {
		tmp = x + (y * (z / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (((z / t) <= (-2.0d0)) .or. (.not. ((z / t) <= 2d-19))) then
        tmp = ((y - x) * z) / t
    else
        tmp = x + (y * (z / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (((z / t) <= -2.0) || !((z / t) <= 2e-19)) {
		tmp = ((y - x) * z) / t;
	} else {
		tmp = x + (y * (z / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((z / t) <= -2.0) or not ((z / t) <= 2e-19):
		tmp = ((y - x) * z) / t
	else:
		tmp = x + (y * (z / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((Float64(z / t) <= -2.0) || !(Float64(z / t) <= 2e-19))
		tmp = Float64(Float64(Float64(y - x) * z) / t);
	else
		tmp = Float64(x + Float64(y * Float64(z / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (((z / t) <= -2.0) || ~(((z / t) <= 2e-19)))
		tmp = ((y - x) * z) / t;
	else
		tmp = x + (y * (z / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z / t), $MachinePrecision], -2.0], N[Not[LessEqual[N[(z / t), $MachinePrecision], 2e-19]], $MachinePrecision]], N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -2 \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{\left(y - x\right) \cdot z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 z t) < -2 or 2e-19 < (/.f64 z t)

    1. Initial program 97.1%

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

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    3. Step-by-step derivation
      1. sub-div88.8%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
      2. *-commutative88.8%

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
      3. associate-*l/90.7%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t}} \]
    4. Applied egg-rr90.7%

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

    if -2 < (/.f64 z t) < 2e-19

    1. Initial program 99.1%

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

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    3. Step-by-step derivation
      1. associate-*r/99.1%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    4. Simplified99.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-19}\right):\\ \;\;\;\;\frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \end{array} \]

Alternative 4: 96.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-19}\right):\\ \;\;\;\;\frac{y - x}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= (/ z t) -2.0) (not (<= (/ z t) 2e-19)))
   (/ (- y x) (/ t z))
   (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((z / t) <= -2.0) || !((z / t) <= 2e-19)) {
		tmp = (y - x) / (t / z);
	} else {
		tmp = x + (y * (z / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (((z / t) <= (-2.0d0)) .or. (.not. ((z / t) <= 2d-19))) then
        tmp = (y - x) / (t / z)
    else
        tmp = x + (y * (z / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (((z / t) <= -2.0) || !((z / t) <= 2e-19)) {
		tmp = (y - x) / (t / z);
	} else {
		tmp = x + (y * (z / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((z / t) <= -2.0) or not ((z / t) <= 2e-19):
		tmp = (y - x) / (t / z)
	else:
		tmp = x + (y * (z / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((Float64(z / t) <= -2.0) || !(Float64(z / t) <= 2e-19))
		tmp = Float64(Float64(y - x) / Float64(t / z));
	else
		tmp = Float64(x + Float64(y * Float64(z / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (((z / t) <= -2.0) || ~(((z / t) <= 2e-19)))
		tmp = (y - x) / (t / z);
	else
		tmp = x + (y * (z / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z / t), $MachinePrecision], -2.0], N[Not[LessEqual[N[(z / t), $MachinePrecision], 2e-19]], $MachinePrecision]], N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -2 \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{y - x}{\frac{t}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 z t) < -2 or 2e-19 < (/.f64 z t)

    1. Initial program 97.1%

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

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    3. Step-by-step derivation
      1. sub-div88.8%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
      2. *-commutative88.8%

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
      3. associate-/r/94.4%

        \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
    4. Applied egg-rr94.4%

      \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}}} \]

    if -2 < (/.f64 z t) < 2e-19

    1. Initial program 99.1%

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

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    3. Step-by-step derivation
      1. associate-*r/99.1%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    4. Simplified99.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-19}\right):\\ \;\;\;\;\frac{y - x}{\frac{t}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \end{array} \]

Alternative 5: 65.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{-51} \lor \neg \left(\frac{z}{t} \leq 10^{-45}\right):\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= (/ z t) -2e-51) (not (<= (/ z t) 1e-45))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
	double tmp;
	if (((z / t) <= -2e-51) || !((z / t) <= 1e-45)) {
		tmp = y * (z / t);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (((z / t) <= (-2d-51)) .or. (.not. ((z / t) <= 1d-45))) then
        tmp = y * (z / t)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (((z / t) <= -2e-51) || !((z / t) <= 1e-45)) {
		tmp = y * (z / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if ((z / t) <= -2e-51) or not ((z / t) <= 1e-45):
		tmp = y * (z / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((Float64(z / t) <= -2e-51) || !(Float64(z / t) <= 1e-45))
		tmp = Float64(y * Float64(z / t));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (((z / t) <= -2e-51) || ~(((z / t) <= 1e-45)))
		tmp = y * (z / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z / t), $MachinePrecision], -2e-51], N[Not[LessEqual[N[(z / t), $MachinePrecision], 1e-45]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{-51} \lor \neg \left(\frac{z}{t} \leq 10^{-45}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 z t) < -2e-51 or 9.99999999999999984e-46 < (/.f64 z t)

    1. Initial program 97.4%

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

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. clear-num48.9%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      2. un-div-inv49.5%

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    5. Applied egg-rr49.5%

      \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    6. Taylor expanded in z around 0 51.9%

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. *-commutative51.9%

        \[\leadsto \frac{\color{blue}{z \cdot y}}{t} \]
      2. associate-*l/52.6%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
    8. Simplified52.6%

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

    if -2e-51 < (/.f64 z t) < 9.99999999999999984e-46

    1. Initial program 99.0%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{-51} \lor \neg \left(\frac{z}{t} \leq 10^{-45}\right):\\ \;\;\;\;y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 6: 65.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{-51}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\

\mathbf{elif}\;\frac{z}{t} \leq 10^{-45}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 z t) < -2e-51

    1. Initial program 97.7%

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

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. clear-num53.0%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      2. un-div-inv53.1%

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    5. Applied egg-rr53.1%

      \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    6. Taylor expanded in z around 0 56.3%

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. associate-/l*56.2%

        \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]
    8. Simplified56.2%

      \[\leadsto \color{blue}{\frac{y}{\frac{t}{z}}} \]

    if -2e-51 < (/.f64 z t) < 9.99999999999999984e-46

    1. Initial program 99.0%

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

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

    if 9.99999999999999984e-46 < (/.f64 z t)

    1. Initial program 97.0%

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

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. clear-num43.3%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      2. un-div-inv44.6%

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    5. Applied egg-rr44.6%

      \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    6. Taylor expanded in z around 0 45.9%

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. *-commutative45.9%

        \[\leadsto \frac{\color{blue}{z \cdot y}}{t} \]
      2. associate-*l/47.7%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
    8. Simplified47.7%

      \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{-51}:\\ \;\;\;\;\frac{y}{\frac{t}{z}}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{-45}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \end{array} \]

Alternative 7: 63.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{-51}:\\
\;\;\;\;\frac{y \cdot z}{t}\\

\mathbf{elif}\;\frac{z}{t} \leq 10^{-45}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 z t) < -2e-51

    1. Initial program 97.7%

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

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    3. Step-by-step derivation
      1. sub-div82.9%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
      2. *-commutative82.9%

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
      3. associate-*l/86.7%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t}} \]
    4. Applied egg-rr86.7%

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

      \[\leadsto \frac{\color{blue}{y \cdot z}}{t} \]
    6. Step-by-step derivation
      1. *-commutative56.3%

        \[\leadsto \frac{\color{blue}{z \cdot y}}{t} \]
    7. Simplified56.3%

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

    if -2e-51 < (/.f64 z t) < 9.99999999999999984e-46

    1. Initial program 99.0%

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

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

    if 9.99999999999999984e-46 < (/.f64 z t)

    1. Initial program 97.0%

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

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

      \[\leadsto z \cdot \color{blue}{\frac{y}{t}} \]
    4. Step-by-step derivation
      1. clear-num43.3%

        \[\leadsto z \cdot \color{blue}{\frac{1}{\frac{t}{y}}} \]
      2. un-div-inv44.6%

        \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    5. Applied egg-rr44.6%

      \[\leadsto \color{blue}{\frac{z}{\frac{t}{y}}} \]
    6. Taylor expanded in z around 0 45.9%

      \[\leadsto \color{blue}{\frac{y \cdot z}{t}} \]
    7. Step-by-step derivation
      1. *-commutative45.9%

        \[\leadsto \frac{\color{blue}{z \cdot y}}{t} \]
      2. associate-*l/47.7%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
    8. Simplified47.7%

      \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification64.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -2 \cdot 10^{-51}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \mathbf{elif}\;\frac{z}{t} \leq 10^{-45}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \end{array} \]

Alternative 8: 72.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{-208} \lor \neg \left(x \leq 4.25 \cdot 10^{-103}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -2.6e-208) (not (<= x 4.25e-103)))
   (* x (- 1.0 (/ z t)))
   (/ (* y z) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -2.6e-208) || !(x <= 4.25e-103)) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = (y * z) / t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((x <= (-2.6d-208)) .or. (.not. (x <= 4.25d-103))) then
        tmp = x * (1.0d0 - (z / t))
    else
        tmp = (y * z) / t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -2.6e-208) || !(x <= 4.25e-103)) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = (y * z) / t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -2.6e-208) or not (x <= 4.25e-103):
		tmp = x * (1.0 - (z / t))
	else:
		tmp = (y * z) / t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -2.6e-208) || !(x <= 4.25e-103))
		tmp = Float64(x * Float64(1.0 - Float64(z / t)));
	else
		tmp = Float64(Float64(y * z) / t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -2.6e-208) || ~((x <= 4.25e-103)))
		tmp = x * (1.0 - (z / t));
	else
		tmp = (y * z) / t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.6e-208], N[Not[LessEqual[x, 4.25e-103]], $MachinePrecision]], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-208} \lor \neg \left(x \leq 4.25 \cdot 10^{-103}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.60000000000000017e-208 or 4.25000000000000016e-103 < x

    1. Initial program 99.4%

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{z}{t}\right)}\right) \]
      2. unsub-neg80.7%

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z}{t}\right)} \]
    4. Simplified80.7%

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

    if -2.60000000000000017e-208 < x < 4.25000000000000016e-103

    1. Initial program 94.7%

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

      \[\leadsto \color{blue}{z \cdot \left(\frac{y}{t} - \frac{x}{t}\right)} \]
    3. Step-by-step derivation
      1. sub-div72.4%

        \[\leadsto z \cdot \color{blue}{\frac{y - x}{t}} \]
      2. *-commutative72.4%

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
      3. associate-*l/76.9%

        \[\leadsto \color{blue}{\frac{\left(y - x\right) \cdot z}{t}} \]
    4. Applied egg-rr76.9%

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

      \[\leadsto \frac{\color{blue}{y \cdot z}}{t} \]
    6. Step-by-step derivation
      1. *-commutative72.2%

        \[\leadsto \frac{\color{blue}{z \cdot y}}{t} \]
    7. Simplified72.2%

      \[\leadsto \frac{\color{blue}{z \cdot y}}{t} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{-208} \lor \neg \left(x \leq 4.25 \cdot 10^{-103}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot z}{t}\\ \end{array} \]

Alternative 9: 85.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{+25} \lor \neg \left(y \leq 9 \cdot 10^{-113}\right):\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -9.5e+25) (not (<= y 9e-113)))
   (+ x (* y (/ z t)))
   (* x (- 1.0 (/ z t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -9.5e+25) || !(y <= 9e-113)) {
		tmp = x + (y * (z / t));
	} else {
		tmp = x * (1.0 - (z / t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((y <= (-9.5d+25)) .or. (.not. (y <= 9d-113))) then
        tmp = x + (y * (z / t))
    else
        tmp = x * (1.0d0 - (z / t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -9.5e+25) || !(y <= 9e-113)) {
		tmp = x + (y * (z / t));
	} else {
		tmp = x * (1.0 - (z / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (y <= -9.5e+25) or not (y <= 9e-113):
		tmp = x + (y * (z / t))
	else:
		tmp = x * (1.0 - (z / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -9.5e+25) || !(y <= 9e-113))
		tmp = Float64(x + Float64(y * Float64(z / t)));
	else
		tmp = Float64(x * Float64(1.0 - Float64(z / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((y <= -9.5e+25) || ~((y <= 9e-113)))
		tmp = x + (y * (z / t));
	else
		tmp = x * (1.0 - (z / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9.5e+25], N[Not[LessEqual[y, 9e-113]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+25} \lor \neg \left(y \leq 9 \cdot 10^{-113}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.5000000000000005e25 or 9.0000000000000002e-113 < y

    1. Initial program 99.1%

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

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    3. Step-by-step derivation
      1. associate-*r/87.3%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    4. Simplified87.3%

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

    if -9.5000000000000005e25 < y < 9.0000000000000002e-113

    1. Initial program 96.8%

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z}{t}\right)} \]
    4. Simplified87.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{+25} \lor \neg \left(y \leq 9 \cdot 10^{-113}\right):\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \end{array} \]

Alternative 10: 85.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+27} \lor \neg \left(y \leq 6.4 \cdot 10^{-112}\right):\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{x}{\frac{t}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -1.6e+27) (not (<= y 6.4e-112)))
   (+ x (* y (/ z t)))
   (- x (/ x (/ t z)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -1.6e+27) || !(y <= 6.4e-112)) {
		tmp = x + (y * (z / t));
	} else {
		tmp = x - (x / (t / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((y <= (-1.6d+27)) .or. (.not. (y <= 6.4d-112))) then
        tmp = x + (y * (z / t))
    else
        tmp = x - (x / (t / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -1.6e+27) || !(y <= 6.4e-112)) {
		tmp = x + (y * (z / t));
	} else {
		tmp = x - (x / (t / z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (y <= -1.6e+27) or not (y <= 6.4e-112):
		tmp = x + (y * (z / t))
	else:
		tmp = x - (x / (t / z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -1.6e+27) || !(y <= 6.4e-112))
		tmp = Float64(x + Float64(y * Float64(z / t)));
	else
		tmp = Float64(x - Float64(x / Float64(t / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((y <= -1.6e+27) || ~((y <= 6.4e-112)))
		tmp = x + (y * (z / t));
	else
		tmp = x - (x / (t / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.6e+27], N[Not[LessEqual[y, 6.4e-112]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.6 \cdot 10^{+27} \lor \neg \left(y \leq 6.4 \cdot 10^{-112}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{x}{\frac{t}{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.60000000000000008e27 or 6.39999999999999986e-112 < y

    1. Initial program 99.1%

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

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    3. Step-by-step derivation
      1. associate-*r/87.3%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    4. Simplified87.3%

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

    if -1.60000000000000008e27 < y < 6.39999999999999986e-112

    1. Initial program 96.8%

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

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

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

        \[\leadsto x + \left(-\color{blue}{\frac{x}{\frac{t}{z}}}\right) \]
    4. Simplified87.6%

      \[\leadsto x + \color{blue}{\left(-\frac{x}{\frac{t}{z}}\right)} \]
    5. Step-by-step derivation
      1. unsub-neg87.6%

        \[\leadsto \color{blue}{x - \frac{x}{\frac{t}{z}}} \]
      2. div-inv87.4%

        \[\leadsto x - \color{blue}{x \cdot \frac{1}{\frac{t}{z}}} \]
      3. clear-num87.5%

        \[\leadsto x - x \cdot \color{blue}{\frac{z}{t}} \]
    6. Applied egg-rr87.5%

      \[\leadsto \color{blue}{x - x \cdot \frac{z}{t}} \]
    7. Step-by-step derivation
      1. clear-num87.4%

        \[\leadsto x - x \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      2. un-div-inv87.6%

        \[\leadsto x - \color{blue}{\frac{x}{\frac{t}{z}}} \]
    8. Applied egg-rr87.6%

      \[\leadsto x - \color{blue}{\frac{x}{\frac{t}{z}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+27} \lor \neg \left(y \leq 6.4 \cdot 10^{-112}\right):\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{x}{\frac{t}{z}}\\ \end{array} \]

Alternative 11: 55.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -9.6 \cdot 10^{-43} \lor \neg \left(z \leq 3.1 \cdot 10^{+15}\right):\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -9.6e-43) (not (<= z 3.1e+15))) (* z (/ y t)) x))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -9.6e-43) || !(z <= 3.1e+15)) {
		tmp = z * (y / t);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-9.6d-43)) .or. (.not. (z <= 3.1d+15))) then
        tmp = z * (y / t)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -9.6e-43) || !(z <= 3.1e+15)) {
		tmp = z * (y / t);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -9.6e-43) or not (z <= 3.1e+15):
		tmp = z * (y / t)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -9.6e-43) || !(z <= 3.1e+15))
		tmp = Float64(z * Float64(y / t));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -9.6e-43) || ~((z <= 3.1e+15)))
		tmp = z * (y / t);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9.6e-43], N[Not[LessEqual[z, 3.1e+15]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{-43} \lor \neg \left(z \leq 3.1 \cdot 10^{+15}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.6000000000000007e-43 or 3.1e15 < z

    1. Initial program 97.0%

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

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

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

    if -9.6000000000000007e-43 < z < 3.1e15

    1. Initial program 99.2%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.6 \cdot 10^{-43} \lor \neg \left(z \leq 3.1 \cdot 10^{+15}\right):\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 12: 97.4% accurate, 1.0× speedup?

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

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

    \[x + \left(y - x\right) \cdot \frac{z}{t} \]
  2. Final simplification98.0%

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

Alternative 13: 38.9% accurate, 9.0× speedup?

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

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

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification38.0%

    \[\leadsto x \]

Developer target: 97.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - x\right) \cdot \frac{z}{t}\\ t_2 := x + \frac{y - x}{\frac{t}{z}}\\ \mathbf{if}\;t_1 < -1013646692435.8867:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_1 < 0:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- y x) (/ z t))) (t_2 (+ x (/ (- y x) (/ t z)))))
   (if (< t_1 -1013646692435.8867)
     t_2
     (if (< t_1 0.0) (+ x (/ (* (- y x) z) t)) t_2))))
double code(double x, double y, double z, double t) {
	double t_1 = (y - x) * (z / t);
	double t_2 = x + ((y - x) / (t / z));
	double tmp;
	if (t_1 < -1013646692435.8867) {
		tmp = t_2;
	} else if (t_1 < 0.0) {
		tmp = x + (((y - x) * z) / t);
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (y - x) * (z / t)
    t_2 = x + ((y - x) / (t / z))
    if (t_1 < (-1013646692435.8867d0)) then
        tmp = t_2
    else if (t_1 < 0.0d0) then
        tmp = x + (((y - x) * z) / t)
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (y - x) * (z / t);
	double t_2 = x + ((y - x) / (t / z));
	double tmp;
	if (t_1 < -1013646692435.8867) {
		tmp = t_2;
	} else if (t_1 < 0.0) {
		tmp = x + (((y - x) * z) / t);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y - x) * (z / t)
	t_2 = x + ((y - x) / (t / z))
	tmp = 0
	if t_1 < -1013646692435.8867:
		tmp = t_2
	elif t_1 < 0.0:
		tmp = x + (((y - x) * z) / t)
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y - x) * Float64(z / t))
	t_2 = Float64(x + Float64(Float64(y - x) / Float64(t / z)))
	tmp = 0.0
	if (t_1 < -1013646692435.8867)
		tmp = t_2;
	elseif (t_1 < 0.0)
		tmp = Float64(x + Float64(Float64(Float64(y - x) * z) / t));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (y - x) * (z / t);
	t_2 = x + ((y - x) / (t / z));
	tmp = 0.0;
	if (t_1 < -1013646692435.8867)
		tmp = t_2;
	elseif (t_1 < 0.0)
		tmp = x + (((y - x) * z) / t);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t$95$1, -1013646692435.8867], t$95$2, If[Less[t$95$1, 0.0], N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(y - x\right) \cdot \frac{z}{t}\\
t_2 := x + \frac{y - x}{\frac{t}{z}}\\
\mathbf{if}\;t_1 < -1013646692435.8867:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t_1 < 0:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023318 
(FPCore (x y z t)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4"
  :precision binary64

  :herbie-target
  (if (< (* (- y x) (/ z t)) -1013646692435.8867) (+ x (/ (- y x) (/ t z))) (if (< (* (- y x) (/ z t)) 0.0) (+ x (/ (* (- y x) z) t)) (+ x (/ (- y x) (/ t z)))))

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