
(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 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(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 (/ (- t z) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (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 * ((t - z) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((t - z) / (z - a)));
}
def code(x, y, z, t, a): return x - (y * ((t - z) / (z - a)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(t - z) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((t - z) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{t - z}{z - a}
\end{array}
Initial program 98.8%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.75e+80) (not (<= z 3e+38))) (+ x (* y (/ z (- z a)))) (+ x (/ y (/ (- z a) (- t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.75e+80) || !(z <= 3e+38)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y / ((z - 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.75d+80)) .or. (.not. (z <= 3d+38))) then
tmp = x + (y * (z / (z - a)))
else
tmp = x + (y / ((z - 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.75e+80) || !(z <= 3e+38)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y / ((z - a) / -t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.75e+80) or not (z <= 3e+38): tmp = x + (y * (z / (z - a))) else: tmp = x + (y / ((z - a) / -t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.75e+80) || !(z <= 3e+38)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / Float64(-t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.75e+80) || ~((z <= 3e+38))) tmp = x + (y * (z / (z - a))); else tmp = x + (y / ((z - a) / -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.75e+80], N[Not[LessEqual[z, 3e+38]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.75 \cdot 10^{+80} \lor \neg \left(z \leq 3 \cdot 10^{+38}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{-t}}\\
\end{array}
\end{array}
if z < -3.74999999999999997e80 or 3.0000000000000001e38 < z Initial program 99.9%
Taylor expanded in t around 0 89.6%
if -3.74999999999999997e80 < z < 3.0000000000000001e38Initial program 98.1%
Taylor expanded in t around inf 89.4%
associate-*r/89.4%
mul-1-neg89.4%
distribute-lft-neg-out89.4%
*-commutative89.4%
associate-/l*92.1%
Simplified92.1%
Final simplification91.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e-68) (not (<= z 4e-11))) (+ x (* y (/ z (- z a)))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e-68) || !(z <= 4e-11)) {
tmp = x + (y * (z / (z - a)));
} 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.1d-68)) .or. (.not. (z <= 4d-11))) then
tmp = x + (y * (z / (z - a)))
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.1e-68) || !(z <= 4e-11)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e-68) or not (z <= 4e-11): tmp = x + (y * (z / (z - a))) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e-68) || !(z <= 4e-11)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); 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.1e-68) || ~((z <= 4e-11))) tmp = x + (y * (z / (z - a))); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.1e-68], N[Not[LessEqual[z, 4e-11]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-68} \lor \neg \left(z \leq 4 \cdot 10^{-11}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.10000000000000001e-68 or 3.99999999999999976e-11 < z Initial program 99.9%
Taylor expanded in t around 0 80.9%
if -1.10000000000000001e-68 < z < 3.99999999999999976e-11Initial program 97.5%
Taylor expanded in z around 0 88.9%
+-commutative88.9%
associate-/l*90.9%
Simplified90.9%
clear-num90.9%
associate-/r/91.0%
clear-num91.0%
Applied egg-rr91.0%
Final simplification85.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.6e-34) (not (<= a 6.6e-122))) (+ x (* (/ y a) (- t z))) (+ x (/ y (/ z (- z t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.6e-34) || !(a <= 6.6e-122)) {
tmp = x + ((y / a) * (t - z));
} else {
tmp = x + (y / (z / (z - 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 ((a <= (-1.6d-34)) .or. (.not. (a <= 6.6d-122))) then
tmp = x + ((y / a) * (t - z))
else
tmp = x + (y / (z / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.6e-34) || !(a <= 6.6e-122)) {
tmp = x + ((y / a) * (t - z));
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.6e-34) or not (a <= 6.6e-122): tmp = x + ((y / a) * (t - z)) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.6e-34) || !(a <= 6.6e-122)) tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); else tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.6e-34) || ~((a <= 6.6e-122))) tmp = x + ((y / a) * (t - z)); else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.6e-34], N[Not[LessEqual[a, 6.6e-122]], $MachinePrecision]], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{-34} \lor \neg \left(a \leq 6.6 \cdot 10^{-122}\right):\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if a < -1.60000000000000001e-34 or 6.59999999999999999e-122 < a Initial program 99.9%
Taylor expanded in a around inf 79.9%
mul-1-neg79.9%
unsub-neg79.9%
associate-/l*86.7%
associate-/r/86.2%
Simplified86.2%
if -1.60000000000000001e-34 < a < 6.59999999999999999e-122Initial program 96.9%
Taylor expanded in a around 0 81.9%
+-commutative81.9%
associate-/l*88.0%
Simplified88.0%
Final simplification86.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -5.5e-14) (+ x (* y (/ z (- z a)))) (if (<= a 6.6e-122) (+ x (/ y (/ z (- z t)))) (+ x (/ y (/ a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.5e-14) {
tmp = x + (y * (z / (z - a)));
} else if (a <= 6.6e-122) {
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 (a <= (-5.5d-14)) then
tmp = x + (y * (z / (z - a)))
else if (a <= 6.6d-122) 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 (a <= -5.5e-14) {
tmp = x + (y * (z / (z - a)));
} else if (a <= 6.6e-122) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.5e-14: tmp = x + (y * (z / (z - a))) elif a <= 6.6e-122: 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 (a <= -5.5e-14) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (a <= 6.6e-122) 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 (a <= -5.5e-14) tmp = x + (y * (z / (z - a))); elseif (a <= 6.6e-122) tmp = x + (y / (z / (z - t))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.5e-14], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.6e-122], 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}\;a \leq -5.5 \cdot 10^{-14}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;a \leq 6.6 \cdot 10^{-122}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if a < -5.49999999999999991e-14Initial program 100.0%
Taylor expanded in t around 0 86.4%
if -5.49999999999999991e-14 < a < 6.59999999999999999e-122Initial program 97.0%
Taylor expanded in a around 0 80.8%
+-commutative80.8%
associate-/l*86.6%
Simplified86.6%
if 6.59999999999999999e-122 < a Initial program 99.9%
Taylor expanded in t around inf 79.9%
associate-*r/79.9%
mul-1-neg79.9%
distribute-lft-neg-out79.9%
*-commutative79.9%
associate-/l*85.8%
Simplified85.8%
Taylor expanded in z around 0 84.4%
Final simplification85.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.2e-36) (+ x (* (/ y a) (- t z))) (if (<= a 6.2e-122) (+ x (/ y (/ z (- z t)))) (- x (/ y (/ a (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.2e-36) {
tmp = x + ((y / a) * (t - z));
} else if (a <= 6.2e-122) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x - (y / (a / (z - 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 (a <= (-4.2d-36)) then
tmp = x + ((y / a) * (t - z))
else if (a <= 6.2d-122) then
tmp = x + (y / (z / (z - t)))
else
tmp = x - (y / (a / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.2e-36) {
tmp = x + ((y / a) * (t - z));
} else if (a <= 6.2e-122) {
tmp = x + (y / (z / (z - t)));
} else {
tmp = x - (y / (a / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.2e-36: tmp = x + ((y / a) * (t - z)) elif a <= 6.2e-122: tmp = x + (y / (z / (z - t))) else: tmp = x - (y / (a / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.2e-36) tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); elseif (a <= 6.2e-122) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); else tmp = Float64(x - Float64(y / Float64(a / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.2e-36) tmp = x + ((y / a) * (t - z)); elseif (a <= 6.2e-122) tmp = x + (y / (z / (z - t))); else tmp = x - (y / (a / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.2e-36], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.2e-122], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-36}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{-122}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z - t}}\\
\end{array}
\end{array}
if a < -4.19999999999999982e-36Initial program 100.0%
Taylor expanded in a around inf 78.3%
mul-1-neg78.3%
unsub-neg78.3%
associate-/l*84.8%
associate-/r/86.4%
Simplified86.4%
if -4.19999999999999982e-36 < a < 6.1999999999999997e-122Initial program 96.9%
Taylor expanded in a around 0 81.9%
+-commutative81.9%
associate-/l*88.0%
Simplified88.0%
if 6.1999999999999997e-122 < a Initial program 99.9%
clear-num99.8%
associate-/r/99.8%
Applied egg-rr99.8%
Taylor expanded in a around inf 81.6%
mul-1-neg81.6%
unsub-neg81.6%
associate-/l*88.6%
Simplified88.6%
Final simplification87.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.06e+42) (not (<= z 5.2e-10))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.06e+42) || !(z <= 5.2e-10)) {
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 <= (-1.06d+42)) .or. (.not. (z <= 5.2d-10))) 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 <= -1.06e+42) || !(z <= 5.2e-10)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.06e+42) or not (z <= 5.2e-10): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.06e+42) || !(z <= 5.2e-10)) 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 <= -1.06e+42) || ~((z <= 5.2e-10))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.06e+42], N[Not[LessEqual[z, 5.2e-10]], $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 -1.06 \cdot 10^{+42} \lor \neg \left(z \leq 5.2 \cdot 10^{-10}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.0599999999999999e42 or 5.19999999999999962e-10 < z Initial program 99.9%
Taylor expanded in z around inf 76.1%
+-commutative76.1%
Simplified76.1%
if -1.0599999999999999e42 < z < 5.19999999999999962e-10Initial program 98.0%
Taylor expanded in t around inf 90.8%
associate-*r/90.8%
mul-1-neg90.8%
distribute-lft-neg-out90.8%
*-commutative90.8%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in z around 0 83.8%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.5e+42) (not (<= z 9.5e-10))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e+42) || !(z <= 9.5e-10)) {
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 <= (-3.5d+42)) .or. (.not. (z <= 9.5d-10))) 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 <= -3.5e+42) || !(z <= 9.5e-10)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.5e+42) or not (z <= 9.5e-10): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.5e+42) || !(z <= 9.5e-10)) 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 <= -3.5e+42) || ~((z <= 9.5e-10))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.5e+42], N[Not[LessEqual[z, 9.5e-10]], $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 -3.5 \cdot 10^{+42} \lor \neg \left(z \leq 9.5 \cdot 10^{-10}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.50000000000000023e42 or 9.50000000000000028e-10 < z Initial program 99.9%
Taylor expanded in z around inf 76.1%
+-commutative76.1%
Simplified76.1%
if -3.50000000000000023e42 < z < 9.50000000000000028e-10Initial program 98.0%
Taylor expanded in z around 0 80.9%
+-commutative80.9%
associate-/l*83.8%
Simplified83.8%
clear-num83.8%
associate-/r/83.8%
clear-num83.8%
Applied egg-rr83.8%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.6e+41) (not (<= z 1700.0))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.6e+41) || !(z <= 1700.0)) {
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 ((z <= (-3.6d+41)) .or. (.not. (z <= 1700.0d0))) 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 ((z <= -3.6e+41) || !(z <= 1700.0)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.6e+41) or not (z <= 1700.0): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.6e+41) || !(z <= 1700.0)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.6e+41) || ~((z <= 1700.0))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.6e+41], N[Not[LessEqual[z, 1700.0]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{+41} \lor \neg \left(z \leq 1700\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.60000000000000025e41 or 1700 < z Initial program 99.9%
Taylor expanded in z around inf 76.7%
+-commutative76.7%
Simplified76.7%
if -3.60000000000000025e41 < z < 1700Initial program 98.0%
Taylor expanded in x around inf 52.1%
Final simplification62.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 98.8%
Taylor expanded in x around inf 52.9%
Final simplification52.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 2023322
(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)))))