
(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 (if (<= a 2.7e-46) (+ x (/ (* y (- z t)) a)) (+ x (* y (/ (- z t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 2.7e-46) {
tmp = x + ((y * (z - t)) / 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 <= 2.7d-46) then
tmp = x + ((y * (z - t)) / 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 <= 2.7e-46) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 2.7e-46: tmp = x + ((y * (z - t)) / a) else: tmp = x + (y * ((z - t) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 2.7e-46) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / 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 <= 2.7e-46) tmp = x + ((y * (z - t)) / a); else tmp = x + (y * ((z - t) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 2.7e-46], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $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 2.7 \cdot 10^{-46}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if a < 2.7e-46Initial program 98.8%
if 2.7e-46 < a Initial program 90.7%
associate-/l*98.8%
Simplified98.8%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5.8e+175)
(/ (* t (- y)) a)
(if (or (<= t -1.1e+96) (and (not (<= t -1.75e+42)) (<= t 9e+183)))
(+ x (* z (/ y a)))
(* t (/ y (- a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.8e+175) {
tmp = (t * -y) / a;
} else if ((t <= -1.1e+96) || (!(t <= -1.75e+42) && (t <= 9e+183))) {
tmp = x + (z * (y / a));
} else {
tmp = 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 <= (-5.8d+175)) then
tmp = (t * -y) / a
else if ((t <= (-1.1d+96)) .or. (.not. (t <= (-1.75d+42))) .and. (t <= 9d+183)) then
tmp = x + (z * (y / a))
else
tmp = 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 <= -5.8e+175) {
tmp = (t * -y) / a;
} else if ((t <= -1.1e+96) || (!(t <= -1.75e+42) && (t <= 9e+183))) {
tmp = x + (z * (y / a));
} else {
tmp = t * (y / -a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.8e+175: tmp = (t * -y) / a elif (t <= -1.1e+96) or (not (t <= -1.75e+42) and (t <= 9e+183)): tmp = x + (z * (y / a)) else: tmp = t * (y / -a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.8e+175) tmp = Float64(Float64(t * Float64(-y)) / a); elseif ((t <= -1.1e+96) || (!(t <= -1.75e+42) && (t <= 9e+183))) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(t * Float64(y / Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.8e+175) tmp = (t * -y) / a; elseif ((t <= -1.1e+96) || (~((t <= -1.75e+42)) && (t <= 9e+183))) tmp = x + (z * (y / a)); else tmp = t * (y / -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.8e+175], N[(N[(t * (-y)), $MachinePrecision] / a), $MachinePrecision], If[Or[LessEqual[t, -1.1e+96], And[N[Not[LessEqual[t, -1.75e+42]], $MachinePrecision], LessEqual[t, 9e+183]]], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{+175}:\\
\;\;\;\;\frac{t \cdot \left(-y\right)}{a}\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{+96} \lor \neg \left(t \leq -1.75 \cdot 10^{+42}\right) \land t \leq 9 \cdot 10^{+183}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{-a}\\
\end{array}
\end{array}
if t < -5.8e175Initial program 99.8%
associate-/l*89.5%
Simplified89.5%
Taylor expanded in z around 0 94.5%
mul-1-neg94.5%
unsub-neg94.5%
*-commutative94.5%
associate-/l*85.8%
Simplified85.8%
Taylor expanded in y around 0 94.5%
Taylor expanded in x around 0 87.1%
mul-1-neg87.1%
distribute-frac-neg287.1%
associate-*r/82.2%
Simplified82.2%
*-commutative82.2%
distribute-frac-neg282.2%
distribute-frac-neg82.2%
associate-*l/87.1%
Applied egg-rr87.1%
if -5.8e175 < t < -1.0999999999999999e96 or -1.75000000000000012e42 < t < 9.00000000000000034e183Initial program 96.9%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in y around 0 96.9%
associate-*l/96.3%
*-commutative96.3%
Simplified96.3%
Taylor expanded in z around inf 82.2%
associate-*l/83.5%
*-commutative83.5%
Simplified83.5%
if -1.0999999999999999e96 < t < -1.75000000000000012e42 or 9.00000000000000034e183 < t Initial program 91.9%
associate-/l*89.2%
Simplified89.2%
Taylor expanded in z around 0 89.7%
mul-1-neg89.7%
unsub-neg89.7%
*-commutative89.7%
associate-/l*84.2%
Simplified84.2%
Taylor expanded in y around 0 89.7%
Taylor expanded in x around 0 65.4%
mul-1-neg65.4%
distribute-frac-neg265.4%
associate-*r/67.7%
Simplified67.7%
Final simplification81.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.05e+39) (not (<= t 2e-52))) (- x (* t (/ y a))) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.05e+39) || !(t <= 2e-52)) {
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 <= (-2.05d+39)) .or. (.not. (t <= 2d-52))) 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 <= -2.05e+39) || !(t <= 2e-52)) {
tmp = x - (t * (y / a));
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.05e+39) or not (t <= 2e-52): 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 <= -2.05e+39) || !(t <= 2e-52)) 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 <= -2.05e+39) || ~((t <= 2e-52))) 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, -2.05e+39], N[Not[LessEqual[t, 2e-52]], $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 -2.05 \cdot 10^{+39} \lor \neg \left(t \leq 2 \cdot 10^{-52}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.05000000000000002e39 or 2e-52 < t Initial program 96.1%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in y around 0 96.1%
associate-*l/97.7%
*-commutative97.7%
Simplified97.7%
Taylor expanded in z around 0 87.3%
associate-*r/87.7%
associate-*r*87.7%
neg-mul-187.7%
cancel-sign-sub-inv87.7%
Simplified87.7%
if -2.05000000000000002e39 < t < 2e-52Initial program 97.0%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in y around 0 97.0%
associate-*l/95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in z around inf 91.7%
associate-*l/91.7%
*-commutative91.7%
Simplified91.7%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.2e+36) (- x (/ (* y t) a)) (if (<= t 3.05e-52) (+ x (* z (/ y a))) (- x (* t (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.2e+36) {
tmp = x - ((y * t) / a);
} else if (t <= 3.05e-52) {
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 <= (-6.2d+36)) then
tmp = x - ((y * t) / a)
else if (t <= 3.05d-52) 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 <= -6.2e+36) {
tmp = x - ((y * t) / a);
} else if (t <= 3.05e-52) {
tmp = x + (z * (y / a));
} else {
tmp = x - (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.2e+36: tmp = x - ((y * t) / a) elif t <= 3.05e-52: 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 <= -6.2e+36) tmp = Float64(x - Float64(Float64(y * t) / a)); elseif (t <= 3.05e-52) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x - Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6.2e+36) tmp = x - ((y * t) / a); elseif (t <= 3.05e-52) 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, -6.2e+36], N[(x - N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.05e-52], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{+36}:\\
\;\;\;\;x - \frac{y \cdot t}{a}\\
\mathbf{elif}\;t \leq 3.05 \cdot 10^{-52}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -6.1999999999999999e36Initial program 97.8%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in z around 0 91.8%
mul-1-neg91.8%
unsub-neg91.8%
*-commutative91.8%
associate-/l*83.5%
Simplified83.5%
Taylor expanded in y around 0 91.8%
if -6.1999999999999999e36 < t < 3.04999999999999995e-52Initial program 97.0%
associate-/l*93.5%
Simplified93.5%
Taylor expanded in y around 0 97.0%
associate-*l/95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in z around inf 91.7%
associate-*l/91.7%
*-commutative91.7%
Simplified91.7%
if 3.04999999999999995e-52 < t Initial program 95.0%
associate-/l*93.7%
Simplified93.7%
Taylor expanded in y around 0 95.0%
associate-*l/98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in z around 0 84.3%
associate-*r/86.7%
associate-*r*86.7%
neg-mul-186.7%
cancel-sign-sub-inv86.7%
Simplified86.7%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -8.4e+41) (not (<= t 2.4e+95))) (* t (/ y (- a))) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -8.4e+41) || !(t <= 2.4e+95)) {
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 ((t <= (-8.4d+41)) .or. (.not. (t <= 2.4d+95))) 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 ((t <= -8.4e+41) || !(t <= 2.4e+95)) {
tmp = t * (y / -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -8.4e+41) or not (t <= 2.4e+95): tmp = t * (y / -a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -8.4e+41) || !(t <= 2.4e+95)) 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 ((t <= -8.4e+41) || ~((t <= 2.4e+95))) tmp = t * (y / -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -8.4e+41], N[Not[LessEqual[t, 2.4e+95]], $MachinePrecision]], N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.4 \cdot 10^{+41} \lor \neg \left(t \leq 2.4 \cdot 10^{+95}\right):\\
\;\;\;\;t \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -8.3999999999999998e41 or 2.4e95 < t Initial program 95.2%
associate-/l*91.6%
Simplified91.6%
Taylor expanded in z around 0 88.0%
mul-1-neg88.0%
unsub-neg88.0%
*-commutative88.0%
associate-/l*82.0%
Simplified82.0%
Taylor expanded in y around 0 88.0%
Taylor expanded in x around 0 64.2%
mul-1-neg64.2%
distribute-frac-neg264.2%
associate-*r/63.7%
Simplified63.7%
if -8.3999999999999998e41 < t < 2.4e95Initial program 97.5%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in x around inf 50.4%
Final simplification55.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.1e+38) (/ (* t (- y)) a) (if (<= t 1.7e+95) x (* t (/ y (- a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.1e+38) {
tmp = (t * -y) / a;
} else if (t <= 1.7e+95) {
tmp = x;
} else {
tmp = 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 <= (-2.1d+38)) then
tmp = (t * -y) / a
else if (t <= 1.7d+95) then
tmp = x
else
tmp = 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 <= -2.1e+38) {
tmp = (t * -y) / a;
} else if (t <= 1.7e+95) {
tmp = x;
} else {
tmp = t * (y / -a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.1e+38: tmp = (t * -y) / a elif t <= 1.7e+95: tmp = x else: tmp = t * (y / -a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.1e+38) tmp = Float64(Float64(t * Float64(-y)) / a); elseif (t <= 1.7e+95) tmp = x; else tmp = Float64(t * Float64(y / Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.1e+38) tmp = (t * -y) / a; elseif (t <= 1.7e+95) tmp = x; else tmp = t * (y / -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.1e+38], N[(N[(t * (-y)), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t, 1.7e+95], x, N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{+38}:\\
\;\;\;\;\frac{t \cdot \left(-y\right)}{a}\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+95}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{-a}\\
\end{array}
\end{array}
if t < -2.1e38Initial program 97.8%
associate-/l*90.6%
Simplified90.6%
Taylor expanded in z around 0 91.8%
mul-1-neg91.8%
unsub-neg91.8%
*-commutative91.8%
associate-/l*83.5%
Simplified83.5%
Taylor expanded in y around 0 91.8%
Taylor expanded in x around 0 71.6%
mul-1-neg71.6%
distribute-frac-neg271.6%
associate-*r/69.0%
Simplified69.0%
*-commutative69.0%
distribute-frac-neg269.0%
distribute-frac-neg69.0%
associate-*l/71.6%
Applied egg-rr71.6%
if -2.1e38 < t < 1.70000000000000011e95Initial program 97.5%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in x around inf 50.4%
if 1.70000000000000011e95 < t Initial program 92.7%
associate-/l*92.5%
Simplified92.5%
Taylor expanded in z around 0 84.3%
mul-1-neg84.3%
unsub-neg84.3%
*-commutative84.3%
associate-/l*80.5%
Simplified80.5%
Taylor expanded in y around 0 84.3%
Taylor expanded in x around 0 56.9%
mul-1-neg56.9%
distribute-frac-neg256.9%
associate-*r/58.5%
Simplified58.5%
Final simplification56.1%
(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 96.6%
associate-/l*93.0%
Simplified93.0%
Taylor expanded in y around 0 96.6%
associate-*l/96.6%
*-commutative96.6%
Simplified96.6%
(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 96.6%
associate-/l*93.0%
Simplified93.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 96.6%
associate-/l*93.0%
Simplified93.0%
Taylor expanded in x around inf 41.2%
(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 2024087
(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)))