
(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 10 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 -1.32e-51) (+ x (/ y (/ a (- z t)))) (if (<= a 1.05e-62) (+ x (/ (* (- z t) y) a)) (+ x (* y (/ (- z t) a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.32e-51) {
tmp = x + (y / (a / (z - t)));
} else if (a <= 1.05e-62) {
tmp = x + (((z - 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 (a <= (-1.32d-51)) then
tmp = x + (y / (a / (z - t)))
else if (a <= 1.05d-62) then
tmp = x + (((z - 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 (a <= -1.32e-51) {
tmp = x + (y / (a / (z - t)));
} else if (a <= 1.05e-62) {
tmp = x + (((z - t) * y) / a);
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.32e-51: tmp = x + (y / (a / (z - t))) elif a <= 1.05e-62: tmp = x + (((z - t) * y) / a) else: tmp = x + (y * ((z - t) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.32e-51) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); elseif (a <= 1.05e-62) tmp = Float64(x + Float64(Float64(Float64(z - t) * 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 (a <= -1.32e-51) tmp = x + (y / (a / (z - t))); elseif (a <= 1.05e-62) tmp = x + (((z - t) * y) / a); else tmp = x + (y * ((z - t) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.32e-51], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e-62], N[(x + N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.32 \cdot 10^{-51}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-62}:\\
\;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if a < -1.31999999999999998e-51Initial program 88.0%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around 0 88.0%
associate-*l/98.6%
associate-/r/99.9%
Simplified99.9%
if -1.31999999999999998e-51 < a < 1.05e-62Initial program 99.4%
if 1.05e-62 < a Initial program 90.4%
associate-/l*99.9%
Simplified99.9%
Final simplification99.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -920000000.0) (not (<= t 7.8e-75))) (- x (* t (/ y a))) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -920000000.0) || !(t <= 7.8e-75)) {
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 <= (-920000000.0d0)) .or. (.not. (t <= 7.8d-75))) 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 <= -920000000.0) || !(t <= 7.8e-75)) {
tmp = x - (t * (y / a));
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -920000000.0) or not (t <= 7.8e-75): 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 <= -920000000.0) || !(t <= 7.8e-75)) 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 <= -920000000.0) || ~((t <= 7.8e-75))) 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, -920000000.0], N[Not[LessEqual[t, 7.8e-75]], $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 -920000000 \lor \neg \left(t \leq 7.8 \cdot 10^{-75}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -9.2e8 or 7.8000000000000003e-75 < t Initial program 91.8%
+-commutative91.8%
associate-/l*93.9%
fma-define93.9%
Simplified93.9%
fma-undefine93.9%
associate-*r/91.8%
*-commutative91.8%
associate-/l*97.9%
Applied egg-rr97.9%
Taylor expanded in z around 0 84.0%
mul-1-neg84.0%
sub-neg84.0%
associate-/l*86.7%
Simplified86.7%
if -9.2e8 < t < 7.8000000000000003e-75Initial program 95.3%
+-commutative95.3%
associate-/l*94.8%
fma-define94.8%
Simplified94.8%
fma-undefine94.8%
associate-*r/95.3%
*-commutative95.3%
associate-/l*95.7%
Applied egg-rr95.7%
Taylor expanded in z around inf 87.6%
associate-*l/90.8%
*-commutative90.8%
Simplified90.8%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -80.0) (not (<= a 2e+121))) (+ x (* y (/ z a))) (+ x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -80.0) || !(a <= 2e+121)) {
tmp = x + (y * (z / 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 ((a <= (-80.0d0)) .or. (.not. (a <= 2d+121))) then
tmp = x + (y * (z / 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 ((a <= -80.0) || !(a <= 2e+121)) {
tmp = x + (y * (z / a));
} else {
tmp = x + ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -80.0) or not (a <= 2e+121): tmp = x + (y * (z / a)) else: tmp = x + ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -80.0) || !(a <= 2e+121)) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(Float64(z * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -80.0) || ~((a <= 2e+121))) tmp = x + (y * (z / a)); else tmp = x + ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -80.0], N[Not[LessEqual[a, 2e+121]], $MachinePrecision]], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -80 \lor \neg \left(a \leq 2 \cdot 10^{+121}\right):\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if a < -80 or 2.00000000000000007e121 < a Initial program 86.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 71.1%
+-commutative71.1%
associate-/l*82.7%
Simplified82.7%
if -80 < a < 2.00000000000000007e121Initial program 98.3%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in z around inf 59.1%
Final simplification68.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -760000000.0) (- x (* t (/ y a))) (if (<= t 1e-77) (+ x (* z (/ y a))) (- x (/ (* t y) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -760000000.0) {
tmp = x - (t * (y / a));
} else if (t <= 1e-77) {
tmp = x + (z * (y / a));
} else {
tmp = x - ((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 (t <= (-760000000.0d0)) then
tmp = x - (t * (y / a))
else if (t <= 1d-77) then
tmp = x + (z * (y / a))
else
tmp = x - ((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 (t <= -760000000.0) {
tmp = x - (t * (y / a));
} else if (t <= 1e-77) {
tmp = x + (z * (y / a));
} else {
tmp = x - ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -760000000.0: tmp = x - (t * (y / a)) elif t <= 1e-77: tmp = x + (z * (y / a)) else: tmp = x - ((t * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -760000000.0) tmp = Float64(x - Float64(t * Float64(y / a))); elseif (t <= 1e-77) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x - Float64(Float64(t * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -760000000.0) tmp = x - (t * (y / a)); elseif (t <= 1e-77) tmp = x + (z * (y / a)); else tmp = x - ((t * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -760000000.0], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e-77], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -760000000:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 10^{-77}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if t < -7.6e8Initial program 89.8%
+-commutative89.8%
associate-/l*94.3%
fma-define94.3%
Simplified94.3%
fma-undefine94.3%
associate-*r/89.8%
*-commutative89.8%
associate-/l*100.0%
Applied egg-rr100.0%
Taylor expanded in z around 0 82.9%
mul-1-neg82.9%
sub-neg82.9%
associate-/l*88.6%
Simplified88.6%
if -7.6e8 < t < 9.9999999999999993e-78Initial program 95.3%
+-commutative95.3%
associate-/l*94.8%
fma-define94.8%
Simplified94.8%
fma-undefine94.8%
associate-*r/95.3%
*-commutative95.3%
associate-/l*95.7%
Applied egg-rr95.7%
Taylor expanded in z around inf 87.6%
associate-*l/90.8%
*-commutative90.8%
Simplified90.8%
if 9.9999999999999993e-78 < t Initial program 93.5%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in z around 0 85.1%
mul-1-neg85.1%
unsub-neg85.1%
*-commutative85.1%
associate-/l*82.5%
Simplified82.5%
Taylor expanded in y around 0 85.1%
Final simplification88.6%
(FPCore (x y z t a) :precision binary64 (if (<= a 1.4e-262) (+ (* (- z t) (/ y a)) x) (+ x (* y (/ (- z t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 1.4e-262) {
tmp = ((z - t) * (y / a)) + x;
} 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 (a <= 1.4d-262) then
tmp = ((z - t) * (y / a)) + x
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 (a <= 1.4e-262) {
tmp = ((z - t) * (y / a)) + x;
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 1.4e-262: tmp = ((z - t) * (y / a)) + x else: tmp = x + (y * ((z - t) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 1.4e-262) tmp = Float64(Float64(Float64(z - t) * Float64(y / a)) + x); 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 (a <= 1.4e-262) tmp = ((z - t) * (y / a)) + x; else tmp = x + (y * ((z - t) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 1.4e-262], N[(N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.4 \cdot 10^{-262}:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a} + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if a < 1.39999999999999988e-262Initial program 93.2%
+-commutative93.2%
associate-/l*90.0%
fma-define90.0%
Simplified90.0%
fma-undefine90.0%
associate-*r/93.2%
*-commutative93.2%
associate-/l*98.5%
Applied egg-rr98.5%
if 1.39999999999999988e-262 < a Initial program 93.5%
associate-/l*99.2%
Simplified99.2%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ a (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / (a / (z - t)));
}
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 / (a / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / (a / (z - t)));
}
def code(x, y, z, t, a): return x + (y / (a / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(a / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / (a / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a}{z - t}}
\end{array}
Initial program 93.4%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in y around 0 93.4%
associate-*l/96.9%
associate-/r/95.1%
Simplified95.1%
(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 93.4%
associate-/l*94.3%
Simplified94.3%
(FPCore (x y z t a) :precision binary64 (+ x (* z (/ y a))))
double code(double x, double y, double z, double t, double a) {
return x + (z * (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 * (y / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (z * (y / a));
}
def code(x, y, z, t, a): return x + (z * (y / a))
function code(x, y, z, t, a) return Float64(x + Float64(z * Float64(y / a))) end
function tmp = code(x, y, z, t, a) tmp = x + (z * (y / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + z \cdot \frac{y}{a}
\end{array}
Initial program 93.4%
+-commutative93.4%
associate-/l*94.3%
fma-define94.3%
Simplified94.3%
fma-undefine94.3%
associate-*r/93.4%
*-commutative93.4%
associate-/l*96.9%
Applied egg-rr96.9%
Taylor expanded in z around inf 63.9%
associate-*l/67.8%
*-commutative67.8%
Simplified67.8%
Final simplification67.8%
(FPCore (x y z t a) :precision binary64 (+ x (/ (* z y) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((z * 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 * y) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z * y) / a);
}
def code(x, y, z, t, a): return x + ((z * y) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z * y) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((z * y) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z \cdot y}{a}
\end{array}
Initial program 93.4%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in z around inf 63.9%
Final simplification63.9%
(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 93.4%
associate-/l*94.3%
Simplified94.3%
Taylor expanded in x around inf 41.0%
(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 2024170
(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)))