Rosa's DopplerBench

Percentage Accurate: 73.2% → 98.1%
Time: 9.7s
Alternatives: 12
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 12 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: 73.2% 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.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u} \end{array} \]
(FPCore (u v t1) :precision binary64 (* (/ (- t1) (+ t1 u)) (/ v (+ t1 u))))
double code(double u, double v, double t1) {
	return (-t1 / (t1 + u)) * (v / (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 / (t1 + u)) * (v / (t1 + u))
end function
public static double code(double u, double v, double t1) {
	return (-t1 / (t1 + u)) * (v / (t1 + u));
}
def code(u, v, t1):
	return (-t1 / (t1 + u)) * (v / (t1 + u))
function code(u, v, t1)
	return Float64(Float64(Float64(-t1) / Float64(t1 + u)) * Float64(v / Float64(t1 + u)))
end
function tmp = code(u, v, t1)
	tmp = (-t1 / (t1 + u)) * (v / (t1 + u));
end
code[u_, v_, t1_] := N[(N[((-t1) / N[(t1 + u), $MachinePrecision]), $MachinePrecision] * N[(v / N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

Alternative 2: 89.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ t_2 := \frac{v}{u \cdot -2 - t1}\\ \mathbf{if}\;t1 \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t1 \leq -7.2 \cdot 10^{-166}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t1 \leq 1.9 \cdot 10^{-165}:\\ \;\;\;\;\frac{-t1}{u \cdot \frac{u}{v}}\\ \mathbf{elif}\;t1 \leq 9.8 \cdot 10^{+117}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (let* ((t_1 (* v (/ (- t1) (* (+ t1 u) (+ t1 u)))))
        (t_2 (/ v (- (* u -2.0) t1))))
   (if (<= t1 -1.35e+154)
     t_2
     (if (<= t1 -7.2e-166)
       t_1
       (if (<= t1 1.9e-165)
         (/ (- t1) (* u (/ u v)))
         (if (<= t1 9.8e+117) t_1 t_2))))))
double code(double u, double v, double t1) {
	double t_1 = v * (-t1 / ((t1 + u) * (t1 + u)));
	double t_2 = v / ((u * -2.0) - t1);
	double tmp;
	if (t1 <= -1.35e+154) {
		tmp = t_2;
	} else if (t1 <= -7.2e-166) {
		tmp = t_1;
	} else if (t1 <= 1.9e-165) {
		tmp = -t1 / (u * (u / v));
	} else if (t1 <= 9.8e+117) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = v * (-t1 / ((t1 + u) * (t1 + u)))
    t_2 = v / ((u * (-2.0d0)) - t1)
    if (t1 <= (-1.35d+154)) then
        tmp = t_2
    else if (t1 <= (-7.2d-166)) then
        tmp = t_1
    else if (t1 <= 1.9d-165) then
        tmp = -t1 / (u * (u / v))
    else if (t1 <= 9.8d+117) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double t_1 = v * (-t1 / ((t1 + u) * (t1 + u)));
	double t_2 = v / ((u * -2.0) - t1);
	double tmp;
	if (t1 <= -1.35e+154) {
		tmp = t_2;
	} else if (t1 <= -7.2e-166) {
		tmp = t_1;
	} else if (t1 <= 1.9e-165) {
		tmp = -t1 / (u * (u / v));
	} else if (t1 <= 9.8e+117) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(u, v, t1):
	t_1 = v * (-t1 / ((t1 + u) * (t1 + u)))
	t_2 = v / ((u * -2.0) - t1)
	tmp = 0
	if t1 <= -1.35e+154:
		tmp = t_2
	elif t1 <= -7.2e-166:
		tmp = t_1
	elif t1 <= 1.9e-165:
		tmp = -t1 / (u * (u / v))
	elif t1 <= 9.8e+117:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(u, v, t1)
	t_1 = Float64(v * Float64(Float64(-t1) / Float64(Float64(t1 + u) * Float64(t1 + u))))
	t_2 = Float64(v / Float64(Float64(u * -2.0) - t1))
	tmp = 0.0
	if (t1 <= -1.35e+154)
		tmp = t_2;
	elseif (t1 <= -7.2e-166)
		tmp = t_1;
	elseif (t1 <= 1.9e-165)
		tmp = Float64(Float64(-t1) / Float64(u * Float64(u / v)));
	elseif (t1 <= 9.8e+117)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	t_1 = v * (-t1 / ((t1 + u) * (t1 + u)));
	t_2 = v / ((u * -2.0) - t1);
	tmp = 0.0;
	if (t1 <= -1.35e+154)
		tmp = t_2;
	elseif (t1 <= -7.2e-166)
		tmp = t_1;
	elseif (t1 <= 1.9e-165)
		tmp = -t1 / (u * (u / v));
	elseif (t1 <= 9.8e+117)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := Block[{t$95$1 = N[(v * N[((-t1) / N[(N[(t1 + u), $MachinePrecision] * N[(t1 + u), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t1, -1.35e+154], t$95$2, If[LessEqual[t1, -7.2e-166], t$95$1, If[LessEqual[t1, 1.9e-165], N[((-t1) / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t1, 9.8e+117], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\
t_2 := \frac{v}{u \cdot -2 - t1}\\
\mathbf{if}\;t1 \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t1 \leq -7.2 \cdot 10^{-166}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t1 \leq 9.8 \cdot 10^{+117}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t1 < -1.35000000000000003e154 or 9.8000000000000002e117 < t1

    1. Initial program 47.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{t1 + u}{-1 \cdot -1} \cdot \frac{t1 + u}{t1}}} \]
      10. metadata-eval98.9%

        \[\leadsto \frac{-v}{\frac{t1 + u}{\color{blue}{1}} \cdot \frac{t1 + u}{t1}} \]
      11. /-rgt-identity98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto v \cdot \frac{1}{-\color{blue}{\mathsf{fma}\left(u, 2, t1\right)}} \]
    8. Applied egg-rr91.4%

      \[\leadsto \color{blue}{v \cdot \frac{1}{-\mathsf{fma}\left(u, 2, t1\right)}} \]
    9. Step-by-step derivation
      1. associate-*r/91.7%

        \[\leadsto \color{blue}{\frac{v \cdot 1}{-\mathsf{fma}\left(u, 2, t1\right)}} \]
      2. *-rgt-identity91.7%

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

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

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

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

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

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

        \[\leadsto \frac{v}{u \cdot \color{blue}{-2} - t1} \]
    10. Simplified91.7%

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

    if -1.35000000000000003e154 < t1 < -7.2000000000000002e-166 or 1.90000000000000009e-165 < t1 < 9.8000000000000002e117

    1. Initial program 90.6%

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

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

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

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

    if -7.2000000000000002e-166 < t1 < 1.90000000000000009e-165

    1. Initial program 75.0%

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

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    6. Step-by-step derivation
      1. mul-1-neg92.6%

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

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

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

        \[\leadsto \color{blue}{\frac{-\frac{t1}{u}}{\frac{u}{v}}} \]
      3. distribute-neg-frac93.3%

        \[\leadsto \frac{\color{blue}{\frac{-t1}{u}}}{\frac{u}{v}} \]
      4. associate-/l/94.2%

        \[\leadsto \color{blue}{\frac{-t1}{\frac{u}{v} \cdot u}} \]
    9. Applied egg-rr94.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{elif}\;t1 \leq -7.2 \cdot 10^{-166}:\\ \;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{elif}\;t1 \leq 1.9 \cdot 10^{-165}:\\ \;\;\;\;\frac{-t1}{u \cdot \frac{u}{v}}\\ \mathbf{elif}\;t1 \leq 9.8 \cdot 10^{+117}:\\ \;\;\;\;v \cdot \frac{-t1}{\left(t1 + u\right) \cdot \left(t1 + u\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \]

Alternative 3: 80.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -1.5 \cdot 10^{-10} \lor \neg \left(t1 \leq 1.25 \cdot 10^{-45}\right):\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -1.5e-10) (not (<= t1 1.25e-45)))
   (/ v (- (* u -2.0) t1))
   (* (/ (- t1) u) (/ v u))))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -1.5e-10) || !(t1 <= 1.25e-45)) {
		tmp = v / ((u * -2.0) - t1);
	} else {
		tmp = (-t1 / u) * (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 <= (-1.5d-10)) .or. (.not. (t1 <= 1.25d-45))) then
        tmp = v / ((u * (-2.0d0)) - t1)
    else
        tmp = (-t1 / u) * (v / u)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -1.5e-10) || !(t1 <= 1.25e-45)) {
		tmp = v / ((u * -2.0) - t1);
	} else {
		tmp = (-t1 / u) * (v / u);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -1.5e-10) or not (t1 <= 1.25e-45):
		tmp = v / ((u * -2.0) - t1)
	else:
		tmp = (-t1 / u) * (v / u)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -1.5e-10) || !(t1 <= 1.25e-45))
		tmp = Float64(v / Float64(Float64(u * -2.0) - t1));
	else
		tmp = Float64(Float64(Float64(-t1) / u) * Float64(v / u));
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if ((t1 <= -1.5e-10) || ~((t1 <= 1.25e-45)))
		tmp = v / ((u * -2.0) - t1);
	else
		tmp = (-t1 / u) * (v / u);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -1.5e-10], N[Not[LessEqual[t1, 1.25e-45]], $MachinePrecision]], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision], N[(N[((-t1) / u), $MachinePrecision] * N[(v / u), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -1.5 \cdot 10^{-10} \lor \neg \left(t1 \leq 1.25 \cdot 10^{-45}\right):\\
\;\;\;\;\frac{v}{u \cdot -2 - t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -1.5e-10 or 1.24999999999999994e-45 < t1

    1. Initial program 66.0%

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\frac{\color{blue}{\frac{\left(t1 + u\right) \cdot \left(t1 + u\right)}{1}}}{t1}} \]
      7. metadata-eval68.9%

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{t1 + u}{-1 \cdot -1} \cdot \frac{t1 + u}{t1}}} \]
      10. metadata-eval97.9%

        \[\leadsto \frac{-v}{\frac{t1 + u}{\color{blue}{1}} \cdot \frac{t1 + u}{t1}} \]
      11. /-rgt-identity97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto v \cdot \frac{1}{-\color{blue}{\mathsf{fma}\left(u, 2, t1\right)}} \]
    8. Applied egg-rr86.0%

      \[\leadsto \color{blue}{v \cdot \frac{1}{-\mathsf{fma}\left(u, 2, t1\right)}} \]
    9. Step-by-step derivation
      1. associate-*r/86.3%

        \[\leadsto \color{blue}{\frac{v \cdot 1}{-\mathsf{fma}\left(u, 2, t1\right)}} \]
      2. *-rgt-identity86.3%

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

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

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

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

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

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

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

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

    if -1.5e-10 < t1 < 1.24999999999999994e-45

    1. Initial program 82.6%

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

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    6. Step-by-step derivation
      1. mul-1-neg86.6%

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

      \[\leadsto \color{blue}{\left(-\frac{t1}{u}\right)} \cdot \frac{v}{u} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification86.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -1.5 \cdot 10^{-10} \lor \neg \left(t1 \leq 1.25 \cdot 10^{-45}\right):\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t1}{u} \cdot \frac{v}{u}\\ \end{array} \]

Alternative 4: 67.1% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -3 \cdot 10^{+20} \lor \neg \left(u \leq 48000000000\right):\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -3e+20) (not (<= u 48000000000.0)))
   (/ t1 (* u (/ u v)))
   (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -3e+20) || !(u <= 48000000000.0)) {
		tmp = t1 / (u * (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 <= (-3d+20)) .or. (.not. (u <= 48000000000.0d0))) then
        tmp = t1 / (u * (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 <= -3e+20) || !(u <= 48000000000.0)) {
		tmp = t1 / (u * (u / v));
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -3e+20) or not (u <= 48000000000.0):
		tmp = t1 / (u * (u / v))
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -3e+20) || !(u <= 48000000000.0))
		tmp = Float64(t1 / Float64(u * 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 <= -3e+20) || ~((u <= 48000000000.0)))
		tmp = t1 / (u * (u / v));
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -3e+20], N[Not[LessEqual[u, 48000000000.0]], $MachinePrecision]], N[(t1 / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -3 \cdot 10^{+20} \lor \neg \left(u \leq 48000000000\right):\\
\;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -3e20 or 4.8e10 < u

    1. Initial program 85.7%

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

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    6. Step-by-step derivation
      1. mul-1-neg88.4%

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

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

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

        \[\leadsto \color{blue}{\frac{-\frac{t1}{u}}{\frac{u}{v}}} \]
      3. add-sqr-sqrt53.0%

        \[\leadsto \frac{\color{blue}{\sqrt{-\frac{t1}{u}} \cdot \sqrt{-\frac{t1}{u}}}}{\frac{u}{v}} \]
      4. sqrt-unprod72.3%

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

        \[\leadsto \frac{\sqrt{\color{blue}{\frac{t1}{u} \cdot \frac{t1}{u}}}}{\frac{u}{v}} \]
      6. sqrt-unprod50.3%

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

        \[\leadsto \frac{\color{blue}{\frac{t1}{u}}}{\frac{u}{v}} \]
      8. associate-/l/70.5%

        \[\leadsto \color{blue}{\frac{t1}{\frac{u}{v} \cdot u}} \]
    9. Applied egg-rr70.5%

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

    if -3e20 < u < 4.8e10

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{t1 + u}{-1 \cdot -1} \cdot \frac{t1 + u}{t1}}} \]
      10. metadata-eval99.9%

        \[\leadsto \frac{-v}{\frac{t1 + u}{\color{blue}{1}} \cdot \frac{t1 + u}{t1}} \]
      11. /-rgt-identity99.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -3 \cdot 10^{+20} \lor \neg \left(u \leq 48000000000\right):\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 5: 66.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.75 \cdot 10^{+21} \lor \neg \left(u \leq 1.6 \cdot 10^{-6}\right):\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -1.75e+21) (not (<= u 1.6e-6)))
   (/ t1 (* u (/ u v)))
   (/ v (- (* u -2.0) t1))))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -1.75e+21) || !(u <= 1.6e-6)) {
		tmp = t1 / (u * (u / v));
	} 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 ((u <= (-1.75d+21)) .or. (.not. (u <= 1.6d-6))) then
        tmp = t1 / (u * (u / v))
    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 ((u <= -1.75e+21) || !(u <= 1.6e-6)) {
		tmp = t1 / (u * (u / v));
	} else {
		tmp = v / ((u * -2.0) - t1);
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -1.75e+21) or not (u <= 1.6e-6):
		tmp = t1 / (u * (u / v))
	else:
		tmp = v / ((u * -2.0) - t1)
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -1.75e+21) || !(u <= 1.6e-6))
		tmp = Float64(t1 / Float64(u * Float64(u / v)));
	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 ((u <= -1.75e+21) || ~((u <= 1.6e-6)))
		tmp = t1 / (u * (u / v));
	else
		tmp = v / ((u * -2.0) - t1);
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.75e+21], N[Not[LessEqual[u, 1.6e-6]], $MachinePrecision]], N[(t1 / N[(u * N[(u / v), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(v / N[(N[(u * -2.0), $MachinePrecision] - t1), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.75 \cdot 10^{+21} \lor \neg \left(u \leq 1.6 \cdot 10^{-6}\right):\\
\;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.75e21 or 1.5999999999999999e-6 < u

    1. Initial program 85.9%

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

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{t1}{u}\right)} \cdot \frac{v}{u} \]
    6. Step-by-step derivation
      1. mul-1-neg88.5%

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

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

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

        \[\leadsto \color{blue}{\frac{-\frac{t1}{u}}{\frac{u}{v}}} \]
      3. add-sqr-sqrt53.0%

        \[\leadsto \frac{\color{blue}{\sqrt{-\frac{t1}{u}} \cdot \sqrt{-\frac{t1}{u}}}}{\frac{u}{v}} \]
      4. sqrt-unprod72.0%

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

        \[\leadsto \frac{\sqrt{\color{blue}{\frac{t1}{u} \cdot \frac{t1}{u}}}}{\frac{u}{v}} \]
      6. sqrt-unprod49.5%

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

        \[\leadsto \frac{\color{blue}{\frac{t1}{u}}}{\frac{u}{v}} \]
      8. associate-/l/69.4%

        \[\leadsto \color{blue}{\frac{t1}{\frac{u}{v} \cdot u}} \]
    9. Applied egg-rr69.4%

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

    if -1.75e21 < u < 1.5999999999999999e-6

    1. Initial program 62.7%

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\frac{\color{blue}{\frac{\left(t1 + u\right) \cdot \left(t1 + u\right)}{1}}}{t1}} \]
      7. metadata-eval71.9%

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{t1 + u}{-1 \cdot -1} \cdot \frac{t1 + u}{t1}}} \]
      10. metadata-eval99.9%

        \[\leadsto \frac{-v}{\frac{t1 + u}{\color{blue}{1}} \cdot \frac{t1 + u}{t1}} \]
      11. /-rgt-identity99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto v \cdot \frac{1}{-\color{blue}{\mathsf{fma}\left(u, 2, t1\right)}} \]
    8. Applied egg-rr79.3%

      \[\leadsto \color{blue}{v \cdot \frac{1}{-\mathsf{fma}\left(u, 2, t1\right)}} \]
    9. Step-by-step derivation
      1. associate-*r/79.6%

        \[\leadsto \color{blue}{\frac{v \cdot 1}{-\mathsf{fma}\left(u, 2, t1\right)}} \]
      2. *-rgt-identity79.6%

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

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

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

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

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

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

        \[\leadsto \frac{v}{u \cdot \color{blue}{-2} - t1} \]
    10. Simplified79.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.75 \cdot 10^{+21} \lor \neg \left(u \leq 1.6 \cdot 10^{-6}\right):\\ \;\;\;\;\frac{t1}{u \cdot \frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u \cdot -2 - t1}\\ \end{array} \]

Alternative 6: 58.4% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.7 \cdot 10^{+131} \lor \neg \left(u \leq 7.2 \cdot 10^{+193}\right):\\ \;\;\;\;\frac{-0.5}{\frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -1.7e+131) (not (<= u 7.2e+193)))
   (/ -0.5 (/ u v))
   (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -1.7e+131) || !(u <= 7.2e+193)) {
		tmp = -0.5 / (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 <= (-1.7d+131)) .or. (.not. (u <= 7.2d+193))) then
        tmp = (-0.5d0) / (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 <= -1.7e+131) || !(u <= 7.2e+193)) {
		tmp = -0.5 / (u / v);
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -1.7e+131) or not (u <= 7.2e+193):
		tmp = -0.5 / (u / v)
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -1.7e+131) || !(u <= 7.2e+193))
		tmp = Float64(-0.5 / 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 <= -1.7e+131) || ~((u <= 7.2e+193)))
		tmp = -0.5 / (u / v);
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -1.7e+131], N[Not[LessEqual[u, 7.2e+193]], $MachinePrecision]], N[(-0.5 / N[(u / v), $MachinePrecision]), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.7 \cdot 10^{+131} \lor \neg \left(u \leq 7.2 \cdot 10^{+193}\right):\\
\;\;\;\;\frac{-0.5}{\frac{u}{v}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -1.69999999999999993e131 or 7.2e193 < u

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{t1 + u}{-1 \cdot -1} \cdot \frac{t1 + u}{t1}}} \]
      10. metadata-eval91.4%

        \[\leadsto \frac{-v}{\frac{t1 + u}{\color{blue}{1}} \cdot \frac{t1 + u}{t1}} \]
      11. /-rgt-identity91.4%

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\left(t1 + u\right) \cdot \left(\frac{u}{t1} + \color{blue}{\frac{-\left(-t1\right)}{t1}}\right)} \]
      18. remove-double-neg91.4%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{u}{v}}} \]
    9. Simplified46.2%

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

    if -1.69999999999999993e131 < u < 7.2e193

    1. Initial program 69.7%

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\frac{\color{blue}{\frac{\left(t1 + u\right) \cdot \left(t1 + u\right)}{1}}}{t1}} \]
      7. metadata-eval73.9%

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

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

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

        \[\leadsto \frac{-v}{\frac{t1 + u}{\color{blue}{1}} \cdot \frac{t1 + u}{t1}} \]
      11. /-rgt-identity97.7%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.7 \cdot 10^{+131} \lor \neg \left(u \leq 7.2 \cdot 10^{+193}\right):\\ \;\;\;\;\frac{-0.5}{\frac{u}{v}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 7: 58.2% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -2.8 \cdot 10^{+139}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{elif}\;u \leq 5.8 \cdot 10^{+192}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u} \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -2.8e+139)
   (/ v u)
   (if (<= u 5.8e+192) (/ (- v) t1) (* (/ v u) -0.5))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -2.8e+139) {
		tmp = v / u;
	} else if (u <= 5.8e+192) {
		tmp = -v / t1;
	} else {
		tmp = (v / u) * -0.5;
	}
	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+139)) then
        tmp = v / u
    else if (u <= 5.8d+192) then
        tmp = -v / t1
    else
        tmp = (v / u) * (-0.5d0)
    end if
    code = tmp
end function
public static double code(double u, double v, double t1) {
	double tmp;
	if (u <= -2.8e+139) {
		tmp = v / u;
	} else if (u <= 5.8e+192) {
		tmp = -v / t1;
	} else {
		tmp = (v / u) * -0.5;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -2.8e+139:
		tmp = v / u
	elif u <= 5.8e+192:
		tmp = -v / t1
	else:
		tmp = (v / u) * -0.5
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -2.8e+139)
		tmp = Float64(v / u);
	elseif (u <= 5.8e+192)
		tmp = Float64(Float64(-v) / t1);
	else
		tmp = Float64(Float64(v / u) * -0.5);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -2.8e+139)
		tmp = v / u;
	elseif (u <= 5.8e+192)
		tmp = -v / t1;
	else
		tmp = (v / u) * -0.5;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -2.8e+139], N[(v / u), $MachinePrecision], If[LessEqual[u, 5.8e+192], N[((-v) / t1), $MachinePrecision], N[(N[(v / u), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 86.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}} \]
    3. Simplified99.9%

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-t1}{t1 + u} \cdot \frac{v}{u}\right)\right)} \]
      2. expm1-udef86.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-t1}{t1 + u} \cdot \frac{v}{u}\right)} - 1} \]
    6. Applied egg-rr86.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{v}{u \cdot \frac{t1 - u}{t1}}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def89.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{v}{u \cdot \frac{t1 - u}{t1}}\right)\right)} \]
      2. expm1-log1p89.0%

        \[\leadsto \color{blue}{\frac{v}{u \cdot \frac{t1 - u}{t1}}} \]
      3. associate-/r*99.7%

        \[\leadsto \color{blue}{\frac{\frac{v}{u}}{\frac{t1 - u}{t1}}} \]
      4. associate-/r/98.6%

        \[\leadsto \color{blue}{\frac{\frac{v}{u}}{t1 - u} \cdot t1} \]
      5. *-commutative98.6%

        \[\leadsto \color{blue}{t1 \cdot \frac{\frac{v}{u}}{t1 - u}} \]
    8. Simplified98.6%

      \[\leadsto \color{blue}{t1 \cdot \frac{\frac{v}{u}}{t1 - u}} \]
    9. Taylor expanded in t1 around inf 41.5%

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

    if -2.7999999999999998e139 < u < 5.8000000000000003e192

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\frac{t1 + u}{\color{blue}{1}} \cdot \frac{t1 + u}{t1}} \]
      11. /-rgt-identity97.7%

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

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

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

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

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

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

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

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

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

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

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

    if 5.8000000000000003e192 < u

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\color{blue}{\frac{t1 + u}{-1 \cdot -1} \cdot \frac{t1 + u}{t1}}} \]
      10. metadata-eval93.6%

        \[\leadsto \frac{-v}{\frac{t1 + u}{\color{blue}{1}} \cdot \frac{t1 + u}{t1}} \]
      11. /-rgt-identity93.6%

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

        \[\leadsto \frac{-v}{\left(t1 + u\right) \cdot \frac{\color{blue}{u + t1}}{t1}} \]
      13. remove-double-neg93.6%

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

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

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

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

        \[\leadsto \frac{-v}{\left(t1 + u\right) \cdot \left(\frac{u}{t1} + \color{blue}{\frac{-\left(-t1\right)}{t1}}\right)} \]
      18. remove-double-neg93.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{v}{u}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification59.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -2.8 \cdot 10^{+139}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{elif}\;u \leq 5.8 \cdot 10^{+192}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u} \cdot -0.5\\ \end{array} \]

Alternative 8: 58.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -5.9 \cdot 10^{+138} \lor \neg \left(u \leq 2.1 \cdot 10^{+193}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= u -5.9e+138) (not (<= u 2.1e+193))) (/ v u) (/ (- v) t1)))
double code(double u, double v, double t1) {
	double tmp;
	if ((u <= -5.9e+138) || !(u <= 2.1e+193)) {
		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 <= (-5.9d+138)) .or. (.not. (u <= 2.1d+193))) 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 <= -5.9e+138) || !(u <= 2.1e+193)) {
		tmp = v / u;
	} else {
		tmp = -v / t1;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (u <= -5.9e+138) or not (u <= 2.1e+193):
		tmp = v / u
	else:
		tmp = -v / t1
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((u <= -5.9e+138) || !(u <= 2.1e+193))
		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 <= -5.9e+138) || ~((u <= 2.1e+193)))
		tmp = v / u;
	else
		tmp = -v / t1;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[u, -5.9e+138], N[Not[LessEqual[u, 2.1e+193]], $MachinePrecision]], N[(v / u), $MachinePrecision], N[((-v) / t1), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -5.9 \cdot 10^{+138} \lor \neg \left(u \leq 2.1 \cdot 10^{+193}\right):\\
\;\;\;\;\frac{v}{u}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if u < -5.8999999999999999e138 or 2.1e193 < u

    1. Initial program 86.4%

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

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

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

      \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{v}{u}} \]
    5. Step-by-step derivation
      1. expm1-log1p-u96.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-t1}{t1 + u} \cdot \frac{v}{u}\right)\right)} \]
      2. expm1-udef86.5%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-t1}{t1 + u} \cdot \frac{v}{u}\right)} - 1} \]
    6. Applied egg-rr86.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{v}{u \cdot \frac{t1 - u}{t1}}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def88.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{v}{u \cdot \frac{t1 - u}{t1}}\right)\right)} \]
      2. expm1-log1p89.6%

        \[\leadsto \color{blue}{\frac{v}{u \cdot \frac{t1 - u}{t1}}} \]
      3. associate-/r*98.4%

        \[\leadsto \color{blue}{\frac{\frac{v}{u}}{\frac{t1 - u}{t1}}} \]
      4. associate-/r/94.9%

        \[\leadsto \color{blue}{\frac{\frac{v}{u}}{t1 - u} \cdot t1} \]
      5. *-commutative94.9%

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

      \[\leadsto \color{blue}{t1 \cdot \frac{\frac{v}{u}}{t1 - u}} \]
    9. Taylor expanded in t1 around inf 44.8%

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

    if -5.8999999999999999e138 < u < 2.1e193

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\frac{t1 + u}{\color{blue}{1}} \cdot \frac{t1 + u}{t1}} \]
      11. /-rgt-identity97.7%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -5.9 \cdot 10^{+138} \lor \neg \left(u \leq 2.1 \cdot 10^{+193}\right):\\ \;\;\;\;\frac{v}{u}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{t1}\\ \end{array} \]

Alternative 9: 58.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;u \leq -1.96 \cdot 10^{+139}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{elif}\;u \leq 2.2 \cdot 10^{+193}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (<= u -1.96e+139) (/ v u) (if (<= u 2.2e+193) (/ (- v) t1) (/ (- v) u))))
double code(double u, double v, double t1) {
	double tmp;
	if (u <= -1.96e+139) {
		tmp = v / u;
	} else if (u <= 2.2e+193) {
		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 (u <= (-1.96d+139)) then
        tmp = v / u
    else if (u <= 2.2d+193) 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 (u <= -1.96e+139) {
		tmp = v / u;
	} else if (u <= 2.2e+193) {
		tmp = -v / t1;
	} else {
		tmp = -v / u;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if u <= -1.96e+139:
		tmp = v / u
	elif u <= 2.2e+193:
		tmp = -v / t1
	else:
		tmp = -v / u
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if (u <= -1.96e+139)
		tmp = Float64(v / u);
	elseif (u <= 2.2e+193)
		tmp = Float64(Float64(-v) / t1);
	else
		tmp = Float64(Float64(-v) / u);
	end
	return tmp
end
function tmp_2 = code(u, v, t1)
	tmp = 0.0;
	if (u <= -1.96e+139)
		tmp = v / u;
	elseif (u <= 2.2e+193)
		tmp = -v / t1;
	else
		tmp = -v / u;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[LessEqual[u, -1.96e+139], N[(v / u), $MachinePrecision], If[LessEqual[u, 2.2e+193], N[((-v) / t1), $MachinePrecision], N[((-v) / u), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;u \leq -1.96 \cdot 10^{+139}:\\
\;\;\;\;\frac{v}{u}\\

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

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


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

    1. Initial program 86.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}} \]
    3. Simplified99.9%

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

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

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-t1}{t1 + u} \cdot \frac{v}{u}\right)\right)} \]
      2. expm1-udef86.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-t1}{t1 + u} \cdot \frac{v}{u}\right)} - 1} \]
    6. Applied egg-rr86.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{v}{u \cdot \frac{t1 - u}{t1}}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def89.0%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{v}{u \cdot \frac{t1 - u}{t1}}\right)\right)} \]
      2. expm1-log1p89.0%

        \[\leadsto \color{blue}{\frac{v}{u \cdot \frac{t1 - u}{t1}}} \]
      3. associate-/r*99.7%

        \[\leadsto \color{blue}{\frac{\frac{v}{u}}{\frac{t1 - u}{t1}}} \]
      4. associate-/r/98.6%

        \[\leadsto \color{blue}{\frac{\frac{v}{u}}{t1 - u} \cdot t1} \]
      5. *-commutative98.6%

        \[\leadsto \color{blue}{t1 \cdot \frac{\frac{v}{u}}{t1 - u}} \]
    8. Simplified98.6%

      \[\leadsto \color{blue}{t1 \cdot \frac{\frac{v}{u}}{t1 - u}} \]
    9. Taylor expanded in t1 around inf 41.5%

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

    if -1.95999999999999993e139 < u < 2.19999999999999986e193

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-v}{\frac{t1 + u}{\color{blue}{1}} \cdot \frac{t1 + u}{t1}} \]
      11. /-rgt-identity97.7%

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

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

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

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

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

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

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

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

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

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

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

    if 2.19999999999999986e193 < u

    1. Initial program 86.7%

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

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

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

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

      \[\leadsto -1 \cdot \color{blue}{\frac{v}{u}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification59.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;u \leq -1.96 \cdot 10^{+139}:\\ \;\;\;\;\frac{v}{u}\\ \mathbf{elif}\;u \leq 2.2 \cdot 10^{+193}:\\ \;\;\;\;\frac{-v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-v}{u}\\ \end{array} \]

Alternative 10: 23.6% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t1 \leq -7.8 \cdot 10^{+104} \lor \neg \left(t1 \leq 2.7 \cdot 10^{+132}\right):\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \end{array} \]
(FPCore (u v t1)
 :precision binary64
 (if (or (<= t1 -7.8e+104) (not (<= t1 2.7e+132))) (/ v t1) (/ v u)))
double code(double u, double v, double t1) {
	double tmp;
	if ((t1 <= -7.8e+104) || !(t1 <= 2.7e+132)) {
		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 <= (-7.8d+104)) .or. (.not. (t1 <= 2.7d+132))) 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 <= -7.8e+104) || !(t1 <= 2.7e+132)) {
		tmp = v / t1;
	} else {
		tmp = v / u;
	}
	return tmp;
}
def code(u, v, t1):
	tmp = 0
	if (t1 <= -7.8e+104) or not (t1 <= 2.7e+132):
		tmp = v / t1
	else:
		tmp = v / u
	return tmp
function code(u, v, t1)
	tmp = 0.0
	if ((t1 <= -7.8e+104) || !(t1 <= 2.7e+132))
		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 <= -7.8e+104) || ~((t1 <= 2.7e+132)))
		tmp = v / t1;
	else
		tmp = v / u;
	end
	tmp_2 = tmp;
end
code[u_, v_, t1_] := If[Or[LessEqual[t1, -7.8e+104], N[Not[LessEqual[t1, 2.7e+132]], $MachinePrecision]], N[(v / t1), $MachinePrecision], N[(v / u), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t1 \leq -7.8 \cdot 10^{+104} \lor \neg \left(t1 \leq 2.7 \cdot 10^{+132}\right):\\
\;\;\;\;\frac{v}{t1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t1 < -7.80000000000000033e104 or 2.7e132 < t1

    1. Initial program 48.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}}}{\left(t1 + u\right) \cdot \frac{t1 + u}{v}} \]
      10. sqr-neg7.8%

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\left(t1 + u\right) \cdot \frac{\color{blue}{\sqrt{\left(-t1\right) \cdot \left(-t1\right)}} + \left(-u\right)}{-v}} \]
      17. sqr-neg47.8%

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

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

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

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

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

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

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

        \[\leadsto \frac{t1}{\left(t1 + u\right) \cdot \frac{t1 - u}{\color{blue}{\sqrt{v} \cdot \sqrt{v}}}} \]
      25. add-sqr-sqrt48.8%

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

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

        \[\leadsto \color{blue}{\frac{\frac{t1}{\frac{t1 - u}{v}}}{t1 + u}} \]
      2. associate-/r/50.9%

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

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

        \[\leadsto \color{blue}{\frac{v}{\frac{t1 + u}{\frac{t1}{t1 - u}}}} \]
      5. associate-/r/49.8%

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

        \[\leadsto \color{blue}{\frac{\frac{v}{t1 - u}}{\frac{t1 + u}{t1}}} \]
      7. associate-/r/49.5%

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

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

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

    if -7.80000000000000033e104 < t1 < 2.7e132

    1. Initial program 85.2%

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

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

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

      \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{v}{u}} \]
    5. Step-by-step derivation
      1. expm1-log1p-u65.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-t1}{t1 + u} \cdot \frac{v}{u}\right)\right)} \]
      2. expm1-udef45.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-t1}{t1 + u} \cdot \frac{v}{u}\right)} - 1} \]
    6. Applied egg-rr45.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{v}{u \cdot \frac{t1 - u}{t1}}\right)} - 1} \]
    7. Step-by-step derivation
      1. expm1-def61.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{v}{u \cdot \frac{t1 - u}{t1}}\right)\right)} \]
      2. expm1-log1p66.1%

        \[\leadsto \color{blue}{\frac{v}{u \cdot \frac{t1 - u}{t1}}} \]
      3. associate-/r*69.4%

        \[\leadsto \color{blue}{\frac{\frac{v}{u}}{\frac{t1 - u}{t1}}} \]
      4. associate-/r/67.7%

        \[\leadsto \color{blue}{\frac{\frac{v}{u}}{t1 - u} \cdot t1} \]
      5. *-commutative67.7%

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

      \[\leadsto \color{blue}{t1 \cdot \frac{\frac{v}{u}}{t1 - u}} \]
    9. Taylor expanded in t1 around inf 21.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t1 \leq -7.8 \cdot 10^{+104} \lor \neg \left(t1 \leq 2.7 \cdot 10^{+132}\right):\\ \;\;\;\;\frac{v}{t1}\\ \mathbf{else}:\\ \;\;\;\;\frac{v}{u}\\ \end{array} \]

Alternative 11: 61.6% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \frac{-v}{t1 + u} \end{array} \]
(FPCore (u v t1) :precision binary64 (/ (- v) (+ t1 u)))
double code(double u, double v, double t1) {
	return -v / (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 = -v / (t1 + u)
end function
public static double code(double u, double v, double t1) {
	return -v / (t1 + u);
}
def code(u, v, t1):
	return -v / (t1 + u)
function code(u, v, t1)
	return Float64(Float64(-v) / Float64(t1 + u))
end
function tmp = code(u, v, t1)
	tmp = -v / (t1 + u);
end
code[u_, v_, t1_] := N[((-v) / N[(t1 + u), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

Alternative 12: 14.5% 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.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-t1}{t1 + u} \cdot \frac{v}{t1 + u}} \]
    4. clear-num98.8%

      \[\leadsto \frac{-t1}{t1 + u} \cdot \color{blue}{\frac{1}{\frac{t1 + u}{v}}} \]
    5. frac-times83.3%

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

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

      \[\leadsto \frac{\color{blue}{-t1}}{\left(t1 + u\right) \cdot \frac{t1 + u}{v}} \]
    8. add-sqr-sqrt40.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{t1}{\left(t1 + u\right) \cdot \frac{\color{blue}{\sqrt{t1} \cdot \sqrt{t1}} + \left(-u\right)}{-v}} \]
    19. add-sqr-sqrt65.8%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{t1}{\frac{t1 - u}{v}}}{t1 + u}} \]
    2. associate-/r/60.8%

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

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

      \[\leadsto \color{blue}{\frac{v}{\frac{t1 + u}{\frac{t1}{t1 - u}}}} \]
    5. associate-/r/59.1%

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

      \[\leadsto \color{blue}{\frac{\frac{v}{t1 - u}}{\frac{t1 + u}{t1}}} \]
    7. associate-/r/60.2%

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

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

    \[\leadsto \color{blue}{\frac{v}{t1}} \]
  9. Final simplification15.0%

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

Reproduce

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