
(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 7 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 (if (<= a -1e+23) (+ x (* y (/ (- z t) a))) (if (<= a 1.8e-5) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1e+23) {
tmp = x + (y * ((z - t) / a));
} else if (a <= 1.8e-5) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / (a / (z - t)));
}
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 (a <= (-1d+23)) then
tmp = x + (y * ((z - t) / a))
else if (a <= 1.8d-5) then
tmp = x + ((y * (z - t)) / a)
else
tmp = x + (y / (a / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1e+23) {
tmp = x + (y * ((z - t) / a));
} else if (a <= 1.8e-5) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / (a / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1e+23: tmp = x + (y * ((z - t) / a)) elif a <= 1.8e-5: tmp = x + ((y * (z - t)) / a) else: tmp = x + (y / (a / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1e+23) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); elseif (a <= 1.8e-5) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1e+23) tmp = x + (y * ((z - t) / a)); elseif (a <= 1.8e-5) tmp = x + ((y * (z - t)) / a); else tmp = x + (y / (a / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1e+23], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e-5], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{+23}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-5}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\end{array}
\end{array}
if a < -9.9999999999999992e22Initial program 79.0%
associate-/l*99.9%
Simplified99.9%
if -9.9999999999999992e22 < a < 1.80000000000000005e-5Initial program 99.9%
if 1.80000000000000005e-5 < a Initial program 85.2%
associate-/l*99.8%
Simplified99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.25e+224) (not (<= t 2.75e+116))) (* t (/ y (- a))) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.25e+224) || !(t <= 2.75e+116)) {
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.25d+224)) .or. (.not. (t <= 2.75d+116))) 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.25e+224) || !(t <= 2.75e+116)) {
tmp = t * (y / -a);
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.25e+224) or not (t <= 2.75e+116): 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.25e+224) || !(t <= 2.75e+116)) 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.25e+224) || ~((t <= 2.75e+116))) 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.25e+224], N[Not[LessEqual[t, 2.75e+116]], $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.25 \cdot 10^{+224} \lor \neg \left(t \leq 2.75 \cdot 10^{+116}\right):\\
\;\;\;\;t \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.2499999999999999e224 or 2.75000000000000017e116 < t Initial program 94.0%
*-commutative94.0%
associate-/l*94.0%
Applied egg-rr94.0%
Taylor expanded in z around 0 88.2%
associate-*l/79.2%
*-commutative79.2%
neg-mul-179.2%
sub-neg79.2%
*-commutative79.2%
associate-*l/88.2%
associate-*r/88.1%
Simplified88.1%
*-commutative88.1%
associate-*l/88.2%
Applied egg-rr88.2%
Taylor expanded in x around 0 77.7%
mul-1-neg77.7%
associate-*r/76.9%
distribute-rgt-neg-in76.9%
distribute-neg-frac276.9%
Simplified76.9%
if -2.2499999999999999e224 < t < 2.75000000000000017e116Initial program 91.1%
*-commutative91.1%
associate-/l*97.0%
Applied egg-rr97.0%
Taylor expanded in z around inf 79.8%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.2e+81) (+ x (* z (/ y a))) (if (<= z 2.5e+85) (- x (* t (/ y a))) (+ x (* y (/ z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.2e+81) {
tmp = x + (z * (y / a));
} else if (z <= 2.5e+85) {
tmp = x - (t * (y / a));
} else {
tmp = x + (y * (z / 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 (z <= (-2.2d+81)) then
tmp = x + (z * (y / a))
else if (z <= 2.5d+85) then
tmp = x - (t * (y / a))
else
tmp = x + (y * (z / a))
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.2e+81) {
tmp = x + (z * (y / a));
} else if (z <= 2.5e+85) {
tmp = x - (t * (y / a));
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.2e+81: tmp = x + (z * (y / a)) elif z <= 2.5e+85: tmp = x - (t * (y / a)) else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.2e+81) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (z <= 2.5e+85) tmp = Float64(x - Float64(t * Float64(y / a))); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.2e+81) tmp = x + (z * (y / a)); elseif (z <= 2.5e+85) tmp = x - (t * (y / a)); else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.2e+81], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e+85], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+81}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+85}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if z < -2.19999999999999987e81Initial program 86.4%
*-commutative86.4%
associate-/l*98.0%
Applied egg-rr98.0%
Taylor expanded in z around inf 89.5%
if -2.19999999999999987e81 < z < 2.5e85Initial program 95.6%
*-commutative95.6%
associate-/l*96.4%
Applied egg-rr96.4%
Taylor expanded in z around 0 88.1%
associate-*l/83.8%
*-commutative83.8%
neg-mul-183.8%
sub-neg83.8%
*-commutative83.8%
associate-*l/88.1%
associate-*r/89.4%
Simplified89.4%
if 2.5e85 < z Initial program 85.8%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in t around 0 78.4%
+-commutative78.4%
associate-/l*85.4%
Simplified85.4%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (<= a -1150000000.0) x (if (<= a 2.4e-82) (* t (/ y (- a))) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1150000000.0) {
tmp = x;
} else if (a <= 2.4e-82) {
tmp = t * (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 (a <= (-1150000000.0d0)) then
tmp = x
else if (a <= 2.4d-82) then
tmp = t * (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 (a <= -1150000000.0) {
tmp = x;
} else if (a <= 2.4e-82) {
tmp = t * (y / -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1150000000.0: tmp = x elif a <= 2.4e-82: tmp = t * (y / -a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1150000000.0) tmp = x; elseif (a <= 2.4e-82) tmp = Float64(t * Float64(y / Float64(-a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1150000000.0) tmp = x; elseif (a <= 2.4e-82) tmp = t * (y / -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1150000000.0], x, If[LessEqual[a, 2.4e-82], N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1150000000:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-82}:\\
\;\;\;\;t \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.15e9 or 2.40000000000000008e-82 < a Initial program 84.8%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in x around inf 54.7%
if -1.15e9 < a < 2.40000000000000008e-82Initial program 99.9%
*-commutative99.9%
associate-/l*98.4%
Applied egg-rr98.4%
Taylor expanded in z around 0 69.1%
associate-*l/58.1%
*-commutative58.1%
neg-mul-158.1%
sub-neg58.1%
*-commutative58.1%
associate-*l/69.1%
associate-*r/72.3%
Simplified72.3%
*-commutative72.3%
associate-*l/69.1%
Applied egg-rr69.1%
Taylor expanded in x around 0 56.9%
mul-1-neg56.9%
associate-*r/60.1%
distribute-rgt-neg-in60.1%
distribute-neg-frac260.1%
Simplified60.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -5e+21) (+ x (* y (/ (- z t) a))) (+ x (* (- z t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5e+21) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + ((z - t) * (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 (a <= (-5d+21)) then
tmp = x + (y * ((z - t) / a))
else
tmp = x + ((z - t) * (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 (a <= -5e+21) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x + ((z - t) * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5e+21: tmp = x + (y * ((z - t) / a)) else: tmp = x + ((z - t) * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5e+21) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); else tmp = Float64(x + Float64(Float64(z - t) * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5e+21) tmp = x + (y * ((z - t) / a)); else tmp = x + ((z - t) * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5e+21], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{+21}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if a < -5e21Initial program 79.0%
associate-/l*99.9%
Simplified99.9%
if -5e21 < a Initial program 95.2%
*-commutative95.2%
associate-/l*97.6%
Applied egg-rr97.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.28e+213) (- x (* t (/ y a))) (+ x (* y (/ (- z t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.28e+213) {
tmp = x - (t * (y / a));
} else {
tmp = x + (y * ((z - t) / 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 <= (-1.28d+213)) then
tmp = x - (t * (y / a))
else
tmp = x + (y * ((z - t) / 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 <= -1.28e+213) {
tmp = x - (t * (y / a));
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.28e+213: tmp = x - (t * (y / a)) else: tmp = x + (y * ((z - t) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.28e+213) tmp = Float64(x - Float64(t * Float64(y / a))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.28e+213) tmp = x - (t * (y / a)); else tmp = x + (y * ((z - t) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.28e+213], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.28 \cdot 10^{+213}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if t < -1.2799999999999999e213Initial program 85.2%
*-commutative85.2%
associate-/l*99.8%
Applied egg-rr99.8%
Taylor expanded in z around 0 85.2%
associate-*l/75.1%
*-commutative75.1%
neg-mul-175.1%
sub-neg75.1%
*-commutative75.1%
associate-*l/85.2%
associate-*r/99.8%
Simplified99.8%
if -1.2799999999999999e213 < t Initial program 92.3%
associate-/l*93.6%
Simplified93.6%
(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 91.8%
associate-/l*92.2%
Simplified92.2%
Taylor expanded in x around inf 36.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 2024116
(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)))