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

Percentage Accurate: 97.8% → 97.8%
Time: 7.1s
Alternatives: 10
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 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: 97.8% accurate, 0.1× speedup?

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

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

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

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

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

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

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

Alternative 2: 85.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{-111} \lor \neg \left(y \leq 2.5 \cdot 10^{-36} \lor \neg \left(y \leq 1.15 \cdot 10^{-19}\right) \land y \leq 1.7 \cdot 10^{+58}\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 -2.7e-111)
         (not (or (<= y 2.5e-36) (and (not (<= y 1.15e-19)) (<= y 1.7e+58)))))
   (+ x (* y (/ z t)))
   (* x (- 1.0 (/ z t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -2.7e-111) || !((y <= 2.5e-36) || (!(y <= 1.15e-19) && (y <= 1.7e+58)))) {
		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 <= (-2.7d-111)) .or. (.not. (y <= 2.5d-36) .or. (.not. (y <= 1.15d-19)) .and. (y <= 1.7d+58))) 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 <= -2.7e-111) || !((y <= 2.5e-36) || (!(y <= 1.15e-19) && (y <= 1.7e+58)))) {
		tmp = x + (y * (z / t));
	} else {
		tmp = x * (1.0 - (z / t));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (y <= -2.7e-111) or not ((y <= 2.5e-36) or (not (y <= 1.15e-19) and (y <= 1.7e+58))):
		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 <= -2.7e-111) || !((y <= 2.5e-36) || (!(y <= 1.15e-19) && (y <= 1.7e+58))))
		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 <= -2.7e-111) || ~(((y <= 2.5e-36) || (~((y <= 1.15e-19)) && (y <= 1.7e+58)))))
		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, -2.7e-111], N[Not[Or[LessEqual[y, 2.5e-36], And[N[Not[LessEqual[y, 1.15e-19]], $MachinePrecision], LessEqual[y, 1.7e+58]]]], $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 -2.7 \cdot 10^{-111} \lor \neg \left(y \leq 2.5 \cdot 10^{-36} \lor \neg \left(y \leq 1.15 \cdot 10^{-19}\right) \land y \leq 1.7 \cdot 10^{+58}\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 < -2.69999999999999989e-111 or 2.50000000000000002e-36 < y < 1.1499999999999999e-19 or 1.7e58 < y

    1. Initial program 96.7%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    5. Simplified89.7%

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

    if -2.69999999999999989e-111 < y < 2.50000000000000002e-36 or 1.1499999999999999e-19 < y < 1.7e58

    1. Initial program 98.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{-111} \lor \neg \left(y \leq 2.5 \cdot 10^{-36} \lor \neg \left(y \leq 1.15 \cdot 10^{-19}\right) \land y \leq 1.7 \cdot 10^{+58}\right):\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 84.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{z}{t}\right)\\ t_2 := x + z \cdot \frac{y}{t}\\ \mathbf{if}\;y \leq -2.3 \cdot 10^{-111}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-36}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-19}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{+54}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 (/ z t)))) (t_2 (+ x (* z (/ y t)))))
   (if (<= y -2.3e-111)
     t_2
     (if (<= y 1.7e-36)
       t_1
       (if (<= y 1.65e-19) t_2 (if (<= y 4.3e+54) t_1 (+ x (* y (/ z t)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - (z / t));
	double t_2 = x + (z * (y / t));
	double tmp;
	if (y <= -2.3e-111) {
		tmp = t_2;
	} else if (y <= 1.7e-36) {
		tmp = t_1;
	} else if (y <= 1.65e-19) {
		tmp = t_2;
	} else if (y <= 4.3e+54) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * (1.0d0 - (z / t))
    t_2 = x + (z * (y / t))
    if (y <= (-2.3d-111)) then
        tmp = t_2
    else if (y <= 1.7d-36) then
        tmp = t_1
    else if (y <= 1.65d-19) then
        tmp = t_2
    else if (y <= 4.3d+54) then
        tmp = t_1
    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 t_1 = x * (1.0 - (z / t));
	double t_2 = x + (z * (y / t));
	double tmp;
	if (y <= -2.3e-111) {
		tmp = t_2;
	} else if (y <= 1.7e-36) {
		tmp = t_1;
	} else if (y <= 1.65e-19) {
		tmp = t_2;
	} else if (y <= 4.3e+54) {
		tmp = t_1;
	} else {
		tmp = x + (y * (z / t));
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - (z / t))
	t_2 = x + (z * (y / t))
	tmp = 0
	if y <= -2.3e-111:
		tmp = t_2
	elif y <= 1.7e-36:
		tmp = t_1
	elif y <= 1.65e-19:
		tmp = t_2
	elif y <= 4.3e+54:
		tmp = t_1
	else:
		tmp = x + (y * (z / t))
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - Float64(z / t)))
	t_2 = Float64(x + Float64(z * Float64(y / t)))
	tmp = 0.0
	if (y <= -2.3e-111)
		tmp = t_2;
	elseif (y <= 1.7e-36)
		tmp = t_1;
	elseif (y <= 1.65e-19)
		tmp = t_2;
	elseif (y <= 4.3e+54)
		tmp = t_1;
	else
		tmp = Float64(x + Float64(y * Float64(z / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - (z / t));
	t_2 = x + (z * (y / t));
	tmp = 0.0;
	if (y <= -2.3e-111)
		tmp = t_2;
	elseif (y <= 1.7e-36)
		tmp = t_1;
	elseif (y <= 1.65e-19)
		tmp = t_2;
	elseif (y <= 4.3e+54)
		tmp = t_1;
	else
		tmp = x + (y * (z / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.3e-111], t$95$2, If[LessEqual[y, 1.7e-36], t$95$1, If[LessEqual[y, 1.65e-19], t$95$2, If[LessEqual[y, 4.3e+54], t$95$1, N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{z}{t}\right)\\
t_2 := x + z \cdot \frac{y}{t}\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{-111}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 1.7 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.65 \cdot 10^{-19}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 4.3 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.3e-111 or 1.7000000000000001e-36 < y < 1.6499999999999999e-19

    1. Initial program 96.1%

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

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    4. Step-by-step derivation
      1. *-commutative87.1%

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

        \[\leadsto x + \color{blue}{z \cdot \frac{y}{t}} \]
    5. Simplified91.0%

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

    if -2.3e-111 < y < 1.7000000000000001e-36 or 1.6499999999999999e-19 < y < 4.29999999999999976e54

    1. Initial program 98.3%

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

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

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

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

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

    if 4.29999999999999976e54 < y

    1. Initial program 97.9%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    5. Simplified90.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{-111}:\\ \;\;\;\;x + z \cdot \frac{y}{t}\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{elif}\;y \leq 1.65 \cdot 10^{-19}:\\ \;\;\;\;x + z \cdot \frac{y}{t}\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{+54}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 84.6% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{z}{t}\right)\\
t_2 := x + z \cdot \frac{y}{t}\\
\mathbf{if}\;y \leq -2 \cdot 10^{-111}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 1.4 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 7.2 \cdot 10^{-20}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.00000000000000018e-111 or 1.4000000000000001e-36 < y < 7.19999999999999948e-20

    1. Initial program 96.1%

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

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{t}} \]
    4. Step-by-step derivation
      1. *-commutative87.1%

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

        \[\leadsto x + \color{blue}{z \cdot \frac{y}{t}} \]
    5. Simplified91.0%

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

    if -2.00000000000000018e-111 < y < 1.4000000000000001e-36 or 7.19999999999999948e-20 < y < 4.19999999999999972e54

    1. Initial program 98.3%

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

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

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

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

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

    if 4.19999999999999972e54 < y

    1. Initial program 97.9%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    5. Simplified90.2%

      \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    6. Step-by-step derivation
      1. clear-num90.1%

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{t}{z}}} \]
      2. div-inv90.2%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{t}{z}}} \]
    7. Applied egg-rr90.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{-111}:\\ \;\;\;\;x + z \cdot \frac{y}{t}\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{-36}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-20}:\\ \;\;\;\;x + z \cdot \frac{y}{t}\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+54}:\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{t}{z}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 64.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} \leq -5 \cdot 10^{-80} \lor \neg \left(\frac{z}{t} \leq 2 \cdot 10^{-10}\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) < -5e-80 or 2.00000000000000007e-10 < (/.f64 z t)

    1. Initial program 97.9%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    5. Simplified60.7%

      \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    6. Step-by-step derivation
      1. +-commutative60.7%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t} + x} \]
      2. *-commutative60.7%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} + x \]
      3. fma-define60.7%

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
      2. *-commutative58.1%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} \]
    10. Simplified58.1%

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

    if -5e-80 < (/.f64 z t) < 2.00000000000000007e-10

    1. Initial program 96.9%

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

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

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

Alternative 6: 74.6% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.80000000000000009e-114 or 2.0000000000000001e-127 < x

    1. Initial program 98.8%

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

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

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

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

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

    if -1.80000000000000009e-114 < x < 2.0000000000000001e-127

    1. Initial program 94.4%

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

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

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

      \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    6. Step-by-step derivation
      1. +-commutative87.4%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot \frac{z}{t}} \]
      2. *-commutative66.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.8 \cdot 10^{-114} \lor \neg \left(x \leq 2 \cdot 10^{-127}\right):\\ \;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 54.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-13} \lor \neg \left(z \leq 2.8 \cdot 10^{-88}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.19999999999999977e-13 or 2.79999999999999976e-88 < z

    1. Initial program 98.1%

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

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

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

      \[\leadsto x + \color{blue}{y \cdot \frac{z}{t}} \]
    6. Step-by-step derivation
      1. +-commutative69.1%

        \[\leadsto \color{blue}{y \cdot \frac{z}{t} + x} \]
      2. *-commutative69.1%

        \[\leadsto \color{blue}{\frac{z}{t} \cdot y} + x \]
      3. fma-define69.1%

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

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

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

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

        \[\leadsto \color{blue}{z \cdot \frac{y}{t}} \]
    10. Simplified51.4%

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

    if -4.19999999999999977e-13 < z < 2.79999999999999976e-88

    1. Initial program 96.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{-13} \lor \neg \left(z \leq 2.8 \cdot 10^{-88}\right):\\ \;\;\;\;z \cdot \frac{y}{t}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 92.4% accurate, 1.0× speedup?

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

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

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

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

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

      \[\leadsto x + \left(\left(-\color{blue}{x \cdot \frac{z}{t}}\right) + \frac{y \cdot z}{t}\right) \]
    3. distribute-lft-neg-out86.9%

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

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

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

      \[\leadsto x + \frac{z}{t} \cdot \color{blue}{\left(y + \left(-x\right)\right)} \]
    7. sub-neg97.4%

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

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

      \[\leadsto x + \color{blue}{z \cdot \frac{y - x}{t}} \]
  5. Simplified95.0%

    \[\leadsto x + \color{blue}{z \cdot \frac{y - x}{t}} \]
  6. Final simplification95.0%

    \[\leadsto x + z \cdot \frac{y - x}{t} \]
  7. Add Preprocessing

Alternative 9: 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}
Derivation
  1. Initial program 97.4%

    \[x + \left(y - x\right) \cdot \frac{z}{t} \]
  2. Add Preprocessing
  3. Final simplification97.4%

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

Alternative 10: 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 97.4%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification38.9%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 97.6% accurate, 0.3× 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 2024052 
(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))))