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

Percentage Accurate: 97.8% → 98.3%
Time: 6.2s
Alternatives: 10
Speedup: 0.7×

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 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: 97.8% 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: 98.3% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 99.0%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Step-by-step derivation
      1. +-commutative99.0%

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

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

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

    if 4.99999999999999981e134 < (/.f64 z t)

    1. Initial program 87.4%

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      2. associate-/r/99.9%

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
    5. Applied egg-rr99.9%

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

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

Alternative 2: 63.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z}{t} \cdot y\\ \mathbf{if}\;\frac{z}{t} \leq -1 \cdot 10^{-70}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-17}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+59}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+135} \lor \neg \left(\frac{z}{t} \leq 5 \cdot 10^{+184}\right):\\ \;\;\;\;\frac{z}{t} \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ z t) y)))
   (if (<= (/ z t) -1e-70)
     t_1
     (if (<= (/ z t) 2e-17)
       x
       (if (<= (/ z t) 5e+59)
         t_1
         (if (or (<= (/ z t) 5e+135) (not (<= (/ z t) 5e+184)))
           (* (/ z t) (- x))
           (* z (/ y t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (z / t) * y;
	double tmp;
	if ((z / t) <= -1e-70) {
		tmp = t_1;
	} else if ((z / t) <= 2e-17) {
		tmp = x;
	} else if ((z / t) <= 5e+59) {
		tmp = t_1;
	} else if (((z / t) <= 5e+135) || !((z / t) <= 5e+184)) {
		tmp = (z / t) * -x;
	} else {
		tmp = z * (y / 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) :: t_1
    real(8) :: tmp
    t_1 = (z / t) * y
    if ((z / t) <= (-1d-70)) then
        tmp = t_1
    else if ((z / t) <= 2d-17) then
        tmp = x
    else if ((z / t) <= 5d+59) then
        tmp = t_1
    else if (((z / t) <= 5d+135) .or. (.not. ((z / t) <= 5d+184))) then
        tmp = (z / t) * -x
    else
        tmp = z * (y / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (z / t) * y;
	double tmp;
	if ((z / t) <= -1e-70) {
		tmp = t_1;
	} else if ((z / t) <= 2e-17) {
		tmp = x;
	} else if ((z / t) <= 5e+59) {
		tmp = t_1;
	} else if (((z / t) <= 5e+135) || !((z / t) <= 5e+184)) {
		tmp = (z / t) * -x;
	} else {
		tmp = z * (y / t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (z / t) * y
	tmp = 0
	if (z / t) <= -1e-70:
		tmp = t_1
	elif (z / t) <= 2e-17:
		tmp = x
	elif (z / t) <= 5e+59:
		tmp = t_1
	elif ((z / t) <= 5e+135) or not ((z / t) <= 5e+184):
		tmp = (z / t) * -x
	else:
		tmp = z * (y / t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(z / t) * y)
	tmp = 0.0
	if (Float64(z / t) <= -1e-70)
		tmp = t_1;
	elseif (Float64(z / t) <= 2e-17)
		tmp = x;
	elseif (Float64(z / t) <= 5e+59)
		tmp = t_1;
	elseif ((Float64(z / t) <= 5e+135) || !(Float64(z / t) <= 5e+184))
		tmp = Float64(Float64(z / t) * Float64(-x));
	else
		tmp = Float64(z * Float64(y / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (z / t) * y;
	tmp = 0.0;
	if ((z / t) <= -1e-70)
		tmp = t_1;
	elseif ((z / t) <= 2e-17)
		tmp = x;
	elseif ((z / t) <= 5e+59)
		tmp = t_1;
	elseif (((z / t) <= 5e+135) || ~(((z / t) <= 5e+184)))
		tmp = (z / t) * -x;
	else
		tmp = z * (y / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[N[(z / t), $MachinePrecision], -1e-70], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], 2e-17], x, If[LessEqual[N[(z / t), $MachinePrecision], 5e+59], t$95$1, If[Or[LessEqual[N[(z / t), $MachinePrecision], 5e+135], N[Not[LessEqual[N[(z / t), $MachinePrecision], 5e+184]], $MachinePrecision]], N[(N[(z / t), $MachinePrecision] * (-x)), $MachinePrecision], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{z}{t} \cdot y\\
\mathbf{if}\;\frac{z}{t} \leq -1 \cdot 10^{-70}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-17}:\\
\;\;\;\;x\\

\mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+59}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+135} \lor \neg \left(\frac{z}{t} \leq 5 \cdot 10^{+184}\right):\\
\;\;\;\;\frac{z}{t} \cdot \left(-x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 z t) < -9.99999999999999996e-71 or 2.00000000000000014e-17 < (/.f64 z t) < 4.9999999999999997e59

    1. Initial program 98.7%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Step-by-step derivation
      1. +-commutative98.7%

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

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

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

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

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

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

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

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

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

    if -9.99999999999999996e-71 < (/.f64 z t) < 2.00000000000000014e-17

    1. Initial program 99.1%

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

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

    if 4.9999999999999997e59 < (/.f64 z t) < 5.00000000000000029e135 or 4.9999999999999999e184 < (/.f64 z t)

    1. Initial program 89.6%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z}{t}\right)} \]
      4. distribute-lft-out--67.3%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \frac{z}{t}} \]
      5. *-rgt-identity67.3%

        \[\leadsto \color{blue}{x} - x \cdot \frac{z}{t} \]
    4. Simplified67.3%

      \[\leadsto \color{blue}{x - x \cdot \frac{z}{t}} \]
    5. Taylor expanded in x around 0 67.3%

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{z}{t} \cdot x\right)} \]
      2. associate-*r*67.3%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{z}{t}\right) \cdot x} \]
      3. mul-1-neg67.3%

        \[\leadsto \color{blue}{\left(-\frac{z}{t}\right)} \cdot x \]
      4. distribute-frac-neg67.3%

        \[\leadsto \color{blue}{\frac{-z}{t}} \cdot x \]
      5. *-commutative67.3%

        \[\leadsto \color{blue}{x \cdot \frac{-z}{t}} \]
    8. Simplified67.3%

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

    if 5.00000000000000029e135 < (/.f64 z t) < 4.9999999999999999e184

    1. Initial program 99.5%

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      2. associate-/r/100.0%

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
    5. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
    6. Taylor expanded in y around inf 100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -1 \cdot 10^{-70}:\\ \;\;\;\;\frac{z}{t} \cdot y\\ \mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-17}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+59}:\\ \;\;\;\;\frac{z}{t} \cdot y\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+135} \lor \neg \left(\frac{z}{t} \leq 5 \cdot 10^{+184}\right):\\ \;\;\;\;\frac{z}{t} \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \end{array} \]

Alternative 3: 63.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{z}{t} \cdot y\\ \mathbf{if}\;\frac{z}{t} \leq -1 \cdot 10^{-70}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-17}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+59}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+135}:\\ \;\;\;\;\frac{z}{t} \cdot \left(-x\right)\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+184}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) \cdot \frac{x}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (/ z t) y)))
   (if (<= (/ z t) -1e-70)
     t_1
     (if (<= (/ z t) 2e-17)
       x
       (if (<= (/ z t) 5e+59)
         t_1
         (if (<= (/ z t) 5e+135)
           (* (/ z t) (- x))
           (if (<= (/ z t) 5e+184) (* z (/ y t)) (* (- z) (/ x t)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = (z / t) * y;
	double tmp;
	if ((z / t) <= -1e-70) {
		tmp = t_1;
	} else if ((z / t) <= 2e-17) {
		tmp = x;
	} else if ((z / t) <= 5e+59) {
		tmp = t_1;
	} else if ((z / t) <= 5e+135) {
		tmp = (z / t) * -x;
	} else if ((z / t) <= 5e+184) {
		tmp = z * (y / t);
	} else {
		tmp = -z * (x / 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) :: t_1
    real(8) :: tmp
    t_1 = (z / t) * y
    if ((z / t) <= (-1d-70)) then
        tmp = t_1
    else if ((z / t) <= 2d-17) then
        tmp = x
    else if ((z / t) <= 5d+59) then
        tmp = t_1
    else if ((z / t) <= 5d+135) then
        tmp = (z / t) * -x
    else if ((z / t) <= 5d+184) then
        tmp = z * (y / t)
    else
        tmp = -z * (x / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = (z / t) * y;
	double tmp;
	if ((z / t) <= -1e-70) {
		tmp = t_1;
	} else if ((z / t) <= 2e-17) {
		tmp = x;
	} else if ((z / t) <= 5e+59) {
		tmp = t_1;
	} else if ((z / t) <= 5e+135) {
		tmp = (z / t) * -x;
	} else if ((z / t) <= 5e+184) {
		tmp = z * (y / t);
	} else {
		tmp = -z * (x / t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (z / t) * y
	tmp = 0
	if (z / t) <= -1e-70:
		tmp = t_1
	elif (z / t) <= 2e-17:
		tmp = x
	elif (z / t) <= 5e+59:
		tmp = t_1
	elif (z / t) <= 5e+135:
		tmp = (z / t) * -x
	elif (z / t) <= 5e+184:
		tmp = z * (y / t)
	else:
		tmp = -z * (x / t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(z / t) * y)
	tmp = 0.0
	if (Float64(z / t) <= -1e-70)
		tmp = t_1;
	elseif (Float64(z / t) <= 2e-17)
		tmp = x;
	elseif (Float64(z / t) <= 5e+59)
		tmp = t_1;
	elseif (Float64(z / t) <= 5e+135)
		tmp = Float64(Float64(z / t) * Float64(-x));
	elseif (Float64(z / t) <= 5e+184)
		tmp = Float64(z * Float64(y / t));
	else
		tmp = Float64(Float64(-z) * Float64(x / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = (z / t) * y;
	tmp = 0.0;
	if ((z / t) <= -1e-70)
		tmp = t_1;
	elseif ((z / t) <= 2e-17)
		tmp = x;
	elseif ((z / t) <= 5e+59)
		tmp = t_1;
	elseif ((z / t) <= 5e+135)
		tmp = (z / t) * -x;
	elseif ((z / t) <= 5e+184)
		tmp = z * (y / t);
	else
		tmp = -z * (x / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[N[(z / t), $MachinePrecision], -1e-70], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], 2e-17], x, If[LessEqual[N[(z / t), $MachinePrecision], 5e+59], t$95$1, If[LessEqual[N[(z / t), $MachinePrecision], 5e+135], N[(N[(z / t), $MachinePrecision] * (-x)), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 5e+184], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], N[((-z) * N[(x / t), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{z}{t} \cdot y\\
\mathbf{if}\;\frac{z}{t} \leq -1 \cdot 10^{-70}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-17}:\\
\;\;\;\;x\\

\mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+59}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+135}:\\
\;\;\;\;\frac{z}{t} \cdot \left(-x\right)\\

\mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+184}:\\
\;\;\;\;z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (/.f64 z t) < -9.99999999999999996e-71 or 2.00000000000000014e-17 < (/.f64 z t) < 4.9999999999999997e59

    1. Initial program 98.7%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Step-by-step derivation
      1. +-commutative98.7%

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

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

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

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

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

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

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

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

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

    if -9.99999999999999996e-71 < (/.f64 z t) < 2.00000000000000014e-17

    1. Initial program 99.1%

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

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

    if 4.9999999999999997e59 < (/.f64 z t) < 5.00000000000000029e135

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z}{t}\right)} \]
      4. distribute-lft-out--63.1%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \frac{z}{t}} \]
      5. *-rgt-identity63.1%

        \[\leadsto \color{blue}{x} - x \cdot \frac{z}{t} \]
    4. Simplified63.1%

      \[\leadsto \color{blue}{x - x \cdot \frac{z}{t}} \]
    5. Taylor expanded in x around 0 63.1%

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(\frac{z}{t} \cdot x\right)} \]
      2. associate-*r*63.1%

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{z}{t}\right) \cdot x} \]
      3. mul-1-neg63.1%

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

        \[\leadsto \color{blue}{\frac{-z}{t}} \cdot x \]
      5. *-commutative63.1%

        \[\leadsto \color{blue}{x \cdot \frac{-z}{t}} \]
    8. Simplified63.1%

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

    if 5.00000000000000029e135 < (/.f64 z t) < 4.9999999999999999e184

    1. Initial program 99.5%

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      2. associate-/r/100.0%

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
    5. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
    6. Taylor expanded in y around inf 100.0%

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

    if 4.9999999999999999e184 < (/.f64 z t)

    1. Initial program 85.1%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z}{t}\right)} \]
      4. distribute-lft-out--69.1%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \frac{z}{t}} \]
      5. *-rgt-identity69.1%

        \[\leadsto \color{blue}{x} - x \cdot \frac{z}{t} \]
    4. Simplified69.1%

      \[\leadsto \color{blue}{x - x \cdot \frac{z}{t}} \]
    5. Taylor expanded in x around 0 69.1%

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

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

        \[\leadsto -1 \cdot \color{blue}{\left(z \cdot \frac{x}{t}\right)} \]
      2. neg-mul-171.3%

        \[\leadsto \color{blue}{-z \cdot \frac{x}{t}} \]
      3. distribute-lft-neg-in71.3%

        \[\leadsto \color{blue}{\left(-z\right) \cdot \frac{x}{t}} \]
      4. *-commutative71.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -1 \cdot 10^{-70}:\\ \;\;\;\;\frac{z}{t} \cdot y\\ \mathbf{elif}\;\frac{z}{t} \leq 2 \cdot 10^{-17}:\\ \;\;\;\;x\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+59}:\\ \;\;\;\;\frac{z}{t} \cdot y\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+135}:\\ \;\;\;\;\frac{z}{t} \cdot \left(-x\right)\\ \mathbf{elif}\;\frac{z}{t} \leq 5 \cdot 10^{+184}:\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) \cdot \frac{x}{t}\\ \end{array} \]

Alternative 4: 85.4% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 95.4%

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

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

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

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot \frac{1}{t}} \]
      2. *-commutative87.8%

        \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot \frac{1}{t} \]
      3. associate-*r*89.4%

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

        \[\leadsto z \cdot \color{blue}{\left(\frac{1}{t} \cdot \left(y - x\right)\right)} \]
      5. associate-*r*91.7%

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

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

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

    if -9.99999999999999996e-71 < (/.f64 z t) < 2.00000000000000014e-17

    1. Initial program 99.1%

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

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

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

Alternative 5: 84.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -1 \cdot 10^{-70}:\\ \;\;\;\;\frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{elif}\;\frac{z}{t} \leq 1000000:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ z t) -1e-70)
   (* (/ z t) (- y x))
   (if (<= (/ z t) 1000000.0) (* x (- 1.0 (/ z t))) (* z (/ (- y x) t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -1e-70) {
		tmp = (z / t) * (y - x);
	} else if ((z / t) <= 1000000.0) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = z * ((y - x) / 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) <= (-1d-70)) then
        tmp = (z / t) * (y - x)
    else if ((z / t) <= 1000000.0d0) then
        tmp = x * (1.0d0 - (z / t))
    else
        tmp = z * ((y - x) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -1e-70) {
		tmp = (z / t) * (y - x);
	} else if ((z / t) <= 1000000.0) {
		tmp = x * (1.0 - (z / t));
	} else {
		tmp = z * ((y - x) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z / t) <= -1e-70:
		tmp = (z / t) * (y - x)
	elif (z / t) <= 1000000.0:
		tmp = x * (1.0 - (z / t))
	else:
		tmp = z * ((y - x) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z / t) <= -1e-70)
		tmp = Float64(Float64(z / t) * Float64(y - x));
	elseif (Float64(z / t) <= 1000000.0)
		tmp = Float64(x * Float64(1.0 - Float64(z / t)));
	else
		tmp = Float64(z * Float64(Float64(y - x) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z / t) <= -1e-70)
		tmp = (z / t) * (y - x);
	elseif ((z / t) <= 1000000.0)
		tmp = x * (1.0 - (z / t));
	else
		tmp = z * ((y - x) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -1e-70], N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 1000000.0], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 98.4%

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

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

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

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot \frac{1}{t}} \]
      2. *-commutative85.5%

        \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot \frac{1}{t} \]
      3. associate-*r*85.4%

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

        \[\leadsto z \cdot \color{blue}{\left(\frac{1}{t} \cdot \left(y - x\right)\right)} \]
      5. associate-*r*92.7%

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

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

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

    if -9.99999999999999996e-71 < (/.f64 z t) < 1e6

    1. Initial program 99.1%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z}{t}\right)} \]
      4. distribute-lft-out--79.3%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \frac{z}{t}} \]
      5. *-rgt-identity79.3%

        \[\leadsto \color{blue}{x} - x \cdot \frac{z}{t} \]
    4. Simplified79.3%

      \[\leadsto \color{blue}{x - x \cdot \frac{z}{t}} \]
    5. Taylor expanded in x around 0 79.3%

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

    if 1e6 < (/.f64 z t)

    1. Initial program 92.5%

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      2. associate-/r/95.7%

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
    5. Applied egg-rr95.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -1 \cdot 10^{-70}:\\ \;\;\;\;\frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{elif}\;\frac{z}{t} \leq 1000000:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \end{array} \]

Alternative 6: 95.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -4 \cdot 10^{+24}:\\ \;\;\;\;\frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{elif}\;\frac{z}{t} \leq 1:\\ \;\;\;\;x + \frac{z}{t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ z t) -4e+24)
   (* (/ z t) (- y x))
   (if (<= (/ z t) 1.0) (+ x (* (/ z t) y)) (* z (/ (- y x) t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -4e+24) {
		tmp = (z / t) * (y - x);
	} else if ((z / t) <= 1.0) {
		tmp = x + ((z / t) * y);
	} else {
		tmp = z * ((y - x) / 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) <= (-4d+24)) then
        tmp = (z / t) * (y - x)
    else if ((z / t) <= 1.0d0) then
        tmp = x + ((z / t) * y)
    else
        tmp = z * ((y - x) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= -4e+24) {
		tmp = (z / t) * (y - x);
	} else if ((z / t) <= 1.0) {
		tmp = x + ((z / t) * y);
	} else {
		tmp = z * ((y - x) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z / t) <= -4e+24:
		tmp = (z / t) * (y - x)
	elif (z / t) <= 1.0:
		tmp = x + ((z / t) * y)
	else:
		tmp = z * ((y - x) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z / t) <= -4e+24)
		tmp = Float64(Float64(z / t) * Float64(y - x));
	elseif (Float64(z / t) <= 1.0)
		tmp = Float64(x + Float64(Float64(z / t) * y));
	else
		tmp = Float64(z * Float64(Float64(y - x) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z / t) <= -4e+24)
		tmp = (z / t) * (y - x);
	elseif ((z / t) <= 1.0)
		tmp = x + ((z / t) * y);
	else
		tmp = z * ((y - x) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], -4e+24], N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z / t), $MachinePrecision], 1.0], N[(x + N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -4 \cdot 10^{+24}:\\
\;\;\;\;\frac{z}{t} \cdot \left(y - x\right)\\

\mathbf{elif}\;\frac{z}{t} \leq 1:\\
\;\;\;\;x + \frac{z}{t} \cdot y\\

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


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

    1. Initial program 98.0%

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

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

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

        \[\leadsto \color{blue}{\left(\left(y - x\right) \cdot z\right) \cdot \frac{1}{t}} \]
      2. *-commutative94.3%

        \[\leadsto \color{blue}{\left(z \cdot \left(y - x\right)\right)} \cdot \frac{1}{t} \]
      3. associate-*r*94.1%

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

        \[\leadsto z \cdot \color{blue}{\left(\frac{1}{t} \cdot \left(y - x\right)\right)} \]
      5. associate-*r*97.9%

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

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

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

    if -3.9999999999999999e24 < (/.f64 z t) < 1

    1. Initial program 99.2%

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

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

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

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

    if 1 < (/.f64 z t)

    1. Initial program 92.6%

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      2. associate-/r/95.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq -4 \cdot 10^{+24}:\\ \;\;\;\;\frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{elif}\;\frac{z}{t} \leq 1:\\ \;\;\;\;x + \frac{z}{t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \end{array} \]

Alternative 7: 63.6% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 95.4%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Step-by-step derivation
      1. +-commutative95.4%

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

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

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

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

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

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

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

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

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

    if -9.99999999999999996e-71 < (/.f64 z t) < 2.00000000000000014e-17

    1. Initial program 99.1%

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

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

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

Alternative 8: 98.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{z}{t} \leq 5 \cdot 10^{+134}:\\ \;\;\;\;x + \frac{z}{t} \cdot \left(y - x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y - x}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (/ z t) 5e+134) (+ x (* (/ z t) (- y x))) (* z (/ (- y x) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= 5e+134) {
		tmp = x + ((z / t) * (y - x));
	} else {
		tmp = z * ((y - x) / 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) <= 5d+134) then
        tmp = x + ((z / t) * (y - x))
    else
        tmp = z * ((y - x) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z / t) <= 5e+134) {
		tmp = x + ((z / t) * (y - x));
	} else {
		tmp = z * ((y - x) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z / t) <= 5e+134:
		tmp = x + ((z / t) * (y - x))
	else:
		tmp = z * ((y - x) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(z / t) <= 5e+134)
		tmp = Float64(x + Float64(Float64(z / t) * Float64(y - x)));
	else
		tmp = Float64(z * Float64(Float64(y - x) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z / t) <= 5e+134)
		tmp = x + ((z / t) * (y - x));
	else
		tmp = z * ((y - x) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(z / t), $MachinePrecision], 5e+134], N[(x + N[(N[(z / t), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq 5 \cdot 10^{+134}:\\
\;\;\;\;x + \frac{z}{t} \cdot \left(y - x\right)\\

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


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

    1. Initial program 99.0%

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

    if 4.99999999999999981e134 < (/.f64 z t)

    1. Initial program 87.4%

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

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

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

        \[\leadsto \color{blue}{\frac{y - x}{\frac{t}{z}}} \]
      2. associate-/r/99.9%

        \[\leadsto \color{blue}{\frac{y - x}{t} \cdot z} \]
    5. Applied egg-rr99.9%

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

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

Alternative 9: 71.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-16} \lor \neg \left(y \leq 1.9 \cdot 10^{-19}\right):\\ \;\;\;\;\frac{z}{t} \cdot y\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -2.6e-16) (not (<= y 1.9e-19)))
   (* (/ z t) y)
   (* x (- 1.0 (/ z t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -2.6e-16) || !(y <= 1.9e-19)) {
		tmp = (z / t) * y;
	} 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 <= (-2.6d-16)) .or. (.not. (y <= 1.9d-19))) then
        tmp = (z / t) * y
    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 <= -2.6e-16) || !(y <= 1.9e-19)) {
		tmp = (z / t) * y;
	} else {
		tmp = x * (1.0 - (z / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (y <= -2.6e-16) or not (y <= 1.9e-19):
		tmp = (z / t) * y
	else:
		tmp = x * (1.0 - (z / t))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -2.6e-16) || !(y <= 1.9e-19))
		tmp = Float64(Float64(z / t) * y);
	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 <= -2.6e-16) || ~((y <= 1.9e-19)))
		tmp = (z / t) * y;
	else
		tmp = x * (1.0 - (z / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2.6e-16], N[Not[LessEqual[y, 1.9e-19]], $MachinePrecision]], N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.5999999999999998e-16 or 1.9e-19 < y

    1. Initial program 99.1%

      \[x + \left(y - x\right) \cdot \frac{z}{t} \]
    2. Step-by-step derivation
      1. +-commutative99.1%

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

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

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

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

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

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

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

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

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

    if -2.5999999999999998e-16 < y < 1.9e-19

    1. Initial program 94.9%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \frac{z}{t}\right)} \]
      4. distribute-lft-out--85.3%

        \[\leadsto \color{blue}{x \cdot 1 - x \cdot \frac{z}{t}} \]
      5. *-rgt-identity85.3%

        \[\leadsto \color{blue}{x} - x \cdot \frac{z}{t} \]
    4. Simplified85.3%

      \[\leadsto \color{blue}{x - x \cdot \frac{z}{t}} \]
    5. Taylor expanded in x around 0 85.3%

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

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

Alternative 10: 37.5% 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 97.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.5% 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 2023230 
(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))))