
(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 (let* ((t_1 (/ (* y (- z t)) a))) (if (<= t_1 -2e+285) (+ x (* (- z t) (/ y 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 <= -2e+285) {
tmp = x + ((z - t) * (y / 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 <= (-2d+285)) then
tmp = x + ((z - t) * (y / 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 <= -2e+285) {
tmp = x + ((z - t) * (y / 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 <= -2e+285: tmp = x + ((z - t) * (y / 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 <= -2e+285) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / 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 <= -2e+285) tmp = x + ((z - t) * (y / 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, -2e+285], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / 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 -2 \cdot 10^{+285}:\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + x\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -2e285Initial program 82.7%
*-commutative82.7%
associate-/l*100.0%
Applied egg-rr100.0%
if -2e285 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 99.0%
Final simplification99.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.85e-61) (+ x (* z (/ y a))) (if (<= z 7.5e-15) (- x (/ (* y t) a)) (+ x (/ (* y z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.85e-61) {
tmp = x + (z * (y / a));
} else if (z <= 7.5e-15) {
tmp = x - ((y * 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 (z <= (-2.85d-61)) then
tmp = x + (z * (y / a))
else if (z <= 7.5d-15) then
tmp = x - ((y * 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 (z <= -2.85e-61) {
tmp = x + (z * (y / a));
} else if (z <= 7.5e-15) {
tmp = x - ((y * t) / a);
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.85e-61: tmp = x + (z * (y / a)) elif z <= 7.5e-15: tmp = x - ((y * t) / a) else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.85e-61) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (z <= 7.5e-15) tmp = Float64(x - Float64(Float64(y * 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 (z <= -2.85e-61) tmp = x + (z * (y / a)); elseif (z <= 7.5e-15) tmp = x - ((y * t) / a); else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.85e-61], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e-15], N[(x - N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.85 \cdot 10^{-61}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-15}:\\
\;\;\;\;x - \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if z < -2.85000000000000003e-61Initial program 95.4%
*-commutative95.4%
associate-/l*98.7%
Applied egg-rr98.7%
Taylor expanded in z around inf 81.6%
if -2.85000000000000003e-61 < z < 7.4999999999999996e-15Initial program 97.4%
associate-/l*91.7%
Simplified91.7%
Taylor expanded in z around 0 91.5%
+-commutative91.5%
associate-*r/91.5%
mul-1-neg91.5%
distribute-lft-neg-out91.5%
*-commutative91.5%
Simplified91.5%
if 7.4999999999999996e-15 < z Initial program 98.3%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in z around inf 92.9%
Final simplification88.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -7.4e-65) (+ x (* z (/ y a))) (if (<= z 9.5e-16) (- x (* t (/ y a))) (+ x (/ (* y z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7.4e-65) {
tmp = x + (z * (y / a));
} else if (z <= 9.5e-16) {
tmp = x - (t * (y / 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 (z <= (-7.4d-65)) then
tmp = x + (z * (y / a))
else if (z <= 9.5d-16) then
tmp = x - (t * (y / 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 (z <= -7.4e-65) {
tmp = x + (z * (y / a));
} else if (z <= 9.5e-16) {
tmp = x - (t * (y / a));
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7.4e-65: tmp = x + (z * (y / a)) elif z <= 9.5e-16: tmp = x - (t * (y / a)) else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7.4e-65) tmp = Float64(x + Float64(z * Float64(y / a))); elseif (z <= 9.5e-16) tmp = Float64(x - Float64(t * Float64(y / 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 (z <= -7.4e-65) tmp = x + (z * (y / a)); elseif (z <= 9.5e-16) tmp = x - (t * (y / a)); else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7.4e-65], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-16], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{-65}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-16}:\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if z < -7.4e-65Initial program 95.4%
*-commutative95.4%
associate-/l*98.7%
Applied egg-rr98.7%
Taylor expanded in z around inf 81.6%
if -7.4e-65 < z < 9.5000000000000005e-16Initial program 97.4%
*-commutative97.4%
associate-/l*96.5%
Applied egg-rr96.5%
Taylor expanded in z around 0 91.5%
*-commutative91.5%
associate-*r/86.7%
neg-mul-186.7%
sub-neg86.7%
associate-*r/91.5%
associate-*l/91.4%
*-commutative91.4%
Simplified91.4%
if 9.5000000000000005e-16 < z Initial program 98.3%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in z around inf 92.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.3e+133) (not (<= y 8e+68))) (* t (/ y (- a))) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.3e+133) || !(y <= 8e+68)) {
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.3d+133)) .or. (.not. (y <= 8d+68))) 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.3e+133) || !(y <= 8e+68)) {
tmp = t * (y / -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.3e+133) or not (y <= 8e+68): tmp = t * (y / -a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.3e+133) || !(y <= 8e+68)) 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.3e+133) || ~((y <= 8e+68))) tmp = t * (y / -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.3e+133], N[Not[LessEqual[y, 8e+68]], $MachinePrecision]], N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.3 \cdot 10^{+133} \lor \neg \left(y \leq 8 \cdot 10^{+68}\right):\\
\;\;\;\;t \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.29999999999999994e133 or 7.99999999999999962e68 < y Initial program 92.0%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in z around 0 54.3%
mul-1-neg54.3%
unsub-neg54.3%
*-commutative54.3%
associate-/l*57.7%
Simplified57.7%
Taylor expanded in x around 0 45.2%
associate-/l*48.7%
associate-*r*48.7%
*-commutative48.7%
associate-*r*48.7%
neg-mul-148.7%
distribute-neg-frac248.7%
Simplified48.7%
if -4.29999999999999994e133 < y < 7.99999999999999962e68Initial program 99.3%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in x around inf 51.4%
Final simplification50.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -5.6e+133) (* y (/ (- t) a)) (if (<= y 6.8e+71) x (* t (/ y (- a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.6e+133) {
tmp = y * (-t / a);
} else if (y <= 6.8e+71) {
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 <= (-5.6d+133)) then
tmp = y * (-t / a)
else if (y <= 6.8d+71) 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 <= -5.6e+133) {
tmp = y * (-t / a);
} else if (y <= 6.8e+71) {
tmp = x;
} else {
tmp = t * (y / -a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5.6e+133: tmp = y * (-t / a) elif y <= 6.8e+71: tmp = x else: tmp = t * (y / -a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.6e+133) tmp = Float64(y * Float64(Float64(-t) / a)); elseif (y <= 6.8e+71) 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 <= -5.6e+133) tmp = y * (-t / a); elseif (y <= 6.8e+71) tmp = x; else tmp = t * (y / -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.6e+133], N[(y * N[((-t) / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+71], x, N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{+133}:\\
\;\;\;\;y \cdot \frac{-t}{a}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+71}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{-a}\\
\end{array}
\end{array}
if y < -5.60000000000000033e133Initial program 90.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in z around 0 53.1%
mul-1-neg53.1%
unsub-neg53.1%
*-commutative53.1%
associate-/l*56.0%
Simplified56.0%
Taylor expanded in x around 0 50.0%
associate-/l*49.9%
*-commutative49.9%
associate-*l/50.0%
associate-*r/52.9%
neg-mul-152.9%
distribute-rgt-neg-out52.9%
distribute-frac-neg252.9%
Simplified52.9%
if -5.60000000000000033e133 < y < 6.7999999999999997e71Initial program 99.3%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in x around inf 51.4%
if 6.7999999999999997e71 < y Initial program 92.6%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in z around 0 55.1%
mul-1-neg55.1%
unsub-neg55.1%
*-commutative55.1%
associate-/l*58.7%
Simplified58.7%
Taylor expanded in x around 0 42.4%
associate-/l*47.9%
associate-*r*47.9%
*-commutative47.9%
associate-*r*47.9%
neg-mul-147.9%
distribute-neg-frac247.9%
Simplified47.9%
Final simplification50.9%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.48e+113) (* t (/ y (- a))) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.48e+113) {
tmp = 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 <= (-1.48d+113)) then
tmp = 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 <= -1.48e+113) {
tmp = t * (y / -a);
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.48e+113: tmp = t * (y / -a) else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.48e+113) tmp = Float64(t * Float64(y / Float64(-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 <= -1.48e+113) tmp = t * (y / -a); else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.48e+113], N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.48 \cdot 10^{+113}:\\
\;\;\;\;t \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.48000000000000002e113Initial program 97.8%
associate-/l*89.1%
Simplified89.1%
Taylor expanded in z around 0 95.5%
mul-1-neg95.5%
unsub-neg95.5%
*-commutative95.5%
associate-/l*88.9%
Simplified88.9%
Taylor expanded in x around 0 71.5%
associate-/l*69.2%
associate-*r*69.2%
*-commutative69.2%
associate-*r*69.2%
neg-mul-169.2%
distribute-neg-frac269.2%
Simplified69.2%
if -1.48000000000000002e113 < t Initial program 96.8%
*-commutative96.8%
associate-/l*97.6%
Applied egg-rr97.6%
Taylor expanded in z around inf 79.4%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((z - t) * (y / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / a));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a}
\end{array}
Initial program 96.9%
*-commutative96.9%
associate-/l*97.2%
Applied egg-rr97.2%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) a))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / a));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / a))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / a))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a}
\end{array}
Initial program 96.9%
associate-/l*91.8%
Simplified91.8%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 96.9%
associate-/l*91.8%
Simplified91.8%
Taylor expanded in x around inf 38.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 2024165
(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)))