
(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 (* (- 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 93.7%
*-commutative93.7%
associate-/l*97.5%
Applied egg-rr97.5%
(FPCore (x y z t a)
:precision binary64
(if (<= x -2.1e-39)
x
(if (<= x -5.8e-100)
(* y (/ z a))
(if (<= x -7.6e-285)
(* y (/ t (- a)))
(if (<= x 2.3e-107) (/ (* z y) a) x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.1e-39) {
tmp = x;
} else if (x <= -5.8e-100) {
tmp = y * (z / a);
} else if (x <= -7.6e-285) {
tmp = y * (t / -a);
} else if (x <= 2.3e-107) {
tmp = (z * 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 (x <= (-2.1d-39)) then
tmp = x
else if (x <= (-5.8d-100)) then
tmp = y * (z / a)
else if (x <= (-7.6d-285)) then
tmp = y * (t / -a)
else if (x <= 2.3d-107) then
tmp = (z * 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 (x <= -2.1e-39) {
tmp = x;
} else if (x <= -5.8e-100) {
tmp = y * (z / a);
} else if (x <= -7.6e-285) {
tmp = y * (t / -a);
} else if (x <= 2.3e-107) {
tmp = (z * y) / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.1e-39: tmp = x elif x <= -5.8e-100: tmp = y * (z / a) elif x <= -7.6e-285: tmp = y * (t / -a) elif x <= 2.3e-107: tmp = (z * y) / a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.1e-39) tmp = x; elseif (x <= -5.8e-100) tmp = Float64(y * Float64(z / a)); elseif (x <= -7.6e-285) tmp = Float64(y * Float64(t / Float64(-a))); elseif (x <= 2.3e-107) tmp = Float64(Float64(z * y) / a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.1e-39) tmp = x; elseif (x <= -5.8e-100) tmp = y * (z / a); elseif (x <= -7.6e-285) tmp = y * (t / -a); elseif (x <= 2.3e-107) tmp = (z * y) / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.1e-39], x, If[LessEqual[x, -5.8e-100], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7.6e-285], N[(y * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.3e-107], N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-39}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-100}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;x \leq -7.6 \cdot 10^{-285}:\\
\;\;\;\;y \cdot \frac{t}{-a}\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{-107}:\\
\;\;\;\;\frac{z \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.09999999999999993e-39 or 2.30000000000000003e-107 < x Initial program 94.5%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in x around inf 58.5%
if -2.09999999999999993e-39 < x < -5.79999999999999951e-100Initial program 99.8%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in y around inf 99.9%
Taylor expanded in z around inf 65.4%
if -5.79999999999999951e-100 < x < -7.6000000000000003e-285Initial program 88.5%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in y around inf 93.1%
Taylor expanded in t around inf 62.1%
mul-1-neg62.1%
distribute-frac-neg62.1%
Simplified62.1%
if -7.6000000000000003e-285 < x < 2.30000000000000003e-107Initial program 93.5%
associate-/l*85.4%
Simplified85.4%
Taylor expanded in y around inf 85.2%
Taylor expanded in z around inf 55.6%
*-commutative55.6%
associate-*l/59.5%
Applied egg-rr59.5%
Final simplification59.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.7e+56) (not (<= t 2.9e+121))) (- 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.7e+56) || !(t <= 2.9e+121)) {
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.7d+56)) .or. (.not. (t <= 2.9d+121))) 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.7e+56) || !(t <= 2.9e+121)) {
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.7e+56) or not (t <= 2.9e+121): 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.7e+56) || !(t <= 2.9e+121)) 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.7e+56) || ~((t <= 2.9e+121))) 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.7e+56], N[Not[LessEqual[t, 2.9e+121]], $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.7 \cdot 10^{+56} \lor \neg \left(t \leq 2.9 \cdot 10^{+121}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.7000000000000001e56 or 2.8999999999999999e121 < t Initial program 92.7%
*-commutative92.7%
associate-/l*99.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 87.4%
associate-*l/82.8%
*-commutative82.8%
neg-mul-182.8%
sub-neg82.8%
*-commutative82.8%
associate-*l/87.4%
associate-*r/94.1%
Simplified94.1%
if -2.7000000000000001e56 < t < 2.8999999999999999e121Initial program 94.2%
*-commutative94.2%
associate-/l*96.2%
Applied egg-rr96.2%
Taylor expanded in z around inf 84.9%
associate-*l/87.1%
*-commutative87.1%
Simplified87.1%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.9e-42) (not (<= y 1.7e-92))) (* y (/ (- z t) a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.9e-42) || !(y <= 1.7e-92)) {
tmp = y * ((z - t) / 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 <= (-1.9d-42)) .or. (.not. (y <= 1.7d-92))) then
tmp = y * ((z - t) / 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 <= -1.9e-42) || !(y <= 1.7e-92)) {
tmp = y * ((z - t) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.9e-42) or not (y <= 1.7e-92): tmp = y * ((z - t) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.9e-42) || !(y <= 1.7e-92)) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.9e-42) || ~((y <= 1.7e-92))) tmp = y * ((z - t) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.9e-42], N[Not[LessEqual[y, 1.7e-92]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-42} \lor \neg \left(y \leq 1.7 \cdot 10^{-92}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.90000000000000009e-42 or 1.7000000000000001e-92 < y Initial program 90.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 98.6%
Taylor expanded in x around 0 73.8%
div-sub74.4%
Simplified74.4%
if -1.90000000000000009e-42 < y < 1.7000000000000001e-92Initial program 98.9%
associate-/l*80.4%
Simplified80.4%
Taylor expanded in x around inf 65.0%
Final simplification71.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.7e+47) (* y (/ (- z t) a)) (if (<= t 8.5e+204) (+ x (* z (/ y a))) (/ (- t) (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.7e+47) {
tmp = y * ((z - t) / a);
} else if (t <= 8.5e+204) {
tmp = x + (z * (y / 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 <= (-1.7d+47)) then
tmp = y * ((z - t) / a)
else if (t <= 8.5d+204) then
tmp = x + (z * (y / 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 <= -1.7e+47) {
tmp = y * ((z - t) / a);
} else if (t <= 8.5e+204) {
tmp = x + (z * (y / a));
} else {
tmp = -t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.7e+47: tmp = y * ((z - t) / a) elif t <= 8.5e+204: tmp = x + (z * (y / a)) else: tmp = -t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.7e+47) tmp = Float64(y * Float64(Float64(z - t) / a)); elseif (t <= 8.5e+204) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(Float64(-t) / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.7e+47) tmp = y * ((z - t) / a); elseif (t <= 8.5e+204) tmp = x + (z * (y / a)); else tmp = -t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.7e+47], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e+204], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-t) / N[(a / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{+47}:\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+204}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-t}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -1.6999999999999999e47Initial program 92.4%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in y around inf 88.0%
Taylor expanded in x around 0 76.9%
div-sub76.9%
Simplified76.9%
if -1.6999999999999999e47 < t < 8.5e204Initial program 94.6%
*-commutative94.6%
associate-/l*96.5%
Applied egg-rr96.5%
Taylor expanded in z around inf 82.9%
associate-*l/85.0%
*-commutative85.0%
Simplified85.0%
if 8.5e204 < t Initial program 89.4%
associate-/l*84.3%
Simplified84.3%
Taylor expanded in y around inf 67.8%
Taylor expanded in t around inf 73.4%
mul-1-neg73.4%
distribute-frac-neg73.4%
Simplified73.4%
distribute-frac-neg73.4%
distribute-rgt-neg-out73.4%
*-commutative73.4%
associate-/r/88.8%
distribute-neg-frac288.8%
distribute-neg-frac88.8%
Applied egg-rr88.8%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.6e+46) (not (<= t 5.4e+121))) (/ (- t) (/ a y)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.6e+46) || !(t <= 5.4e+121)) {
tmp = -t / (a / y);
} 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 <= (-7.6d+46)) .or. (.not. (t <= 5.4d+121))) then
tmp = -t / (a / y)
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 <= -7.6e+46) || !(t <= 5.4e+121)) {
tmp = -t / (a / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.6e+46) or not (t <= 5.4e+121): tmp = -t / (a / y) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.6e+46) || !(t <= 5.4e+121)) tmp = Float64(Float64(-t) / Float64(a / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.6e+46) || ~((t <= 5.4e+121))) tmp = -t / (a / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.6e+46], N[Not[LessEqual[t, 5.4e+121]], $MachinePrecision]], N[((-t) / N[(a / y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.6 \cdot 10^{+46} \lor \neg \left(t \leq 5.4 \cdot 10^{+121}\right):\\
\;\;\;\;\frac{-t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -7.5999999999999998e46 or 5.4000000000000004e121 < t Initial program 93.1%
associate-/l*88.3%
Simplified88.3%
Taylor expanded in y around inf 80.3%
Taylor expanded in t around inf 64.4%
mul-1-neg64.4%
distribute-frac-neg64.4%
Simplified64.4%
distribute-frac-neg64.4%
distribute-rgt-neg-out64.4%
*-commutative64.4%
associate-/r/70.1%
distribute-neg-frac270.1%
distribute-neg-frac70.1%
Applied egg-rr70.1%
if -7.5999999999999998e46 < t < 5.4000000000000004e121Initial program 94.0%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in x around inf 51.4%
Final simplification58.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.02e-70) (not (<= z 2.2e+93))) (* y (/ z a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.02e-70) || !(z <= 2.2e+93)) {
tmp = y * (z / 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 ((z <= (-1.02d-70)) .or. (.not. (z <= 2.2d+93))) then
tmp = y * (z / 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 ((z <= -1.02e-70) || !(z <= 2.2e+93)) {
tmp = y * (z / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.02e-70) or not (z <= 2.2e+93): tmp = y * (z / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.02e-70) || !(z <= 2.2e+93)) tmp = Float64(y * Float64(z / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.02e-70) || ~((z <= 2.2e+93))) tmp = y * (z / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.02e-70], N[Not[LessEqual[z, 2.2e+93]], $MachinePrecision]], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{-70} \lor \neg \left(z \leq 2.2 \cdot 10^{+93}\right):\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.0200000000000001e-70 or 2.20000000000000021e93 < z Initial program 89.4%
associate-/l*88.6%
Simplified88.6%
Taylor expanded in y around inf 79.7%
Taylor expanded in z around inf 56.9%
if -1.0200000000000001e-70 < z < 2.20000000000000021e93Initial program 96.8%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in x around inf 52.1%
Final simplification54.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.7e-52) x (if (<= a 1.8e+32) (/ (* z y) a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.7e-52) {
tmp = x;
} else if (a <= 1.8e+32) {
tmp = (z * y) / a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-2.7d-52)) then
tmp = x
else if (a <= 1.8d+32) then
tmp = (z * y) / a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.7e-52) {
tmp = x;
} else if (a <= 1.8e+32) {
tmp = (z * y) / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.7e-52: tmp = x elif a <= 1.8e+32: tmp = (z * y) / a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.7e-52) tmp = x; elseif (a <= 1.8e+32) tmp = Float64(Float64(z * y) / a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.7e-52) tmp = x; elseif (a <= 1.8e+32) tmp = (z * y) / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.7e-52], x, If[LessEqual[a, 1.8e+32], N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{-52}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+32}:\\
\;\;\;\;\frac{z \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.70000000000000009e-52 or 1.7999999999999998e32 < a Initial program 88.3%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around inf 60.9%
if -2.70000000000000009e-52 < a < 1.7999999999999998e32Initial program 99.1%
associate-/l*85.9%
Simplified85.9%
Taylor expanded in y around inf 76.9%
Taylor expanded in z around inf 43.4%
*-commutative43.4%
associate-*l/48.2%
Applied egg-rr48.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.5e-71) (* y (/ z a)) (if (<= z 5.5e+92) x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e-71) {
tmp = y * (z / a);
} else if (z <= 5.5e+92) {
tmp = x;
} else {
tmp = y / (a / z);
}
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 <= (-7.5d-71)) then
tmp = y * (z / a)
else if (z <= 5.5d+92) then
tmp = x
else
tmp = y / (a / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.5e-71) {
tmp = y * (z / a);
} else if (z <= 5.5e+92) {
tmp = x;
} else {
tmp = y / (a / z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.5e-71: tmp = y * (z / a) elif z <= 5.5e+92: tmp = x else: tmp = y / (a / z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.5e-71) tmp = Float64(y * Float64(z / a)); elseif (z <= 5.5e+92) tmp = x; else tmp = Float64(y / Float64(a / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -7.5e-71) tmp = y * (z / a); elseif (z <= 5.5e+92) tmp = x; else tmp = y / (a / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.5e-71], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e+92], x, N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-71}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+92}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if z < -7.5000000000000004e-71Initial program 91.4%
associate-/l*86.7%
Simplified86.7%
Taylor expanded in y around inf 78.1%
Taylor expanded in z around inf 50.2%
if -7.5000000000000004e-71 < z < 5.50000000000000053e92Initial program 96.8%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in x around inf 52.1%
if 5.50000000000000053e92 < z Initial program 84.2%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in y around inf 83.8%
Taylor expanded in z around inf 74.2%
clear-num74.1%
un-div-inv74.3%
Applied egg-rr74.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 8.2e+124) (+ x (* y (/ (- z t) a))) (- x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 8.2e+124) {
tmp = x + (y * ((z - t) / 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 <= 8.2d+124) then
tmp = x + (y * ((z - t) / 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 <= 8.2e+124) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = x - (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 8.2e+124: tmp = x + (y * ((z - t) / a)) else: tmp = x - (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 8.2e+124) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / 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 <= 8.2e+124) tmp = x + (y * ((z - t) / a)); else tmp = x - (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 8.2e+124], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 8.2 \cdot 10^{+124}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < 8.20000000000000002e124Initial program 93.6%
associate-/l*95.7%
Simplified95.7%
if 8.20000000000000002e124 < t Initial program 94.3%
*-commutative94.3%
associate-/l*100.0%
Applied egg-rr100.0%
Taylor expanded in z around 0 94.3%
associate-*l/75.1%
*-commutative75.1%
neg-mul-175.1%
sub-neg75.1%
*-commutative75.1%
associate-*l/94.3%
associate-*r/100.0%
Simplified100.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 93.7%
associate-/l*92.9%
Simplified92.9%
Taylor expanded in x around inf 40.4%
(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 2024137
(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)))