
(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 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(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 (* 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 84.7%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in y around 0 84.7%
associate-*r/99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.6e+20) (not (<= z 3400000000.0))) (+ x (* y (/ (- z t) z))) (+ x (/ y (/ (- z a) (- t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e+20) || !(z <= 3400000000.0)) {
tmp = x + (y * ((z - t) / z));
} 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 <= (-2.6d+20)) .or. (.not. (z <= 3400000000.0d0))) then
tmp = x + (y * ((z - t) / z))
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 <= -2.6e+20) || !(z <= 3400000000.0)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y / ((z - a) / -t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.6e+20) or not (z <= 3400000000.0): tmp = x + (y * ((z - t) / z)) else: tmp = x + (y / ((z - a) / -t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.6e+20) || !(z <= 3400000000.0)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); 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 <= -2.6e+20) || ~((z <= 3400000000.0))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y / ((z - a) / -t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.6e+20], N[Not[LessEqual[z, 3400000000.0]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $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 -2.6 \cdot 10^{+20} \lor \neg \left(z \leq 3400000000\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{-t}}\\
\end{array}
\end{array}
if z < -2.6e20 or 3.4e9 < z Initial program 72.6%
associate-*l/94.2%
Simplified94.2%
Taylor expanded in y around 0 72.6%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in a around 0 94.5%
if -2.6e20 < z < 3.4e9Initial program 92.9%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in t around inf 85.5%
associate-*r/85.5%
mul-1-neg85.5%
distribute-rgt-neg-out85.5%
associate-/l*91.2%
Simplified91.2%
Final simplification92.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.4e+20) (not (<= z 8.4e-134))) (+ x (* y (/ z (- z a)))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.4e+20) || !(z <= 8.4e-134)) {
tmp = x + (y * (z / (z - a)));
} 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 <= (-2.4d+20)) .or. (.not. (z <= 8.4d-134))) then
tmp = x + (y * (z / (z - a)))
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 <= -2.4e+20) || !(z <= 8.4e-134)) {
tmp = x + (y * (z / (z - a)));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.4e+20) or not (z <= 8.4e-134): tmp = x + (y * (z / (z - a))) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.4e+20) || !(z <= 8.4e-134)) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); 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 <= -2.4e+20) || ~((z <= 8.4e-134))) tmp = x + (y * (z / (z - a))); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.4e+20], N[Not[LessEqual[z, 8.4e-134]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+20} \lor \neg \left(z \leq 8.4 \cdot 10^{-134}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -2.4e20 or 8.3999999999999996e-134 < z Initial program 78.6%
associate-*l/94.7%
Simplified94.7%
Taylor expanded in y around 0 78.6%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in t around 0 85.0%
if -2.4e20 < z < 8.3999999999999996e-134Initial program 91.3%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in z around 0 79.4%
associate-/l*86.3%
Simplified86.3%
Final simplification85.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.3e-26) (not (<= z 3.2e-140))) (+ x (* y (/ (- z t) z))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e-26) || !(z <= 3.2e-140)) {
tmp = x + (y * ((z - t) / 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 <= (-4.3d-26)) .or. (.not. (z <= 3.2d-140))) then
tmp = x + (y * ((z - t) / 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 <= -4.3e-26) || !(z <= 3.2e-140)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.3e-26) or not (z <= 3.2e-140): tmp = x + (y * ((z - t) / z)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.3e-26) || !(z <= 3.2e-140)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / 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 <= -4.3e-26) || ~((z <= 3.2e-140))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.3e-26], N[Not[LessEqual[z, 3.2e-140]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-26} \lor \neg \left(z \leq 3.2 \cdot 10^{-140}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -4.29999999999999988e-26 or 3.2000000000000001e-140 < z Initial program 80.3%
associate-*l/95.1%
Simplified95.1%
Taylor expanded in y around 0 80.3%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in a around 0 87.4%
if -4.29999999999999988e-26 < z < 3.2000000000000001e-140Initial program 90.4%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in z around 0 81.9%
associate-/l*89.6%
Simplified89.6%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8e-21) (not (<= z 1.25e-20))) (+ x (* y (/ (- z t) z))) (+ x (* (/ y a) (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8e-21) || !(z <= 1.25e-20)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + ((y / a) * (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 <= (-8d-21)) .or. (.not. (z <= 1.25d-20))) then
tmp = x + (y * ((z - t) / z))
else
tmp = x + ((y / a) * (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 <= -8e-21) || !(z <= 1.25e-20)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + ((y / a) * (t - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8e-21) or not (z <= 1.25e-20): tmp = x + (y * ((z - t) / z)) else: tmp = x + ((y / a) * (t - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8e-21) || !(z <= 1.25e-20)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); else tmp = Float64(x + Float64(Float64(y / a) * Float64(t - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -8e-21) || ~((z <= 1.25e-20))) tmp = x + (y * ((z - t) / z)); else tmp = x + ((y / a) * (t - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8e-21], N[Not[LessEqual[z, 1.25e-20]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{-21} \lor \neg \left(z \leq 1.25 \cdot 10^{-20}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if z < -7.99999999999999926e-21 or 1.25e-20 < z Initial program 76.2%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in y around 0 76.2%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in a around 0 92.8%
if -7.99999999999999926e-21 < z < 1.25e-20Initial program 92.1%
associate-*l/97.1%
Simplified97.1%
Taylor expanded in z around 0 87.8%
associate-*r/87.8%
neg-mul-187.8%
Simplified87.8%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.5e+20) (not (<= z 1.15e-16))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.5e+20) || !(z <= 1.15e-16)) {
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 <= (-2.5d+20)) .or. (.not. (z <= 1.15d-16))) 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 <= -2.5e+20) || !(z <= 1.15e-16)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.5e+20) or not (z <= 1.15e-16): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.5e+20) || !(z <= 1.15e-16)) 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 <= -2.5e+20) || ~((z <= 1.15e-16))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.5e+20], N[Not[LessEqual[z, 1.15e-16]], $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 -2.5 \cdot 10^{+20} \lor \neg \left(z \leq 1.15 \cdot 10^{-16}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -2.5e20 or 1.15e-16 < z Initial program 73.4%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in z around inf 85.3%
if -2.5e20 < z < 1.15e-16Initial program 92.8%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in z around 0 76.5%
associate-/l*81.6%
Simplified81.6%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.45e+20) (+ x y) (if (<= z 1.35e-17) (+ x (* y (/ t a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.45e+20) {
tmp = x + y;
} else if (z <= 1.35e-17) {
tmp = x + (y * (t / a));
} 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 <= (-2.45d+20)) then
tmp = x + y
else if (z <= 1.35d-17) then
tmp = x + (y * (t / a))
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 <= -2.45e+20) {
tmp = x + y;
} else if (z <= 1.35e-17) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.45e+20: tmp = x + y elif z <= 1.35e-17: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.45e+20) tmp = Float64(x + y); elseif (z <= 1.35e-17) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.45e+20) tmp = x + y; elseif (z <= 1.35e-17) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.45e+20], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.35e-17], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.45 \cdot 10^{+20}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{-17}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.45e20 or 1.3500000000000001e-17 < z Initial program 73.4%
associate-*l/94.3%
Simplified94.3%
Taylor expanded in z around inf 85.3%
if -2.45e20 < z < 1.3500000000000001e-17Initial program 92.8%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in y around 0 92.8%
associate-*r/98.6%
Simplified98.6%
Taylor expanded in z around 0 81.0%
Final simplification82.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.4e-40) (+ x y) (if (<= z 2.75e-55) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.4e-40) {
tmp = x + y;
} else if (z <= 2.75e-55) {
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 (z <= (-2.4d-40)) then
tmp = x + y
else if (z <= 2.75d-55) 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 (z <= -2.4e-40) {
tmp = x + y;
} else if (z <= 2.75e-55) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.4e-40: tmp = x + y elif z <= 2.75e-55: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.4e-40) tmp = Float64(x + y); elseif (z <= 2.75e-55) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.4e-40) tmp = x + y; elseif (z <= 2.75e-55) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.4e-40], N[(x + y), $MachinePrecision], If[LessEqual[z, 2.75e-55], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-40}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{-55}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.39999999999999991e-40 or 2.7499999999999999e-55 < z Initial program 77.5%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in z around inf 79.1%
if -2.39999999999999991e-40 < z < 2.7499999999999999e-55Initial program 92.2%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in y around 0 92.2%
associate-*r/98.4%
Simplified98.4%
Taylor expanded in t around 0 57.5%
Taylor expanded in x around inf 51.6%
Final simplification65.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 84.7%
associate-*l/96.1%
Simplified96.1%
Taylor expanded in y around 0 84.7%
associate-*r/99.2%
Simplified99.2%
Taylor expanded in t around 0 70.8%
Taylor expanded in x around inf 53.1%
Final simplification53.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 2023279
(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))))