
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - 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) (- 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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 98.4%
Final simplification98.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -32000000.0) (not (<= z 2.35e+111))) (+ x (* y (/ (- z t) z))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -32000000.0) || !(z <= 2.35e+111)) {
tmp = x + (y * ((z - t) / z));
} 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 <= (-32000000.0d0)) .or. (.not. (z <= 2.35d+111))) then
tmp = x + (y * ((z - t) / z))
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 <= -32000000.0) || !(z <= 2.35e+111)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -32000000.0) or not (z <= 2.35e+111): tmp = x + (y * ((z - t) / z)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -32000000.0) || !(z <= 2.35e+111)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); 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 <= -32000000.0) || ~((z <= 2.35e+111))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -32000000.0], N[Not[LessEqual[z, 2.35e+111]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -32000000 \lor \neg \left(z \leq 2.35 \cdot 10^{+111}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.2e7 or 2.35000000000000004e111 < z Initial program 99.9%
Taylor expanded in a around 0 92.1%
if -3.2e7 < z < 2.35000000000000004e111Initial program 97.4%
Taylor expanded in z around 0 81.0%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.6e+50) (not (<= z 1.9e+113))) (+ x (/ y (/ (- z a) z))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.6e+50) || !(z <= 1.9e+113)) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x + (y * (t / (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 <= (-5.6d+50)) .or. (.not. (z <= 1.9d+113))) then
tmp = x + (y / ((z - a) / z))
else
tmp = x + (y * (t / (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 <= -5.6e+50) || !(z <= 1.9e+113)) {
tmp = x + (y / ((z - a) / z));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.6e+50) or not (z <= 1.9e+113): tmp = x + (y / ((z - a) / z)) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.6e+50) || !(z <= 1.9e+113)) tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.6e+50) || ~((z <= 1.9e+113))) tmp = x + (y / ((z - a) / z)); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.6e+50], N[Not[LessEqual[z, 1.9e+113]], $MachinePrecision]], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+50} \lor \neg \left(z \leq 1.9 \cdot 10^{+113}\right):\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -5.5999999999999996e50 or 1.9000000000000002e113 < z Initial program 99.9%
Taylor expanded in t around 0 65.6%
associate-/l*96.3%
Simplified96.3%
if -5.5999999999999996e50 < z < 1.9000000000000002e113Initial program 97.5%
Taylor expanded in t around inf 88.7%
neg-mul-188.7%
distribute-neg-frac88.7%
Simplified88.7%
frac-2neg88.7%
remove-double-neg88.7%
associate-*r/86.6%
Applied egg-rr86.6%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in y around 0 86.6%
associate-/l*87.1%
associate-/r/88.7%
Simplified88.7%
Final simplification91.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.2e+19) (+ x (* y (/ (- z t) z))) (if (<= z 1.75e+122) (+ x (* y (/ t (- a z)))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e+19) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 1.75e+122) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + 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 (z <= (-4.2d+19)) then
tmp = x + (y * ((z - t) / z))
else if (z <= 1.75d+122) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.2e+19) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 1.75e+122) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.2e+19: tmp = x + (y * ((z - t) / z)) elif z <= 1.75e+122: tmp = x + (y * (t / (a - z))) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.2e+19) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); elseif (z <= 1.75e+122) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.2e+19) tmp = x + (y * ((z - t) / z)); elseif (z <= 1.75e+122) tmp = x + (y * (t / (a - z))); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.2e+19], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e+122], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+19}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+122}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -4.2e19Initial program 99.9%
Taylor expanded in a around 0 88.5%
if -4.2e19 < z < 1.75000000000000007e122Initial program 97.5%
Taylor expanded in t around inf 89.2%
neg-mul-189.2%
distribute-neg-frac89.2%
Simplified89.2%
frac-2neg89.2%
remove-double-neg89.2%
associate-*r/86.5%
Applied egg-rr86.5%
associate-/l*89.2%
Simplified89.2%
Taylor expanded in y around 0 86.5%
associate-/l*87.6%
associate-/r/89.2%
Simplified89.2%
if 1.75000000000000007e122 < z Initial program 100.0%
Taylor expanded in z around inf 97.9%
Final simplification90.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.2e+48) (+ x (* z (/ y (- z a)))) (if (<= z 4.3e+118) (+ x (* y (/ t (- a z)))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+48) {
tmp = x + (z * (y / (z - a)));
} else if (z <= 4.3e+118) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + 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 (z <= (-5.2d+48)) then
tmp = x + (z * (y / (z - a)))
else if (z <= 4.3d+118) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e+48) {
tmp = x + (z * (y / (z - a)));
} else if (z <= 4.3e+118) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.2e+48: tmp = x + (z * (y / (z - a))) elif z <= 4.3e+118: tmp = x + (y * (t / (a - z))) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e+48) tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); elseif (z <= 4.3e+118) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.2e+48) tmp = x + (z * (y / (z - a))); elseif (z <= 4.3e+118) tmp = x + (y * (t / (a - z))); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e+48], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3e+118], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+48}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+118}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -5.1999999999999999e48Initial program 99.9%
Taylor expanded in t around 0 64.2%
associate-/l*92.7%
associate-/r/92.5%
Applied egg-rr92.5%
if -5.1999999999999999e48 < z < 4.3000000000000003e118Initial program 97.6%
Taylor expanded in t around inf 88.8%
neg-mul-188.8%
distribute-neg-frac88.8%
Simplified88.8%
frac-2neg88.8%
remove-double-neg88.8%
associate-*r/86.2%
Applied egg-rr86.2%
associate-/l*88.8%
Simplified88.8%
Taylor expanded in y around 0 86.2%
associate-/l*87.3%
associate-/r/88.8%
Simplified88.8%
if 4.3000000000000003e118 < z Initial program 100.0%
Taylor expanded in z around inf 97.9%
Final simplification91.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -35000000.0) (not (<= z 1.5e+112))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -35000000.0) || !(z <= 1.5e+112)) {
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 <= (-35000000.0d0)) .or. (.not. (z <= 1.5d+112))) 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 <= -35000000.0) || !(z <= 1.5e+112)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -35000000.0) or not (z <= 1.5e+112): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -35000000.0) || !(z <= 1.5e+112)) 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 <= -35000000.0) || ~((z <= 1.5e+112))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -35000000.0], N[Not[LessEqual[z, 1.5e+112]], $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 -35000000 \lor \neg \left(z \leq 1.5 \cdot 10^{+112}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.5e7 or 1.4999999999999999e112 < z Initial program 99.9%
Taylor expanded in z around inf 85.9%
if -3.5e7 < z < 1.4999999999999999e112Initial program 97.4%
Taylor expanded in t around inf 88.9%
neg-mul-188.9%
distribute-neg-frac88.9%
Simplified88.9%
frac-2neg88.9%
remove-double-neg88.9%
associate-*r/87.3%
Applied egg-rr87.3%
associate-/l*88.9%
Simplified88.9%
Taylor expanded in z around 0 79.1%
*-commutative79.1%
associate-*l/79.2%
*-commutative79.2%
Simplified79.2%
Final simplification81.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -175000000.0) (not (<= z 2.35e+111))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -175000000.0) || !(z <= 2.35e+111)) {
tmp = x + y;
} 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 <= (-175000000.0d0)) .or. (.not. (z <= 2.35d+111))) then
tmp = x + y
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 <= -175000000.0) || !(z <= 2.35e+111)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -175000000.0) or not (z <= 2.35e+111): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -175000000.0) || !(z <= 2.35e+111)) tmp = Float64(x + y); 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 <= -175000000.0) || ~((z <= 2.35e+111))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -175000000.0], N[Not[LessEqual[z, 2.35e+111]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -175000000 \lor \neg \left(z \leq 2.35 \cdot 10^{+111}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.75e8 or 2.35000000000000004e111 < z Initial program 99.9%
Taylor expanded in z around inf 85.9%
if -1.75e8 < z < 2.35000000000000004e111Initial program 97.4%
Taylor expanded in z around 0 81.0%
Final simplification82.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -8.2e+91) x (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.2e+91) {
tmp = x;
} else {
tmp = x + 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 (a <= (-8.2d+91)) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -8.2e+91) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -8.2e+91: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -8.2e+91) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -8.2e+91) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.2e+91], x, N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.2 \cdot 10^{+91}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if a < -8.2000000000000005e91Initial program 99.9%
Taylor expanded in t around 0 77.8%
Taylor expanded in z around 0 68.7%
mul-1-neg68.7%
associate-/l*75.7%
Simplified75.7%
Taylor expanded in x around inf 73.2%
if -8.2000000000000005e91 < a Initial program 98.1%
Taylor expanded in z around inf 60.6%
Final simplification62.7%
(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 98.4%
Taylor expanded in t around 0 61.3%
Taylor expanded in z around 0 44.8%
mul-1-neg44.8%
associate-/l*45.3%
Simplified45.3%
Taylor expanded in x around inf 51.9%
Final simplification51.9%
(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 2024036
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))