
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - 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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - 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)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - 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)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- z t) (- z a)) y)))
double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * y);
}
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) / (z - a)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (z - a)) * y);
}
def code(x, y, z, t, a): return x + (((z - t) / (z - a)) * y)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(z - t) / Float64(z - a)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x + (((z - t) / (z - a)) * y); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{z - a} \cdot y
\end{array}
Initial program 83.3%
associate-/l*98.1%
Simplified98.1%
clear-num98.0%
associate-/r/98.1%
clear-num98.1%
Applied egg-rr98.1%
Final simplification98.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -23000000000.0) (not (<= z 9e-27))) (+ x (* (- z t) (/ y z))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -23000000000.0) || !(z <= 9e-27)) {
tmp = x + ((z - t) * (y / 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 ((z <= (-23000000000.0d0)) .or. (.not. (z <= 9d-27))) then
tmp = x + ((z - t) * (y / 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 ((z <= -23000000000.0) || !(z <= 9e-27)) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -23000000000.0) or not (z <= 9e-27): tmp = x + ((z - t) * (y / z)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -23000000000.0) || !(z <= 9e-27)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -23000000000.0) || ~((z <= 9e-27))) tmp = x + ((z - t) * (y / z)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -23000000000.0], N[Not[LessEqual[z, 9e-27]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -23000000000 \lor \neg \left(z \leq 9 \cdot 10^{-27}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -2.3e10 or 9.0000000000000003e-27 < z Initial program 69.8%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in z around inf 85.2%
if -2.3e10 < z < 9.0000000000000003e-27Initial program 97.0%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in z around 0 80.0%
Final simplification82.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1100000000000.0) (not (<= z 3.15e-27))) (+ x (/ y (/ z (- z t)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1100000000000.0) || !(z <= 3.15e-27)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1100000000000.0d0)) .or. (.not. (z <= 3.15d-27))) then
tmp = x + (y / (z / (z - t)))
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1100000000000.0) || !(z <= 3.15e-27)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1100000000000.0) or not (z <= 3.15e-27): tmp = x + (y / (z / (z - t))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1100000000000.0) || !(z <= 3.15e-27)) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1100000000000.0) || ~((z <= 3.15e-27))) tmp = x + (y / (z / (z - t))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1100000000000.0], N[Not[LessEqual[z, 3.15e-27]], $MachinePrecision]], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1100000000000 \lor \neg \left(z \leq 3.15 \cdot 10^{-27}\right):\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.1e12 or 3.15000000000000005e-27 < z Initial program 69.8%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in z around inf 85.2%
associate-*l/60.4%
associate-/l*86.9%
Applied egg-rr86.9%
if -1.1e12 < z < 3.15000000000000005e-27Initial program 97.0%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in z around 0 80.0%
Final simplification83.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.25e+59) (not (<= z 3.4e+42))) (+ x (/ y (/ z (- z t)))) (+ x (/ (* t y) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.25e+59) || !(z <= 3.4e+42)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + ((t * 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 <= (-3.25d+59)) .or. (.not. (z <= 3.4d+42))) then
tmp = x + (y / (z / (z - t)))
else
tmp = x + ((t * 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 <= -3.25e+59) || !(z <= 3.4e+42)) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + ((t * y) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.25e+59) or not (z <= 3.4e+42): tmp = x + (y / (z / (z - t))) else: tmp = x + ((t * y) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.25e+59) || !(z <= 3.4e+42)) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); else tmp = Float64(x + Float64(Float64(t * y) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.25e+59) || ~((z <= 3.4e+42))) tmp = x + (y / (z / (z - t))); else tmp = x + ((t * y) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.25e+59], N[Not[LessEqual[z, 3.4e+42]], $MachinePrecision]], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.25 \cdot 10^{+59} \lor \neg \left(z \leq 3.4 \cdot 10^{+42}\right):\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a - z}\\
\end{array}
\end{array}
if z < -3.2500000000000001e59 or 3.39999999999999975e42 < z Initial program 63.6%
associate-*l/97.9%
Simplified97.9%
Taylor expanded in z around inf 87.6%
associate-*l/57.7%
associate-/l*89.6%
Applied egg-rr89.6%
if -3.2500000000000001e59 < z < 3.39999999999999975e42Initial program 97.4%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in t around inf 87.6%
associate-*r/87.6%
neg-mul-187.6%
Simplified87.6%
Taylor expanded in y around 0 87.6%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.4e-156) (not (<= z 4.1e-38))) (+ x (* z (/ y (- z a)))) (+ x (/ (* t y) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.4e-156) || !(z <= 4.1e-38)) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = x + ((t * 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 <= (-8.4d-156)) .or. (.not. (z <= 4.1d-38))) then
tmp = x + (z * (y / (z - a)))
else
tmp = x + ((t * 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 <= -8.4e-156) || !(z <= 4.1e-38)) {
tmp = x + (z * (y / (z - a)));
} else {
tmp = x + ((t * y) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.4e-156) or not (z <= 4.1e-38): tmp = x + (z * (y / (z - a))) else: tmp = x + ((t * y) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.4e-156) || !(z <= 4.1e-38)) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(Float64(t * y) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8.4e-156) || ~((z <= 4.1e-38))) tmp = x + (z * (y / (z - a))); else tmp = x + ((t * y) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.4e-156], N[Not[LessEqual[z, 4.1e-38]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.4 \cdot 10^{-156} \lor \neg \left(z \leq 4.1 \cdot 10^{-38}\right):\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a - z}\\
\end{array}
\end{array}
if z < -8.40000000000000049e-156 or 4.0999999999999998e-38 < z Initial program 75.7%
associate-*l/98.1%
Simplified98.1%
Taylor expanded in t around 0 69.3%
+-commutative69.3%
associate-*l/88.2%
*-commutative88.2%
Simplified88.2%
if -8.40000000000000049e-156 < z < 4.0999999999999998e-38Initial program 97.8%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in t around inf 92.2%
associate-*r/92.2%
neg-mul-192.2%
Simplified92.2%
Taylor expanded in y around 0 94.4%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.55e-24) (not (<= z 1.06e-26))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.55e-24) || !(z <= 1.06e-26)) {
tmp = x + y;
} 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 <= (-1.55d-24)) .or. (.not. (z <= 1.06d-26))) then
tmp = x + y
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 <= -1.55e-24) || !(z <= 1.06e-26)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.55e-24) or not (z <= 1.06e-26): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.55e-24) || !(z <= 1.06e-26)) tmp = Float64(x + y); 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 <= -1.55e-24) || ~((z <= 1.06e-26))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.55e-24], N[Not[LessEqual[z, 1.06e-26]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-24} \lor \neg \left(z \leq 1.06 \cdot 10^{-26}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.55e-24 or 1.06000000000000001e-26 < z Initial program 72.6%
associate-*l/98.4%
Simplified98.4%
Taylor expanded in z around inf 80.1%
+-commutative80.1%
Simplified80.1%
if -1.55e-24 < z < 1.06000000000000001e-26Initial program 96.6%
associate-/l*95.8%
Simplified95.8%
clear-num95.7%
associate-/r/95.8%
clear-num95.8%
Applied egg-rr95.8%
Taylor expanded in z around 0 79.5%
associate-*r/80.3%
Simplified80.3%
Final simplification80.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.9e-24) (not (<= z 3.2e-26))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.9e-24) || !(z <= 3.2e-26)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.9d-24)) .or. (.not. (z <= 3.2d-26))) then
tmp = x + y
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.9e-24) || !(z <= 3.2e-26)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.9e-24) or not (z <= 3.2e-26): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.9e-24) || !(z <= 3.2e-26)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.9e-24) || ~((z <= 3.2e-26))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.9e-24], N[Not[LessEqual[z, 3.2e-26]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{-24} \lor \neg \left(z \leq 3.2 \cdot 10^{-26}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -3.9e-24 or 3.2000000000000001e-26 < z Initial program 72.6%
associate-*l/98.4%
Simplified98.4%
Taylor expanded in z around inf 80.1%
+-commutative80.1%
Simplified80.1%
if -3.9e-24 < z < 3.2000000000000001e-26Initial program 96.6%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in z around 0 81.0%
Final simplification80.5%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (z - 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 / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (z - a)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{z - a}
\end{array}
Initial program 83.3%
associate-*l/96.5%
Simplified96.5%
Final simplification96.5%
(FPCore (x y z t a) :precision binary64 (if (<= a 2.2e+144) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 2.2e+144) {
tmp = x + 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 (a <= 2.2d+144) then
tmp = x + 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 (a <= 2.2e+144) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 2.2e+144: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 2.2e+144) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 2.2e+144) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 2.2e+144], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.2 \cdot 10^{+144}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 2.19999999999999988e144Initial program 82.5%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in z around inf 69.3%
+-commutative69.3%
Simplified69.3%
if 2.19999999999999988e144 < a Initial program 87.2%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in x around inf 75.8%
Final simplification70.4%
(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 83.3%
associate-*l/96.5%
Simplified96.5%
Taylor expanded in x around inf 53.0%
Final simplification53.0%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2023314
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))