
(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 11 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 (/ (* 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}
Initial program 97.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.4e+96) (not (<= z 4.4e+48))) (+ x (/ (* y z) a)) (- x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.4e+96) || !(z <= 4.4e+48)) {
tmp = x + ((y * z) / a);
} else {
tmp = x - ((y * 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 ((z <= (-4.4d+96)) .or. (.not. (z <= 4.4d+48))) then
tmp = x + ((y * z) / a)
else
tmp = x - ((y * 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 ((z <= -4.4e+96) || !(z <= 4.4e+48)) {
tmp = x + ((y * z) / a);
} else {
tmp = x - ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.4e+96) or not (z <= 4.4e+48): tmp = x + ((y * z) / a) else: tmp = x - ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.4e+96) || !(z <= 4.4e+48)) tmp = Float64(x + Float64(Float64(y * z) / a)); else tmp = Float64(x - Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.4e+96) || ~((z <= 4.4e+48))) tmp = x + ((y * z) / a); else tmp = x - ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.4e+96], N[Not[LessEqual[z, 4.4e+48]], $MachinePrecision]], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+96} \lor \neg \left(z \leq 4.4 \cdot 10^{+48}\right):\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -4.3999999999999998e96 or 4.3999999999999999e48 < z Initial program 96.3%
associate-/l*89.0%
Simplified89.0%
Taylor expanded in z around inf 89.8%
if -4.3999999999999998e96 < z < 4.3999999999999999e48Initial program 98.1%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around 0 88.4%
+-commutative88.4%
associate-*r/88.4%
mul-1-neg88.4%
distribute-lft-neg-out88.4%
*-commutative88.4%
Simplified88.4%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.5e+96) (not (<= z 2.4e+48))) (+ x (/ (* y z) a)) (- x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e+96) || !(z <= 2.4e+48)) {
tmp = x + ((y * z) / a);
} else {
tmp = x - ((y * 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 ((z <= (-3.5d+96)) .or. (.not. (z <= 2.4d+48))) then
tmp = x + ((y * z) / a)
else
tmp = x - ((y * 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 ((z <= -3.5e+96) || !(z <= 2.4e+48)) {
tmp = x + ((y * z) / a);
} else {
tmp = x - ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.5e+96) or not (z <= 2.4e+48): tmp = x + ((y * z) / a) else: tmp = x - ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.5e+96) || !(z <= 2.4e+48)) tmp = Float64(x + Float64(Float64(y * z) / a)); else tmp = Float64(x - Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.5e+96) || ~((z <= 2.4e+48))) tmp = x + ((y * z) / a); else tmp = x - ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.5e+96], N[Not[LessEqual[z, 2.4e+48]], $MachinePrecision]], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+96} \lor \neg \left(z \leq 2.4 \cdot 10^{+48}\right):\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -3.4999999999999999e96 or 2.4000000000000001e48 < z Initial program 96.3%
associate-/l*89.0%
Simplified89.0%
Taylor expanded in z around inf 89.8%
if -3.4999999999999999e96 < z < 2.4000000000000001e48Initial program 98.1%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around 0 88.4%
mul-1-neg88.4%
unsub-neg88.4%
*-commutative88.4%
associate-/l*87.4%
Simplified87.4%
associate-*r/88.4%
Applied egg-rr88.4%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6e+98) (not (<= z 2.5e+48))) (+ x (/ (* y z) a)) (- x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6e+98) || !(z <= 2.5e+48)) {
tmp = x + ((y * z) / a);
} else {
tmp = x - (y / (a / 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 ((z <= (-6d+98)) .or. (.not. (z <= 2.5d+48))) then
tmp = x + ((y * z) / a)
else
tmp = x - (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6e+98) || !(z <= 2.5e+48)) {
tmp = x + ((y * z) / a);
} else {
tmp = x - (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6e+98) or not (z <= 2.5e+48): tmp = x + ((y * z) / a) else: tmp = x - (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6e+98) || !(z <= 2.5e+48)) tmp = Float64(x + Float64(Float64(y * z) / a)); else tmp = Float64(x - Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6e+98) || ~((z <= 2.5e+48))) tmp = x + ((y * z) / a); else tmp = x - (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6e+98], N[Not[LessEqual[z, 2.5e+48]], $MachinePrecision]], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+98} \lor \neg \left(z \leq 2.5 \cdot 10^{+48}\right):\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -6.0000000000000003e98 or 2.49999999999999987e48 < z Initial program 96.3%
associate-/l*89.0%
Simplified89.0%
Taylor expanded in z around inf 89.8%
if -6.0000000000000003e98 < z < 2.49999999999999987e48Initial program 98.1%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around 0 88.4%
mul-1-neg88.4%
unsub-neg88.4%
*-commutative88.4%
associate-/l*87.4%
Simplified87.4%
clear-num87.4%
un-div-inv87.8%
Applied egg-rr87.8%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6e+98) (not (<= z 2.3e+26))) (+ x (/ (* y z) a)) (- x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6e+98) || !(z <= 2.3e+26)) {
tmp = x + ((y * z) / a);
} else {
tmp = x - (y * (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 ((z <= (-6d+98)) .or. (.not. (z <= 2.3d+26))) then
tmp = x + ((y * z) / a)
else
tmp = x - (y * (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 ((z <= -6e+98) || !(z <= 2.3e+26)) {
tmp = x + ((y * z) / a);
} else {
tmp = x - (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6e+98) or not (z <= 2.3e+26): tmp = x + ((y * z) / a) else: tmp = x - (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6e+98) || !(z <= 2.3e+26)) tmp = Float64(x + Float64(Float64(y * z) / a)); else tmp = Float64(x - Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -6e+98) || ~((z <= 2.3e+26))) tmp = x + ((y * z) / a); else tmp = x - (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6e+98], N[Not[LessEqual[z, 2.3e+26]], $MachinePrecision]], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+98} \lor \neg \left(z \leq 2.3 \cdot 10^{+26}\right):\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -6.0000000000000003e98 or 2.3000000000000001e26 < z Initial program 96.5%
associate-/l*88.3%
Simplified88.3%
Taylor expanded in z around inf 87.9%
if -6.0000000000000003e98 < z < 2.3000000000000001e26Initial program 98.0%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in z around 0 88.7%
mul-1-neg88.7%
unsub-neg88.7%
*-commutative88.7%
associate-/l*88.3%
Simplified88.3%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.4e+188) (* y (/ t (- a))) (if (<= t 6.8e+167) (+ x (/ (* y z) a)) (/ t (/ (- a) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.4e+188) {
tmp = y * (t / -a);
} else if (t <= 6.8e+167) {
tmp = x + ((y * z) / a);
} else {
tmp = 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 <= (-5.4d+188)) then
tmp = y * (t / -a)
else if (t <= 6.8d+167) then
tmp = x + ((y * z) / a)
else
tmp = 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 <= -5.4e+188) {
tmp = y * (t / -a);
} else if (t <= 6.8e+167) {
tmp = x + ((y * z) / a);
} else {
tmp = t / (-a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.4e+188: tmp = y * (t / -a) elif t <= 6.8e+167: tmp = x + ((y * z) / a) else: tmp = t / (-a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.4e+188) tmp = Float64(y * Float64(t / Float64(-a))); elseif (t <= 6.8e+167) tmp = Float64(x + Float64(Float64(y * z) / a)); else tmp = Float64(t / Float64(Float64(-a) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.4e+188) tmp = y * (t / -a); elseif (t <= 6.8e+167) tmp = x + ((y * z) / a); else tmp = t / (-a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.4e+188], N[(y * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.8e+167], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(t / N[((-a) / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.4 \cdot 10^{+188}:\\
\;\;\;\;y \cdot \frac{t}{-a}\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{+167}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{-a}{y}}\\
\end{array}
\end{array}
if t < -5.4e188Initial program 95.9%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in z around 0 91.5%
mul-1-neg91.5%
unsub-neg91.5%
*-commutative91.5%
associate-/l*91.2%
Simplified91.2%
Taylor expanded in y around inf 87.1%
Taylor expanded in y around inf 79.1%
associate-*r/79.1%
associate-*r*79.1%
neg-mul-179.1%
associate-*l/83.1%
*-commutative83.1%
Simplified83.1%
if -5.4e188 < t < 6.8000000000000001e167Initial program 98.3%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in z around inf 77.6%
if 6.8000000000000001e167 < t Initial program 93.2%
associate-/l*89.6%
Simplified89.6%
Taylor expanded in z around 0 89.9%
mul-1-neg89.9%
unsub-neg89.9%
*-commutative89.9%
associate-/l*84.5%
Simplified84.5%
Taylor expanded in y around inf 78.0%
Taylor expanded in y around inf 77.5%
mul-1-neg77.5%
associate-*r/78.9%
distribute-rgt-neg-in78.9%
distribute-frac-neg278.9%
Simplified78.9%
Taylor expanded in t around 0 77.5%
mul-1-neg77.5%
associate-*l/72.2%
associate-/r/78.9%
distribute-neg-frac278.9%
Simplified78.9%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.6e-31) (not (<= y 2.4e-63))) (* t (/ y (- a))) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.6e-31) || !(y <= 2.4e-63)) {
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 ((y <= (-4.6d-31)) .or. (.not. (y <= 2.4d-63))) 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 ((y <= -4.6e-31) || !(y <= 2.4e-63)) {
tmp = t * (y / -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.6e-31) or not (y <= 2.4e-63): tmp = t * (y / -a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.6e-31) || !(y <= 2.4e-63)) 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 ((y <= -4.6e-31) || ~((y <= 2.4e-63))) tmp = t * (y / -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.6e-31], N[Not[LessEqual[y, 2.4e-63]], $MachinePrecision]], N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{-31} \lor \neg \left(y \leq 2.4 \cdot 10^{-63}\right):\\
\;\;\;\;t \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.5999999999999997e-31 or 2.4000000000000001e-63 < y Initial program 96.0%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in z around 0 69.3%
mul-1-neg69.3%
unsub-neg69.3%
*-commutative69.3%
associate-/l*70.4%
Simplified70.4%
Taylor expanded in y around inf 69.2%
Taylor expanded in y around inf 51.2%
mul-1-neg51.2%
associate-*r/52.8%
distribute-rgt-neg-in52.8%
distribute-frac-neg252.8%
Simplified52.8%
if -4.5999999999999997e-31 < y < 2.4000000000000001e-63Initial program 99.6%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in x around inf 68.1%
Final simplification59.3%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.85e-31) (* y (/ t (- a))) (if (<= y 1.9e-63) x (* t (/ y (- a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.85e-31) {
tmp = y * (t / -a);
} else if (y <= 1.9e-63) {
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 (y <= (-1.85d-31)) then
tmp = y * (t / -a)
else if (y <= 1.9d-63) 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 (y <= -1.85e-31) {
tmp = y * (t / -a);
} else if (y <= 1.9e-63) {
tmp = x;
} else {
tmp = t * (y / -a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.85e-31: tmp = y * (t / -a) elif y <= 1.9e-63: tmp = x else: tmp = t * (y / -a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.85e-31) tmp = Float64(y * Float64(t / Float64(-a))); elseif (y <= 1.9e-63) 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 (y <= -1.85e-31) tmp = y * (t / -a); elseif (y <= 1.9e-63) tmp = x; else tmp = t * (y / -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.85e-31], N[(y * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.9e-63], x, N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-31}:\\
\;\;\;\;y \cdot \frac{t}{-a}\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-63}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{-a}\\
\end{array}
\end{array}
if y < -1.8499999999999999e-31Initial program 95.3%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in z around 0 72.3%
mul-1-neg72.3%
unsub-neg72.3%
*-commutative72.3%
associate-/l*72.9%
Simplified72.9%
Taylor expanded in y around inf 71.8%
Taylor expanded in y around inf 54.3%
associate-*r/54.3%
associate-*r*54.3%
neg-mul-154.3%
associate-*l/54.8%
*-commutative54.8%
Simplified54.8%
if -1.8499999999999999e-31 < y < 1.90000000000000009e-63Initial program 99.6%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in x around inf 68.1%
if 1.90000000000000009e-63 < y Initial program 96.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around 0 65.5%
mul-1-neg65.5%
unsub-neg65.5%
*-commutative65.5%
associate-/l*67.1%
Simplified67.1%
Taylor expanded in y around inf 65.9%
Taylor expanded in y around inf 47.3%
mul-1-neg47.3%
associate-*r/50.3%
distribute-rgt-neg-in50.3%
distribute-frac-neg250.3%
Simplified50.3%
Final simplification59.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.5e+113) (+ x (/ (* y z) a)) (+ x (* y (/ (- z t) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e+113) {
tmp = x + ((y * z) / 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 (z <= (-6.5d+113)) then
tmp = x + ((y * z) / 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 (z <= -6.5e+113) {
tmp = x + ((y * z) / a);
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.5e+113: tmp = x + ((y * z) / a) else: tmp = x + (y * ((z - t) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.5e+113) tmp = Float64(x + Float64(Float64(y * z) / 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 (z <= -6.5e+113) tmp = x + ((y * z) / a); else tmp = x + (y * ((z - t) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e+113], N[(x + N[(N[(y * z), $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}\;z \leq -6.5 \cdot 10^{+113}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if z < -6.5000000000000001e113Initial program 97.4%
associate-/l*79.4%
Simplified79.4%
Taylor expanded in z around inf 92.4%
if -6.5000000000000001e113 < z Initial program 97.6%
associate-/l*97.3%
Simplified97.3%
(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 97.6%
associate-/l*94.7%
Simplified94.7%
clear-num94.6%
un-div-inv96.3%
Applied egg-rr96.3%
(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 97.6%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in x around inf 40.6%
(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 2024103
(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)))