
(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 9 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
(let* ((t_1 (* (- z t) y)))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+108)))
(+ x (/ y (/ a (- z t))))
(+ x (/ t_1 a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * y;
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e+108)) {
tmp = x + (y / (a / (z - t)));
} else {
tmp = x + (t_1 / a);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) * y;
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e+108)) {
tmp = x + (y / (a / (z - t)));
} else {
tmp = x + (t_1 / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) * y tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+108): tmp = x + (y / (a / (z - t))) else: tmp = x + (t_1 / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) * y) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e+108)) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); else tmp = Float64(x + Float64(t_1 / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) * y; tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e+108))) tmp = x + (y / (a / (z - t))); else tmp = x + (t_1 / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+108]], $MachinePrecision]], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t$95$1 / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - t\right) \cdot y\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+108}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t\_1}{a}\\
\end{array}
\end{array}
if (*.f64 y (-.f64 z t)) < -inf.0 or 1e108 < (*.f64 y (-.f64 z t)) Initial program 85.6%
associate-/l*99.8%
Simplified99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
if -inf.0 < (*.f64 y (-.f64 z t)) < 1e108Initial program 99.3%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.26e+23) (not (<= t 6.7e-12))) (- x (* t (/ y a))) (+ x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.26e+23) || !(t <= 6.7e-12)) {
tmp = x - (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.26d+23)) .or. (.not. (t <= 6.7d-12))) then
tmp = x - (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.26e+23) || !(t <= 6.7e-12)) {
tmp = x - (t * (y / a));
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.26e+23) or not (t <= 6.7e-12): tmp = x - (t * (y / a)) else: tmp = x + (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.26e+23) || !(t <= 6.7e-12)) tmp = Float64(x - Float64(t * Float64(y / 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.26e+23) || ~((t <= 6.7e-12))) tmp = x - (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.26e+23], N[Not[LessEqual[t, 6.7e-12]], $MachinePrecision]], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.26 \cdot 10^{+23} \lor \neg \left(t \leq 6.7 \cdot 10^{-12}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -1.26000000000000004e23 or 6.7000000000000001e-12 < t Initial program 94.5%
associate-/l*88.3%
Simplified88.3%
Taylor expanded in z around 0 87.0%
mul-1-neg87.0%
associate-/l*89.3%
distribute-rgt-neg-in89.3%
distribute-neg-frac289.3%
Simplified89.3%
Taylor expanded in x around 0 87.0%
associate-*l/81.2%
*-commutative81.2%
neg-mul-181.2%
sub-neg81.2%
associate-*r/87.0%
associate-*l/89.3%
*-commutative89.3%
Simplified89.3%
if -1.26000000000000004e23 < t < 6.7000000000000001e-12Initial program 95.7%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 89.9%
associate-/l*90.6%
Simplified90.6%
*-commutative90.6%
associate-/r/91.8%
Applied egg-rr91.8%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.1e+21) (- x (* t (/ y a))) (if (<= t 4.5e-13) (+ x (/ z (/ a y))) (- x (/ t (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.1e+21) {
tmp = x - (t * (y / a));
} else if (t <= 4.5e-13) {
tmp = x + (z / (a / y));
} else {
tmp = x - (t / (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 <= (-4.1d+21)) then
tmp = x - (t * (y / a))
else if (t <= 4.5d-13) then
tmp = x + (z / (a / y))
else
tmp = x - (t / (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 <= -4.1e+21) {
tmp = x - (t * (y / a));
} else if (t <= 4.5e-13) {
tmp = x + (z / (a / y));
} else {
tmp = x - (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.1e+21: tmp = x - (t * (y / a)) elif t <= 4.5e-13: tmp = x + (z / (a / y)) else: tmp = x - (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.1e+21) tmp = Float64(x - Float64(t * Float64(y / a))); elseif (t <= 4.5e-13) tmp = Float64(x + Float64(z / Float64(a / y))); else tmp = Float64(x - Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.1e+21) tmp = x - (t * (y / a)); elseif (t <= 4.5e-13) tmp = x + (z / (a / y)); else tmp = x - (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.1e+21], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e-13], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.1 \cdot 10^{+21}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-13}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -4.1e21Initial program 94.5%
associate-/l*80.3%
Simplified80.3%
Taylor expanded in z around 0 85.2%
mul-1-neg85.2%
associate-/l*87.1%
distribute-rgt-neg-in87.1%
distribute-neg-frac287.1%
Simplified87.1%
Taylor expanded in x around 0 85.2%
associate-*l/73.0%
*-commutative73.0%
neg-mul-173.0%
sub-neg73.0%
associate-*r/85.2%
associate-*l/87.1%
*-commutative87.1%
Simplified87.1%
if -4.1e21 < t < 4.5e-13Initial program 95.7%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 89.9%
associate-/l*90.6%
Simplified90.6%
*-commutative90.6%
associate-/r/91.8%
Applied egg-rr91.8%
if 4.5e-13 < t Initial program 94.5%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around 0 88.3%
mul-1-neg88.3%
associate-/l*90.9%
distribute-rgt-neg-in90.9%
distribute-neg-frac290.9%
Simplified90.9%
Taylor expanded in x around 0 88.3%
associate-*l/87.5%
*-commutative87.5%
neg-mul-187.5%
sub-neg87.5%
associate-*r/88.3%
associate-*l/90.9%
*-commutative90.9%
Simplified90.9%
clear-num90.9%
un-div-inv91.0%
Applied egg-rr91.0%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.16e+132) (- 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.16e+132) {
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.16d+132)) 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.16e+132) {
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.16e+132: 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.16e+132) 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.16e+132) 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.16e+132], 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.16 \cdot 10^{+132}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if t < -1.16000000000000004e132Initial program 94.4%
associate-/l*74.9%
Simplified74.9%
Taylor expanded in z around 0 85.8%
mul-1-neg85.8%
associate-/l*88.5%
distribute-rgt-neg-in88.5%
distribute-neg-frac288.5%
Simplified88.5%
Taylor expanded in x around 0 85.8%
associate-*l/69.3%
*-commutative69.3%
neg-mul-169.3%
sub-neg69.3%
associate-*r/85.8%
associate-*l/88.5%
*-commutative88.5%
Simplified88.5%
if -1.16000000000000004e132 < t Initial program 95.2%
associate-/l*95.2%
Simplified95.2%
Final simplification94.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.15e+132) (- x (* t (/ y a))) (+ x (/ y (/ a (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.15e+132) {
tmp = x - (t * (y / 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 (t <= (-1.15d+132)) then
tmp = x - (t * (y / 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 (t <= -1.15e+132) {
tmp = x - (t * (y / a));
} else {
tmp = x + (y / (a / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.15e+132: tmp = x - (t * (y / a)) else: tmp = x + (y / (a / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.15e+132) tmp = Float64(x - Float64(t * Float64(y / 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 (t <= -1.15e+132) tmp = x - (t * (y / a)); else tmp = x + (y / (a / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.15e+132], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.15 \cdot 10^{+132}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\end{array}
\end{array}
if t < -1.1500000000000001e132Initial program 94.4%
associate-/l*74.9%
Simplified74.9%
Taylor expanded in z around 0 85.8%
mul-1-neg85.8%
associate-/l*88.5%
distribute-rgt-neg-in88.5%
distribute-neg-frac288.5%
Simplified88.5%
Taylor expanded in x around 0 85.8%
associate-*l/69.3%
*-commutative69.3%
neg-mul-169.3%
sub-neg69.3%
associate-*r/85.8%
associate-*l/88.5%
*-commutative88.5%
Simplified88.5%
if -1.1500000000000001e132 < t Initial program 95.2%
associate-/l*95.2%
Simplified95.2%
clear-num95.2%
un-div-inv95.2%
Applied egg-rr95.2%
Final simplification94.4%
(FPCore (x y z t a) :precision binary64 (+ x (/ (- z t) (/ a y))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) / (a / y));
}
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) / (a / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) / (a / y));
}
def code(x, y, z, t, a): return x + ((z - t) / (a / y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) / Float64(a / y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) / (a / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{\frac{a}{y}}
\end{array}
Initial program 95.1%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in y around 0 95.1%
*-lft-identity95.1%
associate-*l/95.1%
associate-*r*97.9%
associate-/r/97.8%
associate-*l/98.3%
*-lft-identity98.3%
Simplified98.3%
Final simplification98.3%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ z a))))
double code(double x, double y, double z, double t, double a) {
return x + (y * (z / 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 / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * (z / a));
}
def code(x, y, z, t, a): return x + (y * (z / a))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(z / a))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * (z / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z}{a}
\end{array}
Initial program 95.1%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in z around inf 69.6%
associate-/l*69.5%
Simplified69.5%
Final simplification69.5%
(FPCore (x y z t a) :precision binary64 (+ x (/ z (/ a y))))
double code(double x, double y, double z, double t, double a) {
return x + (z / (a / y));
}
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 / (a / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (z / (a / y));
}
def code(x, y, z, t, a): return x + (z / (a / y))
function code(x, y, z, t, a) return Float64(x + Float64(z / Float64(a / y))) end
function tmp = code(x, y, z, t, a) tmp = x + (z / (a / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z}{\frac{a}{y}}
\end{array}
Initial program 95.1%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in z around inf 69.6%
associate-/l*69.5%
Simplified69.5%
*-commutative69.5%
associate-/r/72.0%
Applied egg-rr72.0%
Final simplification72.0%
(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 95.1%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in z around inf 69.6%
associate-/l*69.5%
Simplified69.5%
Taylor expanded in x around inf 42.9%
Final simplification42.9%
(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 2024055
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
:alt
(if (< y -1.0761266216389975e-10) (+ x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t))))))
(+ x (/ (* y (- z t)) a)))