
(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 (+ x (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (t - z));
}
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) * (t - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (t - z));
}
def code(x, y, z, t, a): return x + ((y / a) * (t - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y / a) * Float64(t - z))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y / a) * (t - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{a} \cdot \left(t - z\right)
\end{array}
Initial program 94.7%
associate-*l/97.3%
Simplified97.3%
Final simplification97.3%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.8e+123) (+ x (* y (/ t a))) (if (<= t 26000000.0) (- x (* (/ y a) z)) (- x (/ y (/ (- a) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.8e+123) {
tmp = x + (y * (t / a));
} else if (t <= 26000000.0) {
tmp = x - ((y / a) * z);
} 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 (t <= (-4.8d+123)) then
tmp = x + (y * (t / a))
else if (t <= 26000000.0d0) then
tmp = x - ((y / a) * z)
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 (t <= -4.8e+123) {
tmp = x + (y * (t / a));
} else if (t <= 26000000.0) {
tmp = x - ((y / a) * z);
} else {
tmp = x - (y / (-a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.8e+123: tmp = x + (y * (t / a)) elif t <= 26000000.0: tmp = x - ((y / a) * z) else: tmp = x - (y / (-a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.8e+123) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (t <= 26000000.0) tmp = Float64(x - Float64(Float64(y / a) * z)); else tmp = Float64(x - Float64(y / Float64(Float64(-a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.8e+123) tmp = x + (y * (t / a)); elseif (t <= 26000000.0) tmp = x - ((y / a) * z); else tmp = x - (y / (-a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.8e+123], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 26000000.0], N[(x - N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[((-a) / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+123}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;t \leq 26000000:\\
\;\;\;\;x - \frac{y}{a} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{-a}{t}}\\
\end{array}
\end{array}
if t < -4.79999999999999978e123Initial program 94.8%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 89.5%
associate-*r/89.5%
neg-mul-189.5%
Simplified89.5%
Taylor expanded in x around 0 84.4%
associate-/l*61.1%
associate-/r/63.7%
Applied egg-rr89.5%
if -4.79999999999999978e123 < t < 2.6e7Initial program 96.1%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in z around inf 82.6%
associate-*l/87.7%
*-commutative87.7%
Simplified87.7%
if 2.6e7 < t Initial program 91.8%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in z around 0 84.7%
associate-*r/84.7%
neg-mul-184.7%
Simplified84.7%
Final simplification87.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.3e+63) (not (<= z 9800000.0))) (- x (* y (/ z a))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.3e+63) || !(z <= 9800000.0)) {
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 <= (-6.3d+63)) .or. (.not. (z <= 9800000.0d0))) 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 <= -6.3e+63) || !(z <= 9800000.0)) {
tmp = x - (y * (z / a));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.3e+63) or not (z <= 9800000.0): 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 <= -6.3e+63) || !(z <= 9800000.0)) tmp = Float64(x - Float64(y * Float64(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 <= -6.3e+63) || ~((z <= 9800000.0))) 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, -6.3e+63], N[Not[LessEqual[z, 9800000.0]], $MachinePrecision]], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.3 \cdot 10^{+63} \lor \neg \left(z \leq 9800000\right):\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -6.2999999999999998e63 or 9.8e6 < z Initial program 92.2%
associate-/l*91.5%
Simplified91.5%
clear-num91.5%
associate-/r/91.5%
clear-num91.6%
Applied egg-rr91.6%
Taylor expanded in z around inf 77.1%
associate-*r/76.5%
Simplified76.5%
if -6.2999999999999998e63 < z < 9.8e6Initial program 96.6%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in z around 0 89.9%
associate-*r/89.9%
neg-mul-189.9%
Simplified89.9%
Taylor expanded in x around 0 88.0%
associate-/l*41.6%
associate-/r/43.2%
Applied egg-rr89.8%
Final simplification84.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.8e+123) (not (<= t 38000000.0))) (+ x (* y (/ t a))) (- x (* (/ y a) z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.8e+123) || !(t <= 38000000.0)) {
tmp = x + (y * (t / a));
} else {
tmp = x - ((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 ((t <= (-4.8d+123)) .or. (.not. (t <= 38000000.0d0))) then
tmp = x + (y * (t / a))
else
tmp = x - ((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 ((t <= -4.8e+123) || !(t <= 38000000.0)) {
tmp = x + (y * (t / a));
} else {
tmp = x - ((y / a) * z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.8e+123) or not (t <= 38000000.0): tmp = x + (y * (t / a)) else: tmp = x - ((y / a) * z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.8e+123) || !(t <= 38000000.0)) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x - Float64(Float64(y / a) * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -4.8e+123) || ~((t <= 38000000.0))) tmp = x + (y * (t / a)); else tmp = x - ((y / a) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.8e+123], N[Not[LessEqual[t, 38000000.0]], $MachinePrecision]], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+123} \lor \neg \left(t \leq 38000000\right):\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{a} \cdot z\\
\end{array}
\end{array}
if t < -4.79999999999999978e123 or 3.8e7 < t Initial program 92.8%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in z around 0 86.3%
associate-*r/86.3%
neg-mul-186.3%
Simplified86.3%
Taylor expanded in x around 0 81.0%
associate-/l*60.7%
associate-/r/62.5%
Applied egg-rr86.3%
if -4.79999999999999978e123 < t < 3.8e7Initial program 96.1%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in z around inf 82.6%
associate-*l/87.7%
*-commutative87.7%
Simplified87.7%
Final simplification87.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.4e-14) (not (<= y 2e-154))) (* (/ y a) t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.4e-14) || !(y <= 2e-154)) {
tmp = (y / a) * t;
} 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 <= (-2.4d-14)) .or. (.not. (y <= 2d-154))) then
tmp = (y / a) * t
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 <= -2.4e-14) || !(y <= 2e-154)) {
tmp = (y / a) * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.4e-14) or not (y <= 2e-154): tmp = (y / a) * t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.4e-14) || !(y <= 2e-154)) tmp = Float64(Float64(y / a) * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2.4e-14) || ~((y <= 2e-154))) tmp = (y / a) * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.4e-14], N[Not[LessEqual[y, 2e-154]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-14} \lor \neg \left(y \leq 2 \cdot 10^{-154}\right):\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.4e-14 or 1.9999999999999999e-154 < y Initial program 91.7%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around 0 63.9%
associate-*r/63.9%
neg-mul-163.9%
Simplified63.9%
Taylor expanded in x around 0 43.3%
associate-*r/46.0%
Simplified46.0%
if -2.4e-14 < y < 1.9999999999999999e-154Initial program 99.9%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in z around 0 83.8%
associate-*r/83.8%
neg-mul-183.8%
Simplified83.8%
Taylor expanded in x around inf 68.5%
Final simplification54.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6e+143) (not (<= t 290000000.0))) (* y (/ t a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6e+143) || !(t <= 290000000.0)) {
tmp = y * (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 ((t <= (-6d+143)) .or. (.not. (t <= 290000000.0d0))) then
tmp = y * (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 ((t <= -6e+143) || !(t <= 290000000.0)) {
tmp = y * (t / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6e+143) or not (t <= 290000000.0): tmp = y * (t / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6e+143) || !(t <= 290000000.0)) tmp = Float64(y * Float64(t / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6e+143) || ~((t <= 290000000.0))) tmp = y * (t / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6e+143], N[Not[LessEqual[t, 290000000.0]], $MachinePrecision]], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+143} \lor \neg \left(t \leq 290000000\right):\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -6.0000000000000001e143 or 2.9e8 < t Initial program 92.5%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in z around 0 85.7%
associate-*r/85.7%
neg-mul-185.7%
Simplified85.7%
Taylor expanded in x around 0 59.8%
associate-/l*62.5%
associate-/r/64.5%
Applied egg-rr64.5%
if -6.0000000000000001e143 < t < 2.9e8Initial program 96.2%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in z around 0 61.6%
associate-*r/61.6%
neg-mul-161.6%
Simplified61.6%
Taylor expanded in x around inf 48.6%
Final simplification54.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -6e+143) (* y (/ t a)) (if (<= t 1950000000.0) x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6e+143) {
tmp = y * (t / a);
} else if (t <= 1950000000.0) {
tmp = x;
} else {
tmp = 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 (t <= (-6d+143)) then
tmp = y * (t / a)
else if (t <= 1950000000.0d0) then
tmp = x
else
tmp = 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 (t <= -6e+143) {
tmp = y * (t / a);
} else if (t <= 1950000000.0) {
tmp = x;
} else {
tmp = y / (a / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6e+143: tmp = y * (t / a) elif t <= 1950000000.0: tmp = x else: tmp = y / (a / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6e+143) tmp = Float64(y * Float64(t / a)); elseif (t <= 1950000000.0) tmp = x; else tmp = Float64(y / Float64(a / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6e+143) tmp = y * (t / a); elseif (t <= 1950000000.0) tmp = x; else tmp = y / (a / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6e+143], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1950000000.0], x, N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+143}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;t \leq 1950000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if t < -6.0000000000000001e143Initial program 94.2%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in z around 0 88.2%
associate-*r/88.2%
neg-mul-188.2%
Simplified88.2%
Taylor expanded in x around 0 62.3%
associate-/l*65.2%
associate-/r/68.1%
Applied egg-rr68.1%
if -6.0000000000000001e143 < t < 1.95e9Initial program 96.2%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in z around 0 61.6%
associate-*r/61.6%
neg-mul-161.6%
Simplified61.6%
Taylor expanded in x around inf 48.6%
if 1.95e9 < t Initial program 91.7%
associate-/l*93.3%
Simplified93.3%
Taylor expanded in z around 0 84.5%
associate-*r/84.5%
neg-mul-184.5%
Simplified84.5%
Taylor expanded in x around 0 58.6%
associate-*r/61.2%
Simplified61.2%
associate-*r/58.6%
*-commutative58.6%
associate-/l*62.8%
Applied egg-rr62.8%
Final simplification55.0%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ t a))))
double code(double x, double y, double z, double t, double a) {
return x + (y * (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 * (t / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * (t / a));
}
def code(x, y, z, t, a): return x + (y * (t / a))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(t / a))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * (t / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{t}{a}
\end{array}
Initial program 94.7%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in z around 0 71.2%
associate-*r/71.2%
neg-mul-171.2%
Simplified71.2%
Taylor expanded in x around 0 69.7%
associate-/l*34.9%
associate-/r/35.5%
Applied egg-rr71.2%
Final simplification71.2%
(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 94.7%
associate-/l*95.5%
Simplified95.5%
Taylor expanded in z around 0 71.2%
associate-*r/71.2%
neg-mul-171.2%
Simplified71.2%
Taylor expanded in x around inf 38.6%
Final simplification38.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 2023275
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
:precision binary64
:herbie-target
(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)))