
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((z - t) * (y / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / a));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a}
\end{array}
Initial program 92.9%
*-commutative92.9%
associate-/l*98.0%
Applied egg-rr98.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ y (- a)))))
(if (<= t -3.3e+45)
t_1
(if (<= t 4.6e-234) x (if (<= t 1.05e+100) (* z (/ y a)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / -a);
double tmp;
if (t <= -3.3e+45) {
tmp = t_1;
} else if (t <= 4.6e-234) {
tmp = x;
} else if (t <= 1.05e+100) {
tmp = z * (y / a);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = t * (y / -a)
if (t <= (-3.3d+45)) then
tmp = t_1
else if (t <= 4.6d-234) then
tmp = x
else if (t <= 1.05d+100) then
tmp = z * (y / a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / -a);
double tmp;
if (t <= -3.3e+45) {
tmp = t_1;
} else if (t <= 4.6e-234) {
tmp = x;
} else if (t <= 1.05e+100) {
tmp = z * (y / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y / -a) tmp = 0 if t <= -3.3e+45: tmp = t_1 elif t <= 4.6e-234: tmp = x elif t <= 1.05e+100: tmp = z * (y / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / Float64(-a))) tmp = 0.0 if (t <= -3.3e+45) tmp = t_1; elseif (t <= 4.6e-234) tmp = x; elseif (t <= 1.05e+100) tmp = Float64(z * Float64(y / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (y / -a); tmp = 0.0; if (t <= -3.3e+45) tmp = t_1; elseif (t <= 4.6e-234) tmp = x; elseif (t <= 1.05e+100) tmp = z * (y / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.3e+45], t$95$1, If[LessEqual[t, 4.6e-234], x, If[LessEqual[t, 1.05e+100], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{-a}\\
\mathbf{if}\;t \leq -3.3 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-234}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+100}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.3000000000000001e45 or 1.0499999999999999e100 < t Initial program 90.6%
*-commutative90.6%
associate-/l*98.1%
Applied egg-rr98.1%
Taylor expanded in z around 0 83.0%
mul-1-neg83.0%
associate-*r/89.5%
distribute-lft-neg-in89.5%
cancel-sign-sub-inv89.5%
Simplified89.5%
Taylor expanded in x around 0 61.2%
mul-1-neg61.2%
distribute-frac-neg261.2%
associate-*r/64.9%
Simplified64.9%
if -3.3000000000000001e45 < t < 4.59999999999999981e-234Initial program 95.0%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in x around inf 60.0%
if 4.59999999999999981e-234 < t < 1.0499999999999999e100Initial program 93.9%
associate-/l*94.8%
Simplified94.8%
Taylor expanded in a around 0 85.4%
Taylor expanded in z around inf 47.1%
*-commutative47.1%
associate-*r/53.0%
Applied egg-rr53.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.6e-58) (not (<= t 2e+100))) (- x (* t (/ y a))) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.6e-58) || !(t <= 2e+100)) {
tmp = x - (t * (y / a));
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-6.6d-58)) .or. (.not. (t <= 2d+100))) then
tmp = x - (t * (y / a))
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.6e-58) || !(t <= 2e+100)) {
tmp = x - (t * (y / a));
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.6e-58) or not (t <= 2e+100): tmp = x - (t * (y / a)) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.6e-58) || !(t <= 2e+100)) tmp = Float64(x - Float64(t * Float64(y / a))); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.6e-58) || ~((t <= 2e+100))) tmp = x - (t * (y / a)); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.6e-58], N[Not[LessEqual[t, 2e+100]], $MachinePrecision]], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.6 \cdot 10^{-58} \lor \neg \left(t \leq 2 \cdot 10^{+100}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -6.60000000000000052e-58 or 2.00000000000000003e100 < t Initial program 91.2%
*-commutative91.2%
associate-/l*98.4%
Applied egg-rr98.4%
Taylor expanded in z around 0 84.7%
mul-1-neg84.7%
associate-*r/90.2%
distribute-lft-neg-in90.2%
cancel-sign-sub-inv90.2%
Simplified90.2%
if -6.60000000000000052e-58 < t < 2.00000000000000003e100Initial program 94.5%
*-commutative94.5%
associate-/l*97.7%
Applied egg-rr97.7%
Taylor expanded in z around inf 90.3%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.22e+56) (not (<= t 1.65e+114))) (* t (/ y (- a))) (+ x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.22e+56) || !(t <= 1.65e+114)) {
tmp = t * (y / -a);
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-1.22d+56)) .or. (.not. (t <= 1.65d+114))) then
tmp = t * (y / -a)
else
tmp = x + (z / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.22e+56) || !(t <= 1.65e+114)) {
tmp = t * (y / -a);
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.22e+56) or not (t <= 1.65e+114): tmp = t * (y / -a) else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.22e+56) || !(t <= 1.65e+114)) tmp = Float64(t * Float64(y / Float64(-a))); else tmp = Float64(x + Float64(z / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.22e+56) || ~((t <= 1.65e+114))) tmp = t * (y / -a); else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.22e+56], N[Not[LessEqual[t, 1.65e+114]], $MachinePrecision]], N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{+56} \lor \neg \left(t \leq 1.65 \cdot 10^{+114}\right):\\
\;\;\;\;t \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -1.22e56 or 1.65e114 < t Initial program 89.8%
*-commutative89.8%
associate-/l*97.9%
Applied egg-rr97.9%
Taylor expanded in z around 0 84.5%
mul-1-neg84.5%
associate-*r/91.6%
distribute-lft-neg-in91.6%
cancel-sign-sub-inv91.6%
Simplified91.6%
Taylor expanded in x around 0 64.0%
mul-1-neg64.0%
distribute-frac-neg264.0%
associate-*r/68.0%
Simplified68.0%
if -1.22e56 < t < 1.65e114Initial program 94.7%
*-commutative94.7%
associate-/l*98.1%
Applied egg-rr98.1%
Taylor expanded in z around inf 88.8%
clear-num88.8%
un-div-inv88.9%
Applied egg-rr88.9%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.7e+57) (not (<= t 1.4e+114))) (* t (/ y (- a))) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.7e+57) || !(t <= 1.4e+114)) {
tmp = t * (y / -a);
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.7d+57)) .or. (.not. (t <= 1.4d+114))) then
tmp = t * (y / -a)
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.7e+57) || !(t <= 1.4e+114)) {
tmp = t * (y / -a);
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.7e+57) or not (t <= 1.4e+114): tmp = t * (y / -a) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.7e+57) || !(t <= 1.4e+114)) tmp = Float64(t * Float64(y / Float64(-a))); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.7e+57) || ~((t <= 1.4e+114))) tmp = t * (y / -a); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.7e+57], N[Not[LessEqual[t, 1.4e+114]], $MachinePrecision]], N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{+57} \lor \neg \left(t \leq 1.4 \cdot 10^{+114}\right):\\
\;\;\;\;t \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.6999999999999998e57 or 1.4e114 < t Initial program 89.8%
*-commutative89.8%
associate-/l*97.9%
Applied egg-rr97.9%
Taylor expanded in z around 0 84.5%
mul-1-neg84.5%
associate-*r/91.6%
distribute-lft-neg-in91.6%
cancel-sign-sub-inv91.6%
Simplified91.6%
Taylor expanded in x around 0 64.0%
mul-1-neg64.0%
distribute-frac-neg264.0%
associate-*r/68.0%
Simplified68.0%
if -2.6999999999999998e57 < t < 1.4e114Initial program 94.7%
*-commutative94.7%
associate-/l*98.1%
Applied egg-rr98.1%
Taylor expanded in z around inf 88.8%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.8e+62) (not (<= z 115000.0))) (* z (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.8e+62) || !(z <= 115000.0)) {
tmp = z * (y / a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2.8d+62)) .or. (.not. (z <= 115000.0d0))) then
tmp = z * (y / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.8e+62) || !(z <= 115000.0)) {
tmp = z * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.8e+62) or not (z <= 115000.0): tmp = z * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.8e+62) || !(z <= 115000.0)) tmp = Float64(z * Float64(y / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.8e+62) || ~((z <= 115000.0))) tmp = z * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.8e+62], N[Not[LessEqual[z, 115000.0]], $MachinePrecision]], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+62} \lor \neg \left(z \leq 115000\right):\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.80000000000000014e62 or 115000 < z Initial program 88.1%
associate-/l*90.7%
Simplified90.7%
Taylor expanded in a around 0 79.8%
Taylor expanded in z around inf 54.6%
*-commutative54.6%
associate-*r/61.7%
Applied egg-rr61.7%
if -2.80000000000000014e62 < z < 115000Initial program 96.2%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in x around inf 51.4%
Final simplification55.5%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) a))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / a));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / a))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / a))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a}
\end{array}
Initial program 92.9%
associate-/l*94.2%
Simplified94.2%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 92.9%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in x around inf 41.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (- z t))))
(if (< y -1.0761266216389975e-10)
(+ x (/ 1.0 (/ t_1 y)))
(if (< y 2.894426862792089e-49)
(+ x (/ (* y (- z t)) a))
(+ x (/ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x + (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a / (z - t)
if (y < (-1.0761266216389975d-10)) then
tmp = x + (1.0d0 / (t_1 / y))
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) / a)
else
tmp = x + (y / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x + (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a / (z - t) tmp = 0 if y < -1.0761266216389975e-10: tmp = x + (1.0 / (t_1 / y)) elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) / a) else: tmp = x + (y / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(a / Float64(z - t)) tmp = 0.0 if (y < -1.0761266216389975e-10) tmp = Float64(x + Float64(1.0 / Float64(t_1 / y))); elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x + Float64(y / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a / (z - t); tmp = 0.0; if (y < -1.0761266216389975e-10) tmp = x + (1.0 / (t_1 / y)); elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) / a); else tmp = x + (y / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -1.0761266216389975e-10], N[(x + N[(1.0 / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{1}{\frac{t\_1}{y}}\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024163
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
:alt
(! :herbie-platform default (if (< y -430450648655599/4000000000000000000000000) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t)))))))
(+ x (/ (* y (- z t)) a)))