
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a}
\end{array}
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y (- z t)) a))) (if (<= t_1 -1e+271) (+ x (* y (/ (- z t) a))) (+ t_1 x))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double tmp;
if (t_1 <= -1e+271) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = t_1 + 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) :: t_1
real(8) :: tmp
t_1 = (y * (z - t)) / a
if (t_1 <= (-1d+271)) then
tmp = x + (y * ((z - t) / a))
else
tmp = t_1 + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double tmp;
if (t_1 <= -1e+271) {
tmp = x + (y * ((z - t) / a));
} else {
tmp = t_1 + x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a tmp = 0 if t_1 <= -1e+271: tmp = x + (y * ((z - t) / a)) else: tmp = t_1 + x return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) tmp = 0.0 if (t_1 <= -1e+271) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); else tmp = Float64(t_1 + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; tmp = 0.0; if (t_1 <= -1e+271) tmp = x + (y * ((z - t) / a)); else tmp = t_1 + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+271], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+271}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -9.99999999999999953e270Initial program 76.6%
associate-/l*100.0%
Simplified100.0%
if -9.99999999999999953e270 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 98.5%
Final simplification98.9%
(FPCore (x y z t a)
:precision binary64
(if (or (<= y -7.5e-25)
(not (or (<= y -4.5e-130) (and (not (<= y -3e-229)) (<= y 5.2e+14)))))
(* y (/ (- z t) a))
x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -7.5e-25) || !((y <= -4.5e-130) || (!(y <= -3e-229) && (y <= 5.2e+14)))) {
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 <= (-7.5d-25)) .or. (.not. (y <= (-4.5d-130)) .or. (.not. (y <= (-3d-229))) .and. (y <= 5.2d+14))) 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 <= -7.5e-25) || !((y <= -4.5e-130) || (!(y <= -3e-229) && (y <= 5.2e+14)))) {
tmp = y * ((z - t) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -7.5e-25) or not ((y <= -4.5e-130) or (not (y <= -3e-229) and (y <= 5.2e+14))): tmp = y * ((z - t) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -7.5e-25) || !((y <= -4.5e-130) || (!(y <= -3e-229) && (y <= 5.2e+14)))) 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 <= -7.5e-25) || ~(((y <= -4.5e-130) || (~((y <= -3e-229)) && (y <= 5.2e+14))))) tmp = y * ((z - t) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -7.5e-25], N[Not[Or[LessEqual[y, -4.5e-130], And[N[Not[LessEqual[y, -3e-229]], $MachinePrecision], LessEqual[y, 5.2e+14]]]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{-25} \lor \neg \left(y \leq -4.5 \cdot 10^{-130} \lor \neg \left(y \leq -3 \cdot 10^{-229}\right) \land y \leq 5.2 \cdot 10^{+14}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -7.49999999999999989e-25 or -4.5e-130 < y < -3.00000000000000002e-229 or 5.2e14 < y Initial program 88.3%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in y around 0 88.3%
*-commutative88.3%
associate-*r/95.9%
Simplified95.9%
Taylor expanded in x around 0 88.3%
+-commutative88.3%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in y around inf 77.8%
div-sub79.2%
Simplified79.2%
if -7.49999999999999989e-25 < y < -4.5e-130 or -3.00000000000000002e-229 < y < 5.2e14Initial program 99.9%
associate-/l*88.9%
Simplified88.9%
Taylor expanded in x around inf 64.5%
Final simplification72.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ t (/ a (- y)))))
(if (<= t -2.8e+17)
t_1
(if (<= t 8.8e-275)
x
(if (<= t 2.7e-80) (/ y (/ a z)) (if (<= t 9.5e+76) x t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t / (a / -y);
double tmp;
if (t <= -2.8e+17) {
tmp = t_1;
} else if (t <= 8.8e-275) {
tmp = x;
} else if (t <= 2.7e-80) {
tmp = y / (a / z);
} else if (t <= 9.5e+76) {
tmp = x;
} else {
tmp = 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 = t / (a / -y)
if (t <= (-2.8d+17)) then
tmp = t_1
else if (t <= 8.8d-275) then
tmp = x
else if (t <= 2.7d-80) then
tmp = y / (a / z)
else if (t <= 9.5d+76) then
tmp = x
else
tmp = 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 = t / (a / -y);
double tmp;
if (t <= -2.8e+17) {
tmp = t_1;
} else if (t <= 8.8e-275) {
tmp = x;
} else if (t <= 2.7e-80) {
tmp = y / (a / z);
} else if (t <= 9.5e+76) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t / (a / -y) tmp = 0 if t <= -2.8e+17: tmp = t_1 elif t <= 8.8e-275: tmp = x elif t <= 2.7e-80: tmp = y / (a / z) elif t <= 9.5e+76: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t / Float64(a / Float64(-y))) tmp = 0.0 if (t <= -2.8e+17) tmp = t_1; elseif (t <= 8.8e-275) tmp = x; elseif (t <= 2.7e-80) tmp = Float64(y / Float64(a / z)); elseif (t <= 9.5e+76) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t / (a / -y); tmp = 0.0; if (t <= -2.8e+17) tmp = t_1; elseif (t <= 8.8e-275) tmp = x; elseif (t <= 2.7e-80) tmp = y / (a / z); elseif (t <= 9.5e+76) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t / N[(a / (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.8e+17], t$95$1, If[LessEqual[t, 8.8e-275], x, If[LessEqual[t, 2.7e-80], N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.5e+76], x, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{\frac{a}{-y}}\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{-275}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-80}:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{+76}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.8e17 or 9.5000000000000003e76 < t Initial program 93.2%
associate-/l*90.7%
Simplified90.7%
Taylor expanded in y around 0 93.2%
*-commutative93.2%
associate-*r/97.9%
Simplified97.9%
Taylor expanded in z around 0 82.5%
associate-*l/79.0%
*-commutative79.0%
neg-mul-179.0%
sub-neg79.0%
*-commutative79.0%
associate-*l/82.5%
associate-*r/85.8%
Simplified85.8%
*-commutative85.8%
associate-*l/82.5%
Applied egg-rr82.5%
Taylor expanded in x around 0 63.5%
mul-1-neg63.5%
associate-*l/60.0%
associate-/r/65.9%
Simplified65.9%
if -2.8e17 < t < 8.79999999999999955e-275 or 2.7000000000000002e-80 < t < 9.5000000000000003e76Initial program 95.4%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in x around inf 58.4%
if 8.79999999999999955e-275 < t < 2.7000000000000002e-80Initial program 87.8%
associate-/l*92.6%
Simplified92.6%
Taylor expanded in y around 0 87.8%
*-commutative87.8%
associate-*r/97.4%
Simplified97.4%
Taylor expanded in x around 0 87.8%
+-commutative87.8%
associate-/l*92.6%
Simplified92.6%
Taylor expanded in z around inf 49.5%
associate-*r/54.3%
Simplified54.3%
clear-num54.3%
un-div-inv56.6%
Applied egg-rr56.6%
Final simplification61.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4000000000.0) (not (<= y 6.6e+39))) (* y (/ (- z t) a)) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4000000000.0) || !(y <= 6.6e+39)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + ((y * z) / 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 <= (-4000000000.0d0)) .or. (.not. (y <= 6.6d+39))) then
tmp = y * ((z - t) / a)
else
tmp = x + ((y * z) / 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 <= -4000000000.0) || !(y <= 6.6e+39)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4000000000.0) or not (y <= 6.6e+39): tmp = y * ((z - t) / a) else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4000000000.0) || !(y <= 6.6e+39)) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -4000000000.0) || ~((y <= 6.6e+39))) tmp = y * ((z - t) / a); else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4000000000.0], N[Not[LessEqual[y, 6.6e+39]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4000000000 \lor \neg \left(y \leq 6.6 \cdot 10^{+39}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if y < -4e9 or 6.60000000000000042e39 < y Initial program 85.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 85.9%
*-commutative85.9%
associate-*r/96.1%
Simplified96.1%
Taylor expanded in x around 0 85.9%
+-commutative85.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 83.3%
div-sub84.1%
Simplified84.1%
if -4e9 < y < 6.60000000000000042e39Initial program 99.9%
associate-/l*88.1%
Simplified88.1%
Taylor expanded in z around inf 80.0%
Final simplification82.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.4e+101) (not (<= z 2.6e+155))) (+ x (/ y (/ a z))) (- x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.4e+101) || !(z <= 2.6e+155)) {
tmp = x + (y / (a / z));
} 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 ((z <= (-6.4d+101)) .or. (.not. (z <= 2.6d+155))) then
tmp = x + (y / (a / z))
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 ((z <= -6.4e+101) || !(z <= 2.6e+155)) {
tmp = x + (y / (a / z));
} else {
tmp = x - (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.4e+101) or not (z <= 2.6e+155): tmp = x + (y / (a / z)) else: tmp = x - (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.4e+101) || !(z <= 2.6e+155)) tmp = Float64(x + Float64(y / Float64(a / z))); 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 ((z <= -6.4e+101) || ~((z <= 2.6e+155))) tmp = x + (y / (a / z)); else tmp = x - (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.4e+101], N[Not[LessEqual[z, 2.6e+155]], $MachinePrecision]], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+101} \lor \neg \left(z \leq 2.6 \cdot 10^{+155}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -6.4000000000000001e101 or 2.6000000000000002e155 < z Initial program 83.4%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in t around 0 78.6%
+-commutative78.6%
associate-/l*83.4%
Simplified83.4%
clear-num62.5%
un-div-inv64.5%
Applied egg-rr85.4%
if -6.4000000000000001e101 < z < 2.6000000000000002e155Initial program 97.8%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in y around 0 97.8%
*-commutative97.8%
associate-*r/96.8%
Simplified96.8%
Taylor expanded in z around 0 88.4%
associate-*l/85.7%
*-commutative85.7%
neg-mul-185.7%
sub-neg85.7%
*-commutative85.7%
associate-*l/88.4%
associate-*r/89.6%
Simplified89.6%
Final simplification88.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.4e+104) (not (<= y 9e+39))) (* y (/ z a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.4e+104) || !(y <= 9e+39)) {
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 ((y <= (-2.4d+104)) .or. (.not. (y <= 9d+39))) 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 ((y <= -2.4e+104) || !(y <= 9e+39)) {
tmp = y * (z / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.4e+104) or not (y <= 9e+39): tmp = y * (z / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.4e+104) || !(y <= 9e+39)) 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 ((y <= -2.4e+104) || ~((y <= 9e+39))) tmp = y * (z / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.4e+104], N[Not[LessEqual[y, 9e+39]], $MachinePrecision]], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{+104} \lor \neg \left(y \leq 9 \cdot 10^{+39}\right):\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.4e104 or 8.99999999999999991e39 < y Initial program 85.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 85.1%
*-commutative85.1%
associate-*r/95.7%
Simplified95.7%
Taylor expanded in x around 0 85.1%
+-commutative85.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 39.0%
associate-*r/47.8%
Simplified47.8%
if -2.4e104 < y < 8.99999999999999991e39Initial program 99.3%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in x around inf 56.7%
Final simplification53.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.05e+117) (not (<= z 8.8e+113))) (/ y (/ a z)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.05e+117) || !(z <= 8.8e+113)) {
tmp = y / (a / z);
} 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 <= (-3.05d+117)) .or. (.not. (z <= 8.8d+113))) then
tmp = y / (a / z)
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 <= -3.05e+117) || !(z <= 8.8e+113)) {
tmp = y / (a / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.05e+117) or not (z <= 8.8e+113): tmp = y / (a / z) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.05e+117) || !(z <= 8.8e+113)) tmp = Float64(y / Float64(a / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.05e+117) || ~((z <= 8.8e+113))) tmp = y / (a / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.05e+117], N[Not[LessEqual[z, 8.8e+113]], $MachinePrecision]], N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.05 \cdot 10^{+117} \lor \neg \left(z \leq 8.8 \cdot 10^{+113}\right):\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.0500000000000002e117 or 8.80000000000000041e113 < z Initial program 83.8%
associate-/l*89.5%
Simplified89.5%
Taylor expanded in y around 0 83.8%
*-commutative83.8%
associate-*r/97.1%
Simplified97.1%
Taylor expanded in x around 0 83.8%
+-commutative83.8%
associate-/l*89.5%
Simplified89.5%
Taylor expanded in z around inf 57.7%
associate-*r/61.2%
Simplified61.2%
clear-num61.1%
un-div-inv63.1%
Applied egg-rr63.1%
if -3.0500000000000002e117 < z < 8.80000000000000041e113Initial program 97.8%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in x around inf 48.4%
Final simplification53.1%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) a))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / a));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / a))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / a))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a}
\end{array}
Initial program 93.3%
associate-/l*93.7%
Simplified93.7%
Final simplification93.7%
(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.3%
associate-/l*93.7%
Simplified93.7%
Taylor expanded in y around 0 93.3%
*-commutative93.3%
associate-*r/96.9%
Simplified96.9%
Final simplification96.9%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.3%
associate-/l*93.7%
Simplified93.7%
Taylor expanded in x around inf 39.5%
Final simplification39.5%
(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 2024072
(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)))