Rosa's DopplerBench

Percentage Accurate: 72.1% → 98.2%
Time: 9.8s
Alternatives: 17
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 17 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: 72.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-t1 * v) / ((t1 + u) * (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 * v) / ((t1 + u) * (t1 + u));
}
def code(u, v, t1):
	return (-t1 * v) / ((t1 + u) * (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) * v) / Float64(Float64(t1 + u) * Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 * v) / ((t1 + u) * (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) * v), $MachinePrecision] / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}
\end{array}

Alternative 1: 98.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\frac{t1}{t1 + u} \cdot v}{\left(-u\right) - t1} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (* (/ t1 (+ t1 u)) v) (- (- u) t1)))
double code(double u, double v, double t1) {
	return ((t1 / (t1 + u)) * v) / (-u - t1);
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = ((t1 / (t1 + u)) * v) / (-u - t1)
end function
public static double code(double u, double v, double t1) {
	return ((t1 / (t1 + u)) * v) / (-u - t1);
}
def code(u, v, t1):
	return ((t1 / (t1 + u)) * v) / (-u - t1)
function code(u, v, t1)
	return Float64(Float64(Float64(t1 / Float64(t1 + u)) * v) / Float64(Float64(-u) - t1))
end
function tmp = code(u, v, t1)
	tmp = ((t1 / (t1 + u)) * v) / (-u - t1);
end
code[u_, v_, t1_] := N[(N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{t1}{t1 + u} \cdot v}{\left(-u\right) - t1}
\end{array}
Derivation
  1. Initial program 74.4%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. associate-*l/78.8%

      \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
    2. *-commutative78.8%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  3. Simplified78.8%

    \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. *-commutative78.8%

      \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
    2. associate-*l/74.4%

      \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. times-frac98.0%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. frac-2neg98.0%

      \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
    5. remove-double-neg98.0%

      \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
    6. +-commutative98.0%

      \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
    7. distribute-neg-in98.0%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
    8. sub-neg98.0%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    9. frac-2neg98.0%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
    10. +-commutative98.0%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
    11. distribute-neg-in98.0%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
    12. sub-neg98.0%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
    13. associate-*r/98.4%

      \[\leadsto \color{blue}{\frac{\frac{t1}{\left(-u\right) - t1} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
  6. Applied egg-rr98.4%

    \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
  7. Final simplification98.4%

    \[\leadsto \frac{\frac{t1}{t1 + u} \cdot v}{\left(-u\right) - t1} \]
  8. Add Preprocessing

Alternative 2: 89.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1.5 \cdot 10^{+193}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq 8.5 \cdot 10^{+144}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -1.5e+193)
   (/ v (- (* u -2.0) t1))
   (if (<= t1 8.5e+144) (* t1 (/ (/ v (+ t1 u)) (- (- u) t1))) (- (/ v t1)))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -1.5e+193) {
		tmp = v / ((u * -2.0) - t1);
	} else if (t1 <= 8.5e+144) {
		tmp = t1 * ((v / (t1 + u)) / (-u - t1));
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (t1 <= (-1.5d+193)) then
        tmp = v / ((u * (-2.0d0)) - t1)
    else if (t1 <= 8.5d+144) then
        tmp = t1 * ((v / (t1 + u)) / (-u - t1))
    else
        tmp = -(v / t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -1.5e+193) {
		tmp = v / ((u * -2.0) - t1);
	} else if (t1 <= 8.5e+144) {
		tmp = t1 * ((v / (t1 + u)) / (-u - t1));
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -1.5e+193:
		tmp = v / ((u * -2.0) - t1)
	elif t1 <= 8.5e+144:
		tmp = t1 * ((v / (t1 + u)) / (-u - t1))
	else:
		tmp = -(v / t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -1.5e+193)
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	elseif (t1 <= 8.5e+144)
		tmp = Float64(t1 * Float64(Float64(v / Float64(t1 + u)) / Float64(Float64(-u) - t1)));
	else
		tmp = Float64(-Float64(v / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -1.5e+193)
		tmp = v / ((u * -2.0) - t1);
	elseif (t1 <= 8.5e+144)
		tmp = t1 * ((v / (t1 + u)) / (-u - t1));
	else
		tmp = -(v / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -1.5e+193], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 8.5e+144], N[(t1 * N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.5 \cdot 10^{+193}:\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\

\mathbf{elif}\;t1 \leq 8.5 \cdot 10^{+144}:\\
\;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\

\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -1.5e193

    1. Initial program 57.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/58.0%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative58.0%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified58.0%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/57.2%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative57.2%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num100.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg100.0%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times100.0%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity100.0%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative100.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in100.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg100.0%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
    6. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 99.2%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative99.2%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified99.2%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]
    10. Taylor expanded in v around 0 99.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1 + 2 \cdot u}} \]
    11. Step-by-step derivation
      1. mul-1-neg99.2%

        \[\leadsto \color{blue}{-\frac{v}{t1 + 2 \cdot u}} \]
      2. +-commutative99.2%

        \[\leadsto -\frac{v}{\color{blue}{2 \cdot u + t1}} \]
      3. *-commutative99.2%

        \[\leadsto -\frac{v}{\color{blue}{u \cdot 2} + t1} \]
      4. fma-undefine99.2%

        \[\leadsto -\frac{v}{\color{blue}{\mathsf{fma}\left(u, 2, t1\right)}} \]
      5. distribute-neg-frac299.2%

        \[\leadsto \color{blue}{\frac{v}{-\mathsf{fma}\left(u, 2, t1\right)}} \]
      6. neg-sub099.2%

        \[\leadsto \frac{v}{\color{blue}{0 - \mathsf{fma}\left(u, 2, t1\right)}} \]
      7. fma-undefine99.2%

        \[\leadsto \frac{v}{0 - \color{blue}{\left(u \cdot 2 + t1\right)}} \]
      8. associate--r+99.2%

        \[\leadsto \frac{v}{\color{blue}{\left(0 - u \cdot 2\right) - t1}} \]
      9. neg-sub099.2%

        \[\leadsto \frac{v}{\color{blue}{\left(-u \cdot 2\right)} - t1} \]
      10. distribute-rgt-neg-in99.2%

        \[\leadsto \frac{v}{\color{blue}{u \cdot \left(-2\right)} - t1} \]
      11. metadata-eval99.2%

        \[\leadsto \frac{v}{u \cdot \color{blue}{-2} - t1} \]
    12. Simplified99.2%

      \[\leadsto \color{blue}{\frac{v}{u \cdot -2 - t1}} \]

    if -1.5e193 < t1 < 8.4999999999999998e144

    1. Initial program 80.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-/l*80.7%

        \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified80.7%

      \[\leadsto \color{blue}{\left(-t1\right) \cdot \frac{v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-/r*90.9%

        \[\leadsto \left(-t1\right) \cdot \color{blue}{\frac{\frac{v}{t1 + u}}{t1 + u}} \]
      2. div-inv90.7%

        \[\leadsto \left(-t1\right) \cdot \color{blue}{\left(\frac{v}{t1 + u} \cdot \frac{1}{t1 + u}\right)} \]
    6. Applied egg-rr90.7%

      \[\leadsto \left(-t1\right) \cdot \color{blue}{\left(\frac{v}{t1 + u} \cdot \frac{1}{t1 + u}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/90.9%

        \[\leadsto \left(-t1\right) \cdot \color{blue}{\frac{\frac{v}{t1 + u} \cdot 1}{t1 + u}} \]
      2. *-rgt-identity90.9%

        \[\leadsto \left(-t1\right) \cdot \frac{\color{blue}{\frac{v}{t1 + u}}}{t1 + u} \]
    8. Simplified90.9%

      \[\leadsto \left(-t1\right) \cdot \color{blue}{\frac{\frac{v}{t1 + u}}{t1 + u}} \]

    if 8.4999999999999998e144 < t1

    1. Initial program 38.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/42.8%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative42.8%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified42.8%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 93.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/93.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-193.8%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified93.8%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification91.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.5 \cdot 10^{+193}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq 8.5 \cdot 10^{+144}:\\ \;\;\;\;t1 \cdot \frac{\frac{v}{t1 + u}}{\left(-u\right) - t1}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 88.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -9.8 \cdot 10^{+153}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq 8 \cdot 10^{+131}:\\ \;\;\;\;v \cdot \frac{t1}{\left(t1 + u\right) \cdot \left(\left(-u\right) - t1\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -9.8e+153)
   (/ v (- (* u -2.0) t1))
   (if (<= t1 8e+131) (* v (/ t1 (* (+ t1 u) (- (- u) t1)))) (- (/ v t1)))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -9.8e+153) {
		tmp = v / ((u * -2.0) - t1);
	} else if (t1 <= 8e+131) {
		tmp = v * (t1 / ((t1 + u) * (-u - t1)));
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (t1 <= (-9.8d+153)) then
        tmp = v / ((u * (-2.0d0)) - t1)
    else if (t1 <= 8d+131) then
        tmp = v * (t1 / ((t1 + u) * (-u - t1)))
    else
        tmp = -(v / t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -9.8e+153) {
		tmp = v / ((u * -2.0) - t1);
	} else if (t1 <= 8e+131) {
		tmp = v * (t1 / ((t1 + u) * (-u - t1)));
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -9.8e+153:
		tmp = v / ((u * -2.0) - t1)
	elif t1 <= 8e+131:
		tmp = v * (t1 / ((t1 + u) * (-u - t1)))
	else:
		tmp = -(v / t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -9.8e+153)
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	elseif (t1 <= 8e+131)
		tmp = Float64(v * Float64(t1 / Float64(Float64(t1 + u) * Float64(Float64(-u) - t1))));
	else
		tmp = Float64(-Float64(v / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -9.8e+153)
		tmp = v / ((u * -2.0) - t1);
	elseif (t1 <= 8e+131)
		tmp = v * (t1 / ((t1 + u) * (-u - t1)));
	else
		tmp = -(v / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -9.8e+153], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 8e+131], N[(v * N[(t1 / N[(N[(t1 + u), $MachinePrecision] * N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -9.8 \cdot 10^{+153}:\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\

\mathbf{elif}\;t1 \leq 8 \cdot 10^{+131}:\\
\;\;\;\;v \cdot \frac{t1}{\left(t1 + u\right) \cdot \left(\left(-u\right) - t1\right)}\\

\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -9.80000000000000003e153

    1. Initial program 41.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/42.6%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative42.6%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified42.6%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/41.2%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative41.2%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num99.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg99.9%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times96.5%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity96.5%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative96.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in96.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg96.5%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
    6. Applied egg-rr96.5%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 89.4%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative89.4%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified89.4%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]
    10. Taylor expanded in v around 0 89.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1 + 2 \cdot u}} \]
    11. Step-by-step derivation
      1. mul-1-neg89.4%

        \[\leadsto \color{blue}{-\frac{v}{t1 + 2 \cdot u}} \]
      2. +-commutative89.4%

        \[\leadsto -\frac{v}{\color{blue}{2 \cdot u + t1}} \]
      3. *-commutative89.4%

        \[\leadsto -\frac{v}{\color{blue}{u \cdot 2} + t1} \]
      4. fma-undefine89.4%

        \[\leadsto -\frac{v}{\color{blue}{\mathsf{fma}\left(u, 2, t1\right)}} \]
      5. distribute-neg-frac289.4%

        \[\leadsto \color{blue}{\frac{v}{-\mathsf{fma}\left(u, 2, t1\right)}} \]
      6. neg-sub089.4%

        \[\leadsto \frac{v}{\color{blue}{0 - \mathsf{fma}\left(u, 2, t1\right)}} \]
      7. fma-undefine89.4%

        \[\leadsto \frac{v}{0 - \color{blue}{\left(u \cdot 2 + t1\right)}} \]
      8. associate--r+89.4%

        \[\leadsto \frac{v}{\color{blue}{\left(0 - u \cdot 2\right) - t1}} \]
      9. neg-sub089.4%

        \[\leadsto \frac{v}{\color{blue}{\left(-u \cdot 2\right)} - t1} \]
      10. distribute-rgt-neg-in89.4%

        \[\leadsto \frac{v}{\color{blue}{u \cdot \left(-2\right)} - t1} \]
      11. metadata-eval89.4%

        \[\leadsto \frac{v}{u \cdot \color{blue}{-2} - t1} \]
    12. Simplified89.4%

      \[\leadsto \color{blue}{\frac{v}{u \cdot -2 - t1}} \]

    if -9.80000000000000003e153 < t1 < 7.9999999999999993e131

    1. Initial program 84.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/89.2%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative89.2%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified89.2%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing

    if 7.9999999999999993e131 < t1

    1. Initial program 42.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/46.8%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative46.8%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified46.8%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 91.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/91.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-191.6%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified91.6%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification89.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -9.8 \cdot 10^{+153}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq 8 \cdot 10^{+131}:\\ \;\;\;\;v \cdot \frac{t1}{\left(t1 + u\right) \cdot \left(\left(-u\right) - t1\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 78.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -3.4 \cdot 10^{+48} \lor \neg \left(u \leq 3.2 \cdot 10^{-46}\right):\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{t1}{-u}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -3.4e+48) (not (<= u 3.2e-46)))
   (* (/ v (+ t1 u)) (/ t1 (- u)))
   (- (/ v t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -3.4e+48) || !(u <= 3.2e-46)) {
		tmp = (v / (t1 + u)) * (t1 / -u);
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-3.4d+48)) .or. (.not. (u <= 3.2d-46))) then
        tmp = (v / (t1 + u)) * (t1 / -u)
    else
        tmp = -(v / t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -3.4e+48) || !(u <= 3.2e-46)) {
		tmp = (v / (t1 + u)) * (t1 / -u);
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -3.4e+48) or not (u <= 3.2e-46):
		tmp = (v / (t1 + u)) * (t1 / -u)
	else:
		tmp = -(v / t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -3.4e+48) || !(u <= 3.2e-46))
		tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(t1 / Float64(-u)));
	else
		tmp = Float64(-Float64(v / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -3.4e+48) || ~((u <= 3.2e-46)))
		tmp = (v / (t1 + u)) * (t1 / -u);
	else
		tmp = -(v / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3.4e+48], N[Not[LessEqual[u, 3.2e-46]], $MachinePrecision]], N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -3.4 \cdot 10^{+48} \lor \neg \left(u \leq 3.2 \cdot 10^{-46}\right):\\
\;\;\;\;\frac{v}{t1 + u} \cdot \frac{t1}{-u}\\

\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3.4000000000000003e48 or 3.1999999999999999e-46 < u

    1. Initial program 77.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac98.0%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg98.0%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac298.0%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative98.0%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in98.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg98.0%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified98.0%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 82.1%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/82.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg82.1%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified82.1%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]

    if -3.4000000000000003e48 < u < 3.1999999999999999e-46

    1. Initial program 70.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/80.3%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative80.3%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified80.3%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 85.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/85.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-185.3%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified85.3%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification83.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3.4 \cdot 10^{+48} \lor \neg \left(u \leq 3.2 \cdot 10^{-46}\right):\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{t1}{-u}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 78.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.7 \cdot 10^{+49}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{-u}}{t1 + u}\\ \mathbf{elif}\;u \leq 1.2 \cdot 10^{-44}:\\ \;\;\;\;-\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{t1}{-u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -1.7e+49)
   (/ (* t1 (/ v (- u))) (+ t1 u))
   (if (<= u 1.2e-44) (- (/ v t1)) (* (/ v (+ t1 u)) (/ t1 (- u))))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.7e+49) {
		tmp = (t1 * (v / -u)) / (t1 + u);
	} else if (u <= 1.2e-44) {
		tmp = -(v / t1);
	} else {
		tmp = (v / (t1 + u)) * (t1 / -u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-1.7d+49)) then
        tmp = (t1 * (v / -u)) / (t1 + u)
    else if (u <= 1.2d-44) then
        tmp = -(v / t1)
    else
        tmp = (v / (t1 + u)) * (t1 / -u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.7e+49) {
		tmp = (t1 * (v / -u)) / (t1 + u);
	} else if (u <= 1.2e-44) {
		tmp = -(v / t1);
	} else {
		tmp = (v / (t1 + u)) * (t1 / -u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -1.7e+49:
		tmp = (t1 * (v / -u)) / (t1 + u)
	elif u <= 1.2e-44:
		tmp = -(v / t1)
	else:
		tmp = (v / (t1 + u)) * (t1 / -u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -1.7e+49)
		tmp = Float64(Float64(t1 * Float64(v / Float64(-u))) / Float64(t1 + u));
	elseif (u <= 1.2e-44)
		tmp = Float64(-Float64(v / t1));
	else
		tmp = Float64(Float64(v / Float64(t1 + u)) * Float64(t1 / Float64(-u)));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -1.7e+49)
		tmp = (t1 * (v / -u)) / (t1 + u);
	elseif (u <= 1.2e-44)
		tmp = -(v / t1);
	else
		tmp = (v / (t1 + u)) * (t1 / -u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -1.7e+49], N[(N[(t1 * N[(v / (-u)), $MachinePrecision]), $MachinePrecision] / N[(t1 + u), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.2e-44], (-N[(v / t1), $MachinePrecision]), N[(N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(t1 / (-u)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.7 \cdot 10^{+49}:\\
\;\;\;\;\frac{t1 \cdot \frac{v}{-u}}{t1 + u}\\

\mathbf{elif}\;u \leq 1.2 \cdot 10^{-44}:\\
\;\;\;\;-\frac{v}{t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{t1 + u} \cdot \frac{t1}{-u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -1.7e49

    1. Initial program 77.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/78.4%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative78.4%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified78.4%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative78.4%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. associate-*l/77.8%

        \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. frac-2neg99.9%

        \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      10. +-commutative99.9%

        \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      11. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      12. sub-neg99.9%

        \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      13. associate-*r/99.8%

        \[\leadsto \color{blue}{\frac{\frac{t1}{\left(-u\right) - t1} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
    7. Taylor expanded in t1 around 0 78.0%

      \[\leadsto \frac{\color{blue}{-1 \cdot \frac{t1 \cdot v}{u}}}{t1 + u} \]
    8. Step-by-step derivation
      1. mul-1-neg78.0%

        \[\leadsto \frac{\color{blue}{-\frac{t1 \cdot v}{u}}}{t1 + u} \]
      2. associate-/l*85.5%

        \[\leadsto \frac{-\color{blue}{t1 \cdot \frac{v}{u}}}{t1 + u} \]
      3. distribute-lft-neg-in85.5%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot \frac{v}{u}}}{t1 + u} \]
    9. Simplified85.5%

      \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot \frac{v}{u}}}{t1 + u} \]

    if -1.7e49 < u < 1.20000000000000004e-44

    1. Initial program 70.7%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/80.3%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative80.3%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified80.3%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 85.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/85.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-185.3%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified85.3%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]

    if 1.20000000000000004e-44 < u

    1. Initial program 77.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac96.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg96.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac296.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative96.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in96.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg96.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified96.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around 0 80.0%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. associate-*r/80.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot t1}{u}} \cdot \frac{v}{t1 + u} \]
      2. mul-1-neg80.0%

        \[\leadsto \frac{\color{blue}{-t1}}{u} \cdot \frac{v}{t1 + u} \]
    7. Simplified80.0%

      \[\leadsto \color{blue}{\frac{-t1}{u}} \cdot \frac{v}{t1 + u} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification83.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.7 \cdot 10^{+49}:\\ \;\;\;\;\frac{t1 \cdot \frac{v}{-u}}{t1 + u}\\ \mathbf{elif}\;u \leq 1.2 \cdot 10^{-44}:\\ \;\;\;\;-\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{t1 + u} \cdot \frac{t1}{-u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 78.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -9.6 \cdot 10^{-107}:\\ \;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\ \mathbf{elif}\;t1 \leq 5.6 \cdot 10^{-39}:\\ \;\;\;\;\frac{v}{\frac{-u}{\frac{t1}{u}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -9.6e-107)
   (/ -1.0 (/ (+ t1 u) v))
   (if (<= t1 5.6e-39) (/ v (/ (- u) (/ t1 u))) (/ v (- (* u -2.0) t1)))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -9.6e-107) {
		tmp = -1.0 / ((t1 + u) / v);
	} else if (t1 <= 5.6e-39) {
		tmp = v / (-u / (t1 / u));
	} else {
		tmp = v / ((u * -2.0) - t1);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (t1 <= (-9.6d-107)) then
        tmp = (-1.0d0) / ((t1 + u) / v)
    else if (t1 <= 5.6d-39) then
        tmp = v / (-u / (t1 / u))
    else
        tmp = v / ((u * (-2.0d0)) - t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -9.6e-107) {
		tmp = -1.0 / ((t1 + u) / v);
	} else if (t1 <= 5.6e-39) {
		tmp = v / (-u / (t1 / u));
	} else {
		tmp = v / ((u * -2.0) - t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -9.6e-107:
		tmp = -1.0 / ((t1 + u) / v)
	elif t1 <= 5.6e-39:
		tmp = v / (-u / (t1 / u))
	else:
		tmp = v / ((u * -2.0) - t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -9.6e-107)
		tmp = Float64(-1.0 / Float64(Float64(t1 + u) / v));
	elseif (t1 <= 5.6e-39)
		tmp = Float64(v / Float64(Float64(-u) / Float64(t1 / u)));
	else
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -9.6e-107)
		tmp = -1.0 / ((t1 + u) / v);
	elseif (t1 <= 5.6e-39)
		tmp = v / (-u / (t1 / u));
	else
		tmp = v / ((u * -2.0) - t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -9.6e-107], N[(-1.0 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 5.6e-39], N[(v / N[((-u) / N[(t1 / u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -9.6 \cdot 10^{-107}:\\
\;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\

\mathbf{elif}\;t1 \leq 5.6 \cdot 10^{-39}:\\
\;\;\;\;\frac{v}{\frac{-u}{\frac{t1}{u}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -9.59999999999999977e-107

    1. Initial program 64.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 77.4%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. clear-num78.0%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
      2. un-div-inv78.0%

        \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]
    7. Applied egg-rr78.0%

      \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]

    if -9.59999999999999977e-107 < t1 < 5.6000000000000003e-39

    1. Initial program 90.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/87.1%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative87.1%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified87.1%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/90.1%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative90.1%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac95.1%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg95.1%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg95.1%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative95.1%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in95.1%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg95.1%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num94.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg94.4%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times94.1%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity94.1%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative94.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in94.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg94.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
    6. Applied egg-rr94.1%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in t1 around 0 76.9%

      \[\leadsto \frac{-v}{\frac{\color{blue}{u}}{t1} \cdot \left(t1 + u\right)} \]
    8. Step-by-step derivation
      1. *-commutative76.9%

        \[\leadsto \frac{-v}{\color{blue}{\left(t1 + u\right) \cdot \frac{u}{t1}}} \]
      2. clear-num76.9%

        \[\leadsto \frac{-v}{\left(t1 + u\right) \cdot \color{blue}{\frac{1}{\frac{t1}{u}}}} \]
      3. un-div-inv77.1%

        \[\leadsto \frac{-v}{\color{blue}{\frac{t1 + u}{\frac{t1}{u}}}} \]
      4. +-commutative77.1%

        \[\leadsto \frac{-v}{\frac{\color{blue}{u + t1}}{\frac{t1}{u}}} \]
    9. Applied egg-rr77.1%

      \[\leadsto \frac{-v}{\color{blue}{\frac{u + t1}{\frac{t1}{u}}}} \]
    10. Taylor expanded in u around inf 81.4%

      \[\leadsto \frac{-v}{\frac{\color{blue}{u}}{\frac{t1}{u}}} \]

    if 5.6000000000000003e-39 < t1

    1. Initial program 64.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/70.6%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative70.6%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified70.6%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/64.4%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative64.4%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num99.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg99.9%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times97.1%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity97.1%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative97.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in97.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg97.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
    6. Applied egg-rr97.1%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 86.3%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative86.3%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified86.3%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]
    10. Taylor expanded in v around 0 86.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1 + 2 \cdot u}} \]
    11. Step-by-step derivation
      1. mul-1-neg86.3%

        \[\leadsto \color{blue}{-\frac{v}{t1 + 2 \cdot u}} \]
      2. +-commutative86.3%

        \[\leadsto -\frac{v}{\color{blue}{2 \cdot u + t1}} \]
      3. *-commutative86.3%

        \[\leadsto -\frac{v}{\color{blue}{u \cdot 2} + t1} \]
      4. fma-undefine86.3%

        \[\leadsto -\frac{v}{\color{blue}{\mathsf{fma}\left(u, 2, t1\right)}} \]
      5. distribute-neg-frac286.3%

        \[\leadsto \color{blue}{\frac{v}{-\mathsf{fma}\left(u, 2, t1\right)}} \]
      6. neg-sub086.3%

        \[\leadsto \frac{v}{\color{blue}{0 - \mathsf{fma}\left(u, 2, t1\right)}} \]
      7. fma-undefine86.3%

        \[\leadsto \frac{v}{0 - \color{blue}{\left(u \cdot 2 + t1\right)}} \]
      8. associate--r+86.3%

        \[\leadsto \frac{v}{\color{blue}{\left(0 - u \cdot 2\right) - t1}} \]
      9. neg-sub086.3%

        \[\leadsto \frac{v}{\color{blue}{\left(-u \cdot 2\right)} - t1} \]
      10. distribute-rgt-neg-in86.3%

        \[\leadsto \frac{v}{\color{blue}{u \cdot \left(-2\right)} - t1} \]
      11. metadata-eval86.3%

        \[\leadsto \frac{v}{u \cdot \color{blue}{-2} - t1} \]
    12. Simplified86.3%

      \[\leadsto \color{blue}{\frac{v}{u \cdot -2 - t1}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification81.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -9.6 \cdot 10^{-107}:\\ \;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\ \mathbf{elif}\;t1 \leq 5.6 \cdot 10^{-39}:\\ \;\;\;\;\frac{v}{\frac{-u}{\frac{t1}{u}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 78.1% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1 \cdot 10^{-106}:\\ \;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\ \mathbf{elif}\;t1 \leq 5.8 \cdot 10^{-39}:\\ \;\;\;\;\frac{v}{u \cdot \frac{u}{-t1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= t1 -1e-106)
   (/ -1.0 (/ (+ t1 u) v))
   (if (<= t1 5.8e-39) (/ v (* u (/ u (- t1)))) (/ v (- (* u -2.0) t1)))))
double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -1e-106) {
		tmp = -1.0 / ((t1 + u) / v);
	} else if (t1 <= 5.8e-39) {
		tmp = v / (u * (u / -t1));
	} else {
		tmp = v / ((u * -2.0) - t1);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (t1 <= (-1d-106)) then
        tmp = (-1.0d0) / ((t1 + u) / v)
    else if (t1 <= 5.8d-39) then
        tmp = v / (u * (u / -t1))
    else
        tmp = v / ((u * (-2.0d0)) - t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (t1 <= -1e-106) {
		tmp = -1.0 / ((t1 + u) / v);
	} else if (t1 <= 5.8e-39) {
		tmp = v / (u * (u / -t1));
	} else {
		tmp = v / ((u * -2.0) - t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if t1 <= -1e-106:
		tmp = -1.0 / ((t1 + u) / v)
	elif t1 <= 5.8e-39:
		tmp = v / (u * (u / -t1))
	else:
		tmp = v / ((u * -2.0) - t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (t1 <= -1e-106)
		tmp = Float64(-1.0 / Float64(Float64(t1 + u) / v));
	elseif (t1 <= 5.8e-39)
		tmp = Float64(v / Float64(u * Float64(u / Float64(-t1))));
	else
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (t1 <= -1e-106)
		tmp = -1.0 / ((t1 + u) / v);
	elseif (t1 <= 5.8e-39)
		tmp = v / (u * (u / -t1));
	else
		tmp = v / ((u * -2.0) - t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[t1, -1e-106], N[(-1.0 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 5.8e-39], N[(v / N[(u * N[(u / (-t1)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1 \cdot 10^{-106}:\\
\;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\

\mathbf{elif}\;t1 \leq 5.8 \cdot 10^{-39}:\\
\;\;\;\;\frac{v}{u \cdot \frac{u}{-t1}}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -9.99999999999999941e-107

    1. Initial program 64.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 77.4%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. clear-num78.0%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
      2. un-div-inv78.0%

        \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]
    7. Applied egg-rr78.0%

      \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]

    if -9.99999999999999941e-107 < t1 < 5.79999999999999975e-39

    1. Initial program 90.1%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/87.1%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative87.1%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified87.1%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/90.1%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative90.1%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac95.1%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg95.1%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg95.1%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative95.1%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in95.1%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg95.1%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num94.4%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg94.4%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times94.1%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity94.1%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative94.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in94.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg94.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
    6. Applied egg-rr94.1%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in t1 around 0 76.9%

      \[\leadsto \frac{-v}{\frac{\color{blue}{u}}{t1} \cdot \left(t1 + u\right)} \]
    8. Taylor expanded in t1 around 0 81.3%

      \[\leadsto \frac{-v}{\frac{u}{t1} \cdot \color{blue}{u}} \]

    if 5.79999999999999975e-39 < t1

    1. Initial program 64.4%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/70.6%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative70.6%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified70.6%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/64.4%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative64.4%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num99.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg99.9%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times97.1%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity97.1%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative97.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in97.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg97.1%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
    6. Applied egg-rr97.1%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 86.3%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative86.3%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified86.3%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]
    10. Taylor expanded in v around 0 86.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1 + 2 \cdot u}} \]
    11. Step-by-step derivation
      1. mul-1-neg86.3%

        \[\leadsto \color{blue}{-\frac{v}{t1 + 2 \cdot u}} \]
      2. +-commutative86.3%

        \[\leadsto -\frac{v}{\color{blue}{2 \cdot u + t1}} \]
      3. *-commutative86.3%

        \[\leadsto -\frac{v}{\color{blue}{u \cdot 2} + t1} \]
      4. fma-undefine86.3%

        \[\leadsto -\frac{v}{\color{blue}{\mathsf{fma}\left(u, 2, t1\right)}} \]
      5. distribute-neg-frac286.3%

        \[\leadsto \color{blue}{\frac{v}{-\mathsf{fma}\left(u, 2, t1\right)}} \]
      6. neg-sub086.3%

        \[\leadsto \frac{v}{\color{blue}{0 - \mathsf{fma}\left(u, 2, t1\right)}} \]
      7. fma-undefine86.3%

        \[\leadsto \frac{v}{0 - \color{blue}{\left(u \cdot 2 + t1\right)}} \]
      8. associate--r+86.3%

        \[\leadsto \frac{v}{\color{blue}{\left(0 - u \cdot 2\right) - t1}} \]
      9. neg-sub086.3%

        \[\leadsto \frac{v}{\color{blue}{\left(-u \cdot 2\right)} - t1} \]
      10. distribute-rgt-neg-in86.3%

        \[\leadsto \frac{v}{\color{blue}{u \cdot \left(-2\right)} - t1} \]
      11. metadata-eval86.3%

        \[\leadsto \frac{v}{u \cdot \color{blue}{-2} - t1} \]
    12. Simplified86.3%

      \[\leadsto \color{blue}{\frac{v}{u \cdot -2 - t1}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification81.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1 \cdot 10^{-106}:\\ \;\;\;\;\frac{-1}{\frac{t1 + u}{v}}\\ \mathbf{elif}\;t1 \leq 5.8 \cdot 10^{-39}:\\ \;\;\;\;\frac{v}{u \cdot \frac{u}{-t1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 58.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.9 \cdot 10^{+116} \lor \neg \left(u \leq 1.75 \cdot 10^{+230}\right):\\ \;\;\;\;\frac{-1}{\frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -2.9e+116) (not (<= u 1.75e+230)))
   (/ -1.0 (/ u v))
   (- (/ v t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.9e+116) || !(u <= 1.75e+230)) {
		tmp = -1.0 / (u / v);
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-2.9d+116)) .or. (.not. (u <= 1.75d+230))) then
        tmp = (-1.0d0) / (u / v)
    else
        tmp = -(v / t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.9e+116) || !(u <= 1.75e+230)) {
		tmp = -1.0 / (u / v);
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -2.9e+116) or not (u <= 1.75e+230):
		tmp = -1.0 / (u / v)
	else:
		tmp = -(v / t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -2.9e+116) || !(u <= 1.75e+230))
		tmp = Float64(-1.0 / Float64(u / v));
	else
		tmp = Float64(-Float64(v / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -2.9e+116) || ~((u <= 1.75e+230)))
		tmp = -1.0 / (u / v);
	else
		tmp = -(v / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.9e+116], N[Not[LessEqual[u, 1.75e+230]], $MachinePrecision]], N[(-1.0 / N[(u / v), $MachinePrecision]), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.9 \cdot 10^{+116} \lor \neg \left(u \leq 1.75 \cdot 10^{+230}\right):\\
\;\;\;\;\frac{-1}{\frac{u}{v}}\\

\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.9000000000000001e116 or 1.75e230 < u

    1. Initial program 79.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 53.9%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. clear-num55.6%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
      2. un-div-inv55.6%

        \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]
    7. Applied egg-rr55.6%

      \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]
    8. Taylor expanded in t1 around 0 53.5%

      \[\leadsto \frac{-1}{\color{blue}{\frac{u}{v}}} \]

    if -2.9000000000000001e116 < u < 1.75e230

    1. Initial program 72.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/78.4%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative78.4%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified78.4%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 64.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/64.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-164.6%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified64.6%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.9 \cdot 10^{+116} \lor \neg \left(u \leq 1.75 \cdot 10^{+230}\right):\\ \;\;\;\;\frac{-1}{\frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 58.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.7 \cdot 10^{+116} \lor \neg \left(u \leq 1.75 \cdot 10^{+230}\right):\\ \;\;\;\;\frac{v}{u} \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -2.7e+116) (not (<= u 1.75e+230)))
   (* (/ v u) -0.5)
   (- (/ v t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.7e+116) || !(u <= 1.75e+230)) {
		tmp = (v / u) * -0.5;
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-2.7d+116)) .or. (.not. (u <= 1.75d+230))) then
        tmp = (v / u) * (-0.5d0)
    else
        tmp = -(v / t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.7e+116) || !(u <= 1.75e+230)) {
		tmp = (v / u) * -0.5;
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -2.7e+116) or not (u <= 1.75e+230):
		tmp = (v / u) * -0.5
	else:
		tmp = -(v / t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -2.7e+116) || !(u <= 1.75e+230))
		tmp = Float64(Float64(v / u) * -0.5);
	else
		tmp = Float64(-Float64(v / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -2.7e+116) || ~((u <= 1.75e+230)))
		tmp = (v / u) * -0.5;
	else
		tmp = -(v / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.7e+116], N[Not[LessEqual[u, 1.75e+230]], $MachinePrecision]], N[(N[(v / u), $MachinePrecision] * -0.5), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.7 \cdot 10^{+116} \lor \neg \left(u \leq 1.75 \cdot 10^{+230}\right):\\
\;\;\;\;\frac{v}{u} \cdot -0.5\\

\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.7e116 or 1.75e230 < u

    1. Initial program 79.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/80.1%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative80.1%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified80.1%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r/79.6%

        \[\leadsto \color{blue}{\frac{v \cdot \left(-t1\right)}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      2. *-commutative79.6%

        \[\leadsto \frac{\color{blue}{\left(-t1\right) \cdot v}}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. clear-num99.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(-u\right) - t1}{t1}}} \cdot \frac{v}{t1 + u} \]
      10. frac-2neg99.9%

        \[\leadsto \frac{1}{\frac{\left(-u\right) - t1}{t1}} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      11. frac-times89.4%

        \[\leadsto \color{blue}{\frac{1 \cdot \left(-v\right)}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)}} \]
      12. *-un-lft-identity89.4%

        \[\leadsto \frac{\color{blue}{-v}}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\left(t1 + u\right)\right)} \]
      13. +-commutative89.4%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \left(-\color{blue}{\left(u + t1\right)}\right)} \]
      14. distribute-neg-in89.4%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) + \left(-t1\right)\right)}} \]
      15. sub-neg89.4%

        \[\leadsto \frac{-v}{\frac{\left(-u\right) - t1}{t1} \cdot \color{blue}{\left(\left(-u\right) - t1\right)}} \]
    6. Applied egg-rr89.4%

      \[\leadsto \color{blue}{\frac{-v}{\frac{t1 + u}{t1} \cdot \left(t1 + u\right)}} \]
    7. Taylor expanded in u around 0 54.5%

      \[\leadsto \frac{-v}{\color{blue}{t1 + 2 \cdot u}} \]
    8. Step-by-step derivation
      1. *-commutative54.5%

        \[\leadsto \frac{-v}{t1 + \color{blue}{u \cdot 2}} \]
    9. Simplified54.5%

      \[\leadsto \frac{-v}{\color{blue}{t1 + u \cdot 2}} \]
    10. Taylor expanded in t1 around 0 51.8%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{v}{u}} \]

    if -2.7e116 < u < 1.75e230

    1. Initial program 72.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/78.4%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative78.4%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified78.4%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 64.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/64.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-164.6%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified64.6%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.7 \cdot 10^{+116} \lor \neg \left(u \leq 1.75 \cdot 10^{+230}\right):\\ \;\;\;\;\frac{v}{u} \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 58.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.8 \cdot 10^{+116}:\\ \;\;\;\;\frac{-1}{\frac{u}{v}}\\ \mathbf{elif}\;u \leq 1.55 \cdot 10^{+114}:\\ \;\;\;\;-\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{t1 + u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -2.8e+116)
   (/ -1.0 (/ u v))
   (if (<= u 1.55e+114) (- (/ v t1)) (/ v (+ t1 u)))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -2.8e+116) {
		tmp = -1.0 / (u / v);
	} else if (u <= 1.55e+114) {
		tmp = -(v / t1);
	} else {
		tmp = v / (t1 + u);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if (u <= (-2.8d+116)) then
        tmp = (-1.0d0) / (u / v)
    else if (u <= 1.55d+114) then
        tmp = -(v / t1)
    else
        tmp = v / (t1 + u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -2.8e+116) {
		tmp = -1.0 / (u / v);
	} else if (u <= 1.55e+114) {
		tmp = -(v / t1);
	} else {
		tmp = v / (t1 + u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -2.8e+116:
		tmp = -1.0 / (u / v)
	elif u <= 1.55e+114:
		tmp = -(v / t1)
	else:
		tmp = v / (t1 + u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -2.8e+116)
		tmp = Float64(-1.0 / Float64(u / v));
	elseif (u <= 1.55e+114)
		tmp = Float64(-Float64(v / t1));
	else
		tmp = Float64(v / Float64(t1 + u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -2.8e+116)
		tmp = -1.0 / (u / v);
	elseif (u <= 1.55e+114)
		tmp = -(v / t1);
	else
		tmp = v / (t1 + u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -2.8e+116], N[(-1.0 / N[(u / v), $MachinePrecision]), $MachinePrecision], If[LessEqual[u, 1.55e+114], (-N[(v / t1), $MachinePrecision]), N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.8 \cdot 10^{+116}:\\
\;\;\;\;\frac{-1}{\frac{u}{v}}\\

\mathbf{elif}\;u \leq 1.55 \cdot 10^{+114}:\\
\;\;\;\;-\frac{v}{t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{t1 + u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if u < -2.80000000000000004e116

    1. Initial program 74.9%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.8%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.8%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.8%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.8%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.8%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.8%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 46.4%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. clear-num48.3%

        \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
      2. un-div-inv48.3%

        \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]
    7. Applied egg-rr48.3%

      \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]
    8. Taylor expanded in t1 around 0 44.8%

      \[\leadsto \frac{-1}{\color{blue}{\frac{u}{v}}} \]

    if -2.80000000000000004e116 < u < 1.55e114

    1. Initial program 73.5%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/79.9%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative79.9%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified79.9%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 70.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/70.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-170.6%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified70.6%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]

    if 1.55e114 < u

    1. Initial program 77.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac98.6%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg98.6%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac298.6%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative98.6%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in98.6%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg98.6%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified98.6%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 52.3%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt43.9%

        \[\leadsto \color{blue}{\sqrt{-1 \cdot \frac{v}{t1 + u}} \cdot \sqrt{-1 \cdot \frac{v}{t1 + u}}} \]
      2. sqrt-unprod56.7%

        \[\leadsto \color{blue}{\sqrt{\left(-1 \cdot \frac{v}{t1 + u}\right) \cdot \left(-1 \cdot \frac{v}{t1 + u}\right)}} \]
      3. mul-1-neg56.7%

        \[\leadsto \sqrt{\color{blue}{\left(-\frac{v}{t1 + u}\right)} \cdot \left(-1 \cdot \frac{v}{t1 + u}\right)} \]
      4. mul-1-neg56.7%

        \[\leadsto \sqrt{\left(-\frac{v}{t1 + u}\right) \cdot \color{blue}{\left(-\frac{v}{t1 + u}\right)}} \]
      5. sqr-neg56.7%

        \[\leadsto \sqrt{\color{blue}{\frac{v}{t1 + u} \cdot \frac{v}{t1 + u}}} \]
      6. sqrt-unprod45.0%

        \[\leadsto \color{blue}{\sqrt{\frac{v}{t1 + u}} \cdot \sqrt{\frac{v}{t1 + u}}} \]
      7. add-sqr-sqrt46.3%

        \[\leadsto \color{blue}{\frac{v}{t1 + u}} \]
    7. Applied egg-rr46.3%

      \[\leadsto \color{blue}{\frac{v}{t1 + u}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.8 \cdot 10^{+116}:\\ \;\;\;\;\frac{-1}{\frac{u}{v}}\\ \mathbf{elif}\;u \leq 1.55 \cdot 10^{+114}:\\ \;\;\;\;-\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{t1 + u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 58.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.35 \cdot 10^{+116} \lor \neg \left(u \leq 1.75 \cdot 10^{+230}\right):\\ \;\;\;\;\frac{v}{-u}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -2.35e+116) (not (<= u 1.75e+230))) (/ v (- u)) (- (/ v t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.35e+116) || !(u <= 1.75e+230)) {
		tmp = v / -u;
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-2.35d+116)) .or. (.not. (u <= 1.75d+230))) then
        tmp = v / -u
    else
        tmp = -(v / t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.35e+116) || !(u <= 1.75e+230)) {
		tmp = v / -u;
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -2.35e+116) or not (u <= 1.75e+230):
		tmp = v / -u
	else:
		tmp = -(v / t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -2.35e+116) || !(u <= 1.75e+230))
		tmp = Float64(v / Float64(-u));
	else
		tmp = Float64(-Float64(v / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -2.35e+116) || ~((u <= 1.75e+230)))
		tmp = v / -u;
	else
		tmp = -(v / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.35e+116], N[Not[LessEqual[u, 1.75e+230]], $MachinePrecision]], N[(v / (-u)), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.35 \cdot 10^{+116} \lor \neg \left(u \leq 1.75 \cdot 10^{+230}\right):\\
\;\;\;\;\frac{v}{-u}\\

\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.3500000000000002e116 or 1.75e230 < u

    1. Initial program 79.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 53.9%

      \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
    6. Taylor expanded in t1 around 0 51.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{u}} \]
    7. Step-by-step derivation
      1. associate-*r/51.8%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{u}} \]
      2. mul-1-neg51.8%

        \[\leadsto \frac{\color{blue}{-v}}{u} \]
    8. Simplified51.8%

      \[\leadsto \color{blue}{\frac{-v}{u}} \]

    if -2.3500000000000002e116 < u < 1.75e230

    1. Initial program 72.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/78.4%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative78.4%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified78.4%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 64.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/64.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-164.6%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified64.6%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.35 \cdot 10^{+116} \lor \neg \left(u \leq 1.75 \cdot 10^{+230}\right):\\ \;\;\;\;\frac{v}{-u}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 58.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.5 \cdot 10^{+116} \lor \neg \left(u \leq 1.75 \cdot 10^{+230}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -2.5e+116) (not (<= u 1.75e+230))) (/ v u) (- (/ v t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.5e+116) || !(u <= 1.75e+230)) {
		tmp = v / u;
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((u <= (-2.5d+116)) .or. (.not. (u <= 1.75d+230))) then
        tmp = v / u
    else
        tmp = -(v / t1)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -2.5e+116) || !(u <= 1.75e+230)) {
		tmp = v / u;
	} else {
		tmp = -(v / t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -2.5e+116) or not (u <= 1.75e+230):
		tmp = v / u
	else:
		tmp = -(v / t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -2.5e+116) || !(u <= 1.75e+230))
		tmp = Float64(v / u);
	else
		tmp = Float64(-Float64(v / t1));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((u <= -2.5e+116) || ~((u <= 1.75e+230)))
		tmp = v / u;
	else
		tmp = -(v / t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -2.5e+116], N[Not[LessEqual[u, 1.75e+230]], $MachinePrecision]], N[(v / u), $MachinePrecision], (-N[(v / t1), $MachinePrecision])]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -2.5 \cdot 10^{+116} \lor \neg \left(u \leq 1.75 \cdot 10^{+230}\right):\\
\;\;\;\;\frac{v}{u}\\

\mathbf{else}:\\
\;\;\;\;-\frac{v}{t1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -2.50000000000000013e116 or 1.75e230 < u

    1. Initial program 79.6%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/80.1%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative80.1%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified80.1%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative80.1%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. associate-*l/79.6%

        \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      3. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg99.9%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg99.9%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. frac-2neg99.9%

        \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      10. +-commutative99.9%

        \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      11. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      12. sub-neg99.9%

        \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      13. associate-*r/99.8%

        \[\leadsto \color{blue}{\frac{\frac{t1}{\left(-u\right) - t1} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
    6. Applied egg-rr99.8%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
    7. Taylor expanded in t1 around inf 53.9%

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    8. Step-by-step derivation
      1. mul-1-neg53.9%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    9. Simplified53.9%

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    10. Step-by-step derivation
      1. div-inv53.9%

        \[\leadsto \color{blue}{\left(-v\right) \cdot \frac{1}{t1 + u}} \]
      2. add-sqr-sqrt18.3%

        \[\leadsto \color{blue}{\left(\sqrt{-v} \cdot \sqrt{-v}\right)} \cdot \frac{1}{t1 + u} \]
      3. sqrt-unprod50.9%

        \[\leadsto \color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}} \cdot \frac{1}{t1 + u} \]
      4. sqr-neg50.9%

        \[\leadsto \sqrt{\color{blue}{v \cdot v}} \cdot \frac{1}{t1 + u} \]
      5. sqrt-unprod33.0%

        \[\leadsto \color{blue}{\left(\sqrt{v} \cdot \sqrt{v}\right)} \cdot \frac{1}{t1 + u} \]
      6. add-sqr-sqrt51.4%

        \[\leadsto \color{blue}{v} \cdot \frac{1}{t1 + u} \]
      7. +-commutative51.4%

        \[\leadsto v \cdot \frac{1}{\color{blue}{u + t1}} \]
    11. Applied egg-rr51.4%

      \[\leadsto \color{blue}{v \cdot \frac{1}{u + t1}} \]
    12. Step-by-step derivation
      1. associate-*r/51.4%

        \[\leadsto \color{blue}{\frac{v \cdot 1}{u + t1}} \]
      2. *-rgt-identity51.4%

        \[\leadsto \frac{\color{blue}{v}}{u + t1} \]
    13. Simplified51.4%

      \[\leadsto \color{blue}{\frac{v}{u + t1}} \]
    14. Taylor expanded in u around inf 51.4%

      \[\leadsto \color{blue}{\frac{v}{u}} \]

    if -2.50000000000000013e116 < u < 1.75e230

    1. Initial program 72.8%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/78.4%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative78.4%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified78.4%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 64.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{v}{t1}} \]
    6. Step-by-step derivation
      1. associate-*r/64.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot v}{t1}} \]
      2. neg-mul-164.6%

        \[\leadsto \frac{\color{blue}{-v}}{t1} \]
    7. Simplified64.6%

      \[\leadsto \color{blue}{\frac{-v}{t1}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification61.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.5 \cdot 10^{+116} \lor \neg \left(u \leq 1.75 \cdot 10^{+230}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;-\frac{v}{t1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 23.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -3.5 \cdot 10^{+117} \lor \neg \left(t1 \leq 8.5 \cdot 10^{+62}\right):\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -3.5e+117) (not (<= t1 8.5e+62))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -3.5e+117) || !(t1 <= 8.5e+62)) {
		tmp = v / t1;
	} else {
		tmp = v / u;
	}
	return tmp;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    real(8) :: tmp
    if ((t1 <= (-3.5d+117)) .or. (.not. (t1 <= 8.5d+62))) then
        tmp = v / t1
    else
        tmp = v / u
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -3.5e+117) || !(t1 <= 8.5e+62)) {
		tmp = v / t1;
	} else {
		tmp = v / u;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -3.5e+117) or not (t1 <= 8.5e+62):
		tmp = v / t1
	else:
		tmp = v / u
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -3.5e+117) || !(t1 <= 8.5e+62))
		tmp = Float64(v / t1);
	else
		tmp = Float64(v / u);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -3.5e+117) || ~((t1 <= 8.5e+62)))
		tmp = v / t1;
	else
		tmp = v / u;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -3.5e+117], N[Not[LessEqual[t1, 8.5e+62]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -3.5 \cdot 10^{+117} \lor \neg \left(t1 \leq 8.5 \cdot 10^{+62}\right):\\
\;\;\;\;\frac{v}{t1}\\

\mathbf{else}:\\
\;\;\;\;\frac{v}{u}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -3.49999999999999983e117 or 8.4999999999999997e62 < t1

    1. Initial program 48.2%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. times-frac99.9%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      2. distribute-frac-neg99.9%

        \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
      3. distribute-neg-frac299.9%

        \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      4. +-commutative99.9%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      5. distribute-neg-in99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      6. unsub-neg99.9%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
    4. Add Preprocessing
    5. Taylor expanded in t1 around inf 87.7%

      \[\leadsto \color{blue}{\left(\frac{u}{t1} - 1\right)} \cdot \frac{v}{t1 + u} \]
    6. Taylor expanded in u around inf 35.3%

      \[\leadsto \color{blue}{\frac{v}{t1}} \]

    if -3.49999999999999983e117 < t1 < 8.4999999999999997e62

    1. Initial program 86.3%

      \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
    2. Step-by-step derivation
      1. associate-*l/89.1%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. *-commutative89.1%

        \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. Simplified89.1%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutative89.1%

        \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
      2. associate-*l/86.3%

        \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
      3. times-frac97.2%

        \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
      4. frac-2neg97.2%

        \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
      5. remove-double-neg97.2%

        \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
      6. +-commutative97.2%

        \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
      7. distribute-neg-in97.2%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
      8. sub-neg97.2%

        \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
      9. frac-2neg97.2%

        \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
      10. +-commutative97.2%

        \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
      11. distribute-neg-in97.2%

        \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
      12. sub-neg97.2%

        \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
      13. associate-*r/97.7%

        \[\leadsto \color{blue}{\frac{\frac{t1}{\left(-u\right) - t1} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
    6. Applied egg-rr97.7%

      \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
    7. Taylor expanded in t1 around inf 52.8%

      \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
    8. Step-by-step derivation
      1. mul-1-neg52.8%

        \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    9. Simplified52.8%

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
    10. Step-by-step derivation
      1. div-inv52.7%

        \[\leadsto \color{blue}{\left(-v\right) \cdot \frac{1}{t1 + u}} \]
      2. add-sqr-sqrt26.9%

        \[\leadsto \color{blue}{\left(\sqrt{-v} \cdot \sqrt{-v}\right)} \cdot \frac{1}{t1 + u} \]
      3. sqrt-unprod36.6%

        \[\leadsto \color{blue}{\sqrt{\left(-v\right) \cdot \left(-v\right)}} \cdot \frac{1}{t1 + u} \]
      4. sqr-neg36.6%

        \[\leadsto \sqrt{\color{blue}{v \cdot v}} \cdot \frac{1}{t1 + u} \]
      5. sqrt-unprod12.7%

        \[\leadsto \color{blue}{\left(\sqrt{v} \cdot \sqrt{v}\right)} \cdot \frac{1}{t1 + u} \]
      6. add-sqr-sqrt21.0%

        \[\leadsto \color{blue}{v} \cdot \frac{1}{t1 + u} \]
      7. +-commutative21.0%

        \[\leadsto v \cdot \frac{1}{\color{blue}{u + t1}} \]
    11. Applied egg-rr21.0%

      \[\leadsto \color{blue}{v \cdot \frac{1}{u + t1}} \]
    12. Step-by-step derivation
      1. associate-*r/21.0%

        \[\leadsto \color{blue}{\frac{v \cdot 1}{u + t1}} \]
      2. *-rgt-identity21.0%

        \[\leadsto \frac{\color{blue}{v}}{u + t1} \]
    13. Simplified21.0%

      \[\leadsto \color{blue}{\frac{v}{u + t1}} \]
    14. Taylor expanded in u around inf 23.7%

      \[\leadsto \color{blue}{\frac{v}{u}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification27.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -3.5 \cdot 10^{+117} \lor \neg \left(t1 \leq 8.5 \cdot 10^{+62}\right):\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 98.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{t1}{t1 + u} \cdot \frac{v}{\left(-u\right) - t1} \end{array} \]
(FPCore (u v t1) :precision binary64 (* (/ t1 (+ t1 u)) (/ v (- (- u) t1))))
double code(double u, double v, double t1) {
	return (t1 / (t1 + u)) * (v / (-u - t1));
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (t1 / (t1 + u)) * (v / (-u - t1))
end function
public static double code(double u, double v, double t1) {
	return (t1 / (t1 + u)) * (v / (-u - t1));
}
def code(u, v, t1):
	return (t1 / (t1 + u)) * (v / (-u - t1))
function code(u, v, t1)
	return Float64(Float64(t1 / Float64(t1 + u)) * Float64(v / Float64(Float64(-u) - t1)))
end
function tmp = code(u, v, t1)
	tmp = (t1 / (t1 + u)) * (v / (-u - t1));
end
code[u_, v_, t1_] := N[(N[(t1 / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{t1}{t1 + u} \cdot \frac{v}{\left(-u\right) - t1}
\end{array}
Derivation
  1. Initial program 74.4%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac98.0%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    2. distribute-frac-neg98.0%

      \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
    3. distribute-neg-frac298.0%

      \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
    4. +-commutative98.0%

      \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
    5. distribute-neg-in98.0%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
    6. unsub-neg98.0%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
  3. Simplified98.0%

    \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
  4. Add Preprocessing
  5. Final simplification98.0%

    \[\leadsto \frac{t1}{t1 + u} \cdot \frac{v}{\left(-u\right) - t1} \]
  6. Add Preprocessing

Alternative 15: 61.8% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \frac{-1}{\frac{t1 + u}{v}} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ -1.0 (/ (+ t1 u) v)))
double code(double u, double v, double t1) {
	return -1.0 / ((t1 + u) / v);
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = (-1.0d0) / ((t1 + u) / v)
end function
public static double code(double u, double v, double t1) {
	return -1.0 / ((t1 + u) / v);
}
def code(u, v, t1):
	return -1.0 / ((t1 + u) / v)
function code(u, v, t1)
	return Float64(-1.0 / Float64(Float64(t1 + u) / v))
end
function tmp = code(u, v, t1)
	tmp = -1.0 / ((t1 + u) / v);
end
code[u_, v_, t1_] := N[(-1.0 / N[(N[(t1 + u), $MachinePrecision] / v), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1}{\frac{t1 + u}{v}}
\end{array}
Derivation
  1. Initial program 74.4%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac98.0%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    2. distribute-frac-neg98.0%

      \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
    3. distribute-neg-frac298.0%

      \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
    4. +-commutative98.0%

      \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
    5. distribute-neg-in98.0%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
    6. unsub-neg98.0%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
  3. Simplified98.0%

    \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
  4. Add Preprocessing
  5. Taylor expanded in t1 around inf 63.9%

    \[\leadsto \color{blue}{-1} \cdot \frac{v}{t1 + u} \]
  6. Step-by-step derivation
    1. clear-num64.7%

      \[\leadsto -1 \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
    2. un-div-inv64.7%

      \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]
  7. Applied egg-rr64.7%

    \[\leadsto \color{blue}{\frac{-1}{\frac{t1 + u}{v}}} \]
  8. Add Preprocessing

Alternative 16: 62.0% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \frac{v}{\left(-u\right) - t1} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ v (- (- u) t1)))
double code(double u, double v, double t1) {
	return v / (-u - t1);
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = v / (-u - t1)
end function
public static double code(double u, double v, double t1) {
	return v / (-u - t1);
}
def code(u, v, t1):
	return v / (-u - t1)
function code(u, v, t1)
	return Float64(v / Float64(Float64(-u) - t1))
end
function tmp = code(u, v, t1)
	tmp = v / (-u - t1);
end
code[u_, v_, t1_] := N[(v / N[((-u) - t1), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{v}{\left(-u\right) - t1}
\end{array}
Derivation
  1. Initial program 74.4%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. associate-*l/78.8%

      \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
    2. *-commutative78.8%

      \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  3. Simplified78.8%

    \[\leadsto \color{blue}{v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. *-commutative78.8%

      \[\leadsto \color{blue}{\frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \cdot v} \]
    2. associate-*l/74.4%

      \[\leadsto \color{blue}{\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)}} \]
    3. times-frac98.0%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. frac-2neg98.0%

      \[\leadsto \color{blue}{\frac{-\left(-t1\right)}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
    5. remove-double-neg98.0%

      \[\leadsto \frac{\color{blue}{t1}}{-\left(t1 + u\right)} \cdot \frac{v}{t1 + u} \]
    6. +-commutative98.0%

      \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
    7. distribute-neg-in98.0%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
    8. sub-neg98.0%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
    9. frac-2neg98.0%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \color{blue}{\frac{-v}{-\left(t1 + u\right)}} \]
    10. +-commutative98.0%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{-\color{blue}{\left(u + t1\right)}} \]
    11. distribute-neg-in98.0%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \]
    12. sub-neg98.0%

      \[\leadsto \frac{t1}{\left(-u\right) - t1} \cdot \frac{-v}{\color{blue}{\left(-u\right) - t1}} \]
    13. associate-*r/98.4%

      \[\leadsto \color{blue}{\frac{\frac{t1}{\left(-u\right) - t1} \cdot \left(-v\right)}{\left(-u\right) - t1}} \]
  6. Applied egg-rr98.4%

    \[\leadsto \color{blue}{\frac{\frac{t1}{t1 + u} \cdot \left(-v\right)}{t1 + u}} \]
  7. Taylor expanded in t1 around inf 63.9%

    \[\leadsto \frac{\color{blue}{-1 \cdot v}}{t1 + u} \]
  8. Step-by-step derivation
    1. mul-1-neg63.9%

      \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
  9. Simplified63.9%

    \[\leadsto \frac{\color{blue}{-v}}{t1 + u} \]
  10. Final simplification63.9%

    \[\leadsto \frac{v}{\left(-u\right) - t1} \]
  11. Add Preprocessing

Alternative 17: 14.1% accurate, 4.0× speedup?

\[\begin{array}{l} \\ \frac{v}{t1} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ v t1))
double code(double u, double v, double t1) {
	return v / t1;
}
real(8) function code(u, v, t1)
    real(8), intent (in) :: u
    real(8), intent (in) :: v
    real(8), intent (in) :: t1
    code = v / t1
end function
public static double code(double u, double v, double t1) {
	return v / t1;
}
def code(u, v, t1):
	return v / t1
function code(u, v, t1)
	return Float64(v / t1)
end
function tmp = code(u, v, t1)
	tmp = v / t1;
end
code[u_, v_, t1_] := N[(v / t1), $MachinePrecision]
\begin{array}{l}

\\
\frac{v}{t1}
\end{array}
Derivation
  1. Initial program 74.4%

    \[\frac{\left(-t1\right) \cdot v}{\left(t1 + u\right) \cdot \left(t1 + u\right)} \]
  2. Step-by-step derivation
    1. times-frac98.0%

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    2. distribute-frac-neg98.0%

      \[\leadsto \color{blue}{\left(-\frac{t1}{t1 + u}\right)} \cdot \frac{v}{t1 + u} \]
    3. distribute-neg-frac298.0%

      \[\leadsto \color{blue}{\frac{t1}{-\left(t1 + u\right)}} \cdot \frac{v}{t1 + u} \]
    4. +-commutative98.0%

      \[\leadsto \frac{t1}{-\color{blue}{\left(u + t1\right)}} \cdot \frac{v}{t1 + u} \]
    5. distribute-neg-in98.0%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) + \left(-t1\right)}} \cdot \frac{v}{t1 + u} \]
    6. unsub-neg98.0%

      \[\leadsto \frac{t1}{\color{blue}{\left(-u\right) - t1}} \cdot \frac{v}{t1 + u} \]
  3. Simplified98.0%

    \[\leadsto \color{blue}{\frac{t1}{\left(-u\right) - t1} \cdot \frac{v}{t1 + u}} \]
  4. Add Preprocessing
  5. Taylor expanded in t1 around inf 57.5%

    \[\leadsto \color{blue}{\left(\frac{u}{t1} - 1\right)} \cdot \frac{v}{t1 + u} \]
  6. Taylor expanded in u around inf 13.3%

    \[\leadsto \color{blue}{\frac{v}{t1}} \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2024172 
(FPCore (u v t1)
  :name "Rosa's DopplerBench"
  :precision binary64
  (/ (* (- t1) v) (* (+ t1 u) (+ t1 u))))