
(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 11 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.8%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.75e-162) (not (<= z 1.9e-16))) (+ 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 <= -2.75e-162) || !(z <= 1.9e-16)) {
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 <= (-2.75d-162)) .or. (.not. (z <= 1.9d-16))) 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 <= -2.75e-162) || !(z <= 1.9e-16)) {
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 <= -2.75e-162) or not (z <= 1.9e-16): 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 <= -2.75e-162) || !(z <= 1.9e-16)) 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 <= -2.75e-162) || ~((z <= 1.9e-16))) 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, -2.75e-162], N[Not[LessEqual[z, 1.9e-16]], $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 -2.75 \cdot 10^{-162} \lor \neg \left(z \leq 1.9 \cdot 10^{-16}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.75000000000000003e-162 or 1.90000000000000006e-16 < z Initial program 99.9%
Taylor expanded in t around 0 82.1%
if -2.75000000000000003e-162 < z < 1.90000000000000006e-16Initial program 97.0%
associate-*r/92.8%
*-commutative92.8%
associate-/l*98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 81.4%
associate-*r/86.5%
Simplified86.5%
Final simplification83.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.05e+118) (not (<= t 2.15e-16))) (- x (* t (/ y (- z a)))) (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.05e+118) || !(t <= 2.15e-16)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * (z / (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 ((t <= (-1.05d+118)) .or. (.not. (t <= 2.15d-16))) then
tmp = x - (t * (y / (z - a)))
else
tmp = x + (y * (z / (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 ((t <= -1.05e+118) || !(t <= 2.15e-16)) {
tmp = x - (t * (y / (z - a)));
} else {
tmp = x + (y * (z / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.05e+118) or not (t <= 2.15e-16): tmp = x - (t * (y / (z - a))) else: tmp = x + (y * (z / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.05e+118) || !(t <= 2.15e-16)) tmp = Float64(x - Float64(t * Float64(y / Float64(z - a)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.05e+118) || ~((t <= 2.15e-16))) tmp = x - (t * (y / (z - a))); else tmp = x + (y * (z / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.05e+118], N[Not[LessEqual[t, 2.15e-16]], $MachinePrecision]], N[(x - N[(t * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+118} \lor \neg \left(t \leq 2.15 \cdot 10^{-16}\right):\\
\;\;\;\;x - t \cdot \frac{y}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\end{array}
\end{array}
if t < -1.05e118 or 2.1499999999999999e-16 < t Initial program 98.0%
associate-*r/81.6%
Simplified81.6%
Taylor expanded in z around 0 81.7%
mul-1-neg81.7%
distribute-lft-neg-out81.7%
*-commutative81.7%
Simplified81.7%
Taylor expanded in x around 0 81.7%
mul-1-neg81.7%
*-commutative81.7%
associate-*r/92.7%
distribute-lft-neg-in92.7%
cancel-sign-sub-inv92.7%
associate-*r/81.7%
*-commutative81.7%
associate-*r/93.6%
Simplified93.6%
if -1.05e118 < t < 2.1499999999999999e-16Initial program 99.3%
Taylor expanded in t around 0 90.5%
Final simplification91.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -4e-162) (+ x (* y (/ z (- z a)))) (if (<= z 3.2e-14) (+ x (* t (/ y a))) (+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e-162) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 3.2e-14) {
tmp = x + (t * (y / a));
} else {
tmp = x + (y * ((z - t) / 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 <= (-4d-162)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 3.2d-14) then
tmp = x + (t * (y / a))
else
tmp = x + (y * ((z - t) / 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 <= -4e-162) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 3.2e-14) {
tmp = x + (t * (y / a));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4e-162: tmp = x + (y * (z / (z - a))) elif z <= 3.2e-14: tmp = x + (t * (y / a)) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e-162) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 3.2e-14) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4e-162) tmp = x + (y * (z / (z - a))); elseif (z <= 3.2e-14) tmp = x + (t * (y / a)); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e-162], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e-14], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-162}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-14}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -3.99999999999999982e-162Initial program 99.9%
Taylor expanded in t around 0 79.6%
if -3.99999999999999982e-162 < z < 3.2000000000000002e-14Initial program 97.0%
associate-*r/92.8%
*-commutative92.8%
associate-/l*98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 81.4%
associate-*r/86.5%
Simplified86.5%
if 3.2000000000000002e-14 < z Initial program 99.9%
Taylor expanded in a around 0 88.2%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -4e-162) (+ x (* y (/ z (- z a)))) (if (<= z 5.4e-17) (+ x (* t (/ y a))) (+ x (- y (/ t (/ z y)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4e-162) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 5.4e-17) {
tmp = x + (t * (y / a));
} else {
tmp = x + (y - (t / (z / 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 <= (-4d-162)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 5.4d-17) then
tmp = x + (t * (y / a))
else
tmp = x + (y - (t / (z / 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 <= -4e-162) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 5.4e-17) {
tmp = x + (t * (y / a));
} else {
tmp = x + (y - (t / (z / y)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4e-162: tmp = x + (y * (z / (z - a))) elif z <= 5.4e-17: tmp = x + (t * (y / a)) else: tmp = x + (y - (t / (z / y))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4e-162) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 5.4e-17) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x + Float64(y - Float64(t / Float64(z / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4e-162) tmp = x + (y * (z / (z - a))); elseif (z <= 5.4e-17) tmp = x + (t * (y / a)); else tmp = x + (y - (t / (z / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4e-162], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.4e-17], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y - N[(t / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-162}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-17}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - \frac{t}{\frac{z}{y}}\right)\\
\end{array}
\end{array}
if z < -3.99999999999999982e-162Initial program 99.9%
Taylor expanded in t around 0 79.6%
if -3.99999999999999982e-162 < z < 5.4000000000000002e-17Initial program 97.0%
associate-*r/92.8%
*-commutative92.8%
associate-/l*98.3%
Applied egg-rr98.3%
Taylor expanded in z around 0 81.4%
associate-*r/86.5%
Simplified86.5%
if 5.4000000000000002e-17 < z Initial program 99.9%
Taylor expanded in a around 0 88.2%
Taylor expanded in z around 0 86.4%
+-commutative86.4%
mul-1-neg86.4%
unsub-neg86.4%
associate-/l*88.3%
Simplified88.3%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.2e+63) (not (<= z 2e-10))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.2e+63) || !(z <= 2e-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 <= (-8.2d+63)) .or. (.not. (z <= 2d-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 <= -8.2e+63) || !(z <= 2e-10)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.2e+63) or not (z <= 2e-10): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.2e+63) || !(z <= 2e-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 <= -8.2e+63) || ~((z <= 2e-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, -8.2e+63], N[Not[LessEqual[z, 2e-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 -8.2 \cdot 10^{+63} \lor \neg \left(z \leq 2 \cdot 10^{-10}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -8.19999999999999985e63 or 2.00000000000000007e-10 < z Initial program 99.9%
Taylor expanded in z around inf 76.0%
+-commutative76.0%
Simplified76.0%
if -8.19999999999999985e63 < z < 2.00000000000000007e-10Initial program 97.9%
associate-*r/94.3%
*-commutative94.3%
associate-/l*97.7%
Applied egg-rr97.7%
Taylor expanded in z around 0 75.6%
associate-*r/78.5%
Simplified78.5%
Final simplification77.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.08e+64) (not (<= z 4.2e-10))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.08e+64) || !(z <= 4.2e-10)) {
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 <= (-1.08d+64)) .or. (.not. (z <= 4.2d-10))) 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 <= -1.08e+64) || !(z <= 4.2e-10)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.08e+64) or not (z <= 4.2e-10): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.08e+64) || !(z <= 4.2e-10)) 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 <= -1.08e+64) || ~((z <= 4.2e-10))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.08e+64], N[Not[LessEqual[z, 4.2e-10]], $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 -1.08 \cdot 10^{+64} \lor \neg \left(z \leq 4.2 \cdot 10^{-10}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.08000000000000007e64 or 4.2e-10 < z Initial program 99.9%
Taylor expanded in z around inf 76.0%
+-commutative76.0%
Simplified76.0%
if -1.08000000000000007e64 < z < 4.2e-10Initial program 97.9%
Taylor expanded in z around 0 75.6%
+-commutative75.6%
associate-/l*78.8%
associate-/r/78.5%
Simplified78.5%
Final simplification77.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.2e+64) (not (<= z 1.25e-13))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.2e+64) || !(z <= 1.25e-13)) {
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.2d+64)) .or. (.not. (z <= 1.25d-13))) 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.2e+64) || !(z <= 1.25e-13)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.2e+64) or not (z <= 1.25e-13): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.2e+64) || !(z <= 1.25e-13)) 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.2e+64) || ~((z <= 1.25e-13))) 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.2e+64], N[Not[LessEqual[z, 1.25e-13]], $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.2 \cdot 10^{+64} \lor \neg \left(z \leq 1.25 \cdot 10^{-13}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -1.2e64 or 1.24999999999999997e-13 < z Initial program 99.9%
Taylor expanded in z around inf 76.0%
+-commutative76.0%
Simplified76.0%
if -1.2e64 < z < 1.24999999999999997e-13Initial program 97.9%
Taylor expanded in z around 0 75.6%
+-commutative75.6%
associate-/l*78.8%
associate-/r/78.5%
Simplified78.5%
*-commutative78.5%
clear-num78.5%
un-div-inv79.0%
Applied egg-rr79.0%
Final simplification77.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e+64) (not (<= z 1.7e-24))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e+64) || !(z <= 1.7e-24)) {
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 <= (-1.35d+64)) .or. (.not. (z <= 1.7d-24))) 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 <= -1.35e+64) || !(z <= 1.7e-24)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e+64) or not (z <= 1.7e-24): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e+64) || !(z <= 1.7e-24)) 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 <= -1.35e+64) || ~((z <= 1.7e-24))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.35e+64], N[Not[LessEqual[z, 1.7e-24]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{+64} \lor \neg \left(z \leq 1.7 \cdot 10^{-24}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.35e64 or 1.69999999999999996e-24 < z Initial program 99.9%
Taylor expanded in z around inf 75.4%
+-commutative75.4%
Simplified75.4%
if -1.35e64 < z < 1.69999999999999996e-24Initial program 97.9%
Taylor expanded in x around inf 49.4%
Final simplification61.1%
(FPCore (x y z t a) :precision binary64 (if (<= y 2.4e+96) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 2.4e+96) {
tmp = x;
} else {
tmp = 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 (y <= 2.4d+96) then
tmp = x
else
tmp = y
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+96) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 2.4e+96: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 2.4e+96) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 2.4e+96) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 2.4e+96], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{+96}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 2.39999999999999993e96Initial program 98.5%
Taylor expanded in x around inf 58.1%
if 2.39999999999999993e96 < y Initial program 99.8%
Taylor expanded in a around 0 49.3%
Taylor expanded in y around inf 43.6%
Taylor expanded in t around 0 30.2%
Final simplification52.2%
(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 48.1%
Final simplification48.1%
(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 2024019
(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)))))