
(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 (/ (- 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}
Initial program 99.1%
clear-num99.0%
un-div-inv99.1%
Applied egg-rr99.1%
Final simplification99.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.35e+126) (not (<= z 2.6e+44))) (+ x y) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.35e+126) || !(z <= 2.6e+44)) {
tmp = x + y;
} 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.35d+126)) .or. (.not. (z <= 2.6d+44))) then
tmp = x + y
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.35e+126) || !(z <= 2.6e+44)) {
tmp = x + y;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.35e+126) or not (z <= 2.6e+44): tmp = x + y else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.35e+126) || !(z <= 2.6e+44)) tmp = Float64(x + y); 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.35e+126) || ~((z <= 2.6e+44))) tmp = x + y; else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.35e+126], N[Not[LessEqual[z, 2.6e+44]], $MachinePrecision]], N[(x + y), $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.35 \cdot 10^{+126} \lor \neg \left(z \leq 2.6 \cdot 10^{+44}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -5.3500000000000002e126 or 2.5999999999999999e44 < z Initial program 99.9%
Taylor expanded in z around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -5.3500000000000002e126 < z < 2.5999999999999999e44Initial program 98.6%
Taylor expanded in t around inf 87.6%
associate-*r/87.6%
mul-1-neg87.6%
distribute-lft-neg-out87.6%
*-commutative87.6%
associate-/l*89.3%
distribute-neg-frac89.3%
distribute-neg-frac289.3%
sub-neg89.3%
distribute-neg-in89.3%
remove-double-neg89.3%
Simplified89.3%
Taylor expanded in y around 0 87.6%
*-commutative87.6%
associate-*r/89.3%
Simplified89.3%
Final simplification84.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.9e+70) (not (<= z 1.9e+44))) (+ x (* y (/ (- z t) z))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.9e+70) || !(z <= 1.9e+44)) {
tmp = x + (y * ((z - t) / 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 <= (-3.9d+70)) .or. (.not. (z <= 1.9d+44))) then
tmp = x + (y * ((z - t) / 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 <= -3.9e+70) || !(z <= 1.9e+44)) {
tmp = x + (y * ((z - t) / z));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.9e+70) or not (z <= 1.9e+44): tmp = x + (y * ((z - t) / z)) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.9e+70) || !(z <= 1.9e+44)) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / 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 <= -3.9e+70) || ~((z <= 1.9e+44))) tmp = x + (y * ((z - t) / z)); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.9e+70], N[Not[LessEqual[z, 1.9e+44]], $MachinePrecision]], N[(x + N[(y * N[(N[(z - t), $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 -3.9 \cdot 10^{+70} \lor \neg \left(z \leq 1.9 \cdot 10^{+44}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -3.89999999999999975e70 or 1.9000000000000001e44 < z Initial program 99.9%
Taylor expanded in a around 0 85.7%
if -3.89999999999999975e70 < z < 1.9000000000000001e44Initial program 98.5%
Taylor expanded in t around inf 87.6%
associate-*r/87.6%
mul-1-neg87.6%
distribute-lft-neg-out87.6%
*-commutative87.6%
associate-/l*89.5%
distribute-neg-frac89.5%
distribute-neg-frac289.5%
sub-neg89.5%
distribute-neg-in89.5%
remove-double-neg89.5%
Simplified89.5%
Taylor expanded in y around 0 87.6%
*-commutative87.6%
associate-*r/89.5%
Simplified89.5%
Final simplification87.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.02e+34) (not (<= t 1.65e-10))) (+ x (* y (/ t (- a z)))) (+ x (/ y (/ (- z a) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.02e+34) || !(t <= 1.65e-10)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y / ((z - 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 ((t <= (-1.02d+34)) .or. (.not. (t <= 1.65d-10))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (y / ((z - 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 ((t <= -1.02e+34) || !(t <= 1.65e-10)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y / ((z - a) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.02e+34) or not (t <= 1.65e-10): tmp = x + (y * (t / (a - z))) else: tmp = x + (y / ((z - a) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.02e+34) || !(t <= 1.65e-10)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(y / Float64(Float64(z - a) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.02e+34) || ~((t <= 1.65e-10))) tmp = x + (y * (t / (a - z))); else tmp = x + (y / ((z - a) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.02e+34], N[Not[LessEqual[t, 1.65e-10]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.02 \cdot 10^{+34} \lor \neg \left(t \leq 1.65 \cdot 10^{-10}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if t < -1.02e34 or 1.65e-10 < t Initial program 98.1%
Taylor expanded in t around inf 77.4%
associate-*r/77.4%
mul-1-neg77.4%
distribute-lft-neg-out77.4%
*-commutative77.4%
associate-/l*86.1%
distribute-neg-frac86.1%
distribute-neg-frac286.1%
sub-neg86.1%
distribute-neg-in86.1%
remove-double-neg86.1%
Simplified86.1%
Taylor expanded in y around 0 77.4%
*-commutative77.4%
associate-*r/86.1%
Simplified86.1%
if -1.02e34 < t < 1.65e-10Initial program 99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 92.7%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.4e+69) (+ x (/ y (/ z (- z t)))) (if (<= z 2.2e+44) (+ x (* y (/ t (- a z)))) (+ x (* y (/ (- z t) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.4e+69) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 2.2e+44) {
tmp = x + (y * (t / (a - z)));
} 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 <= (-4.4d+69)) then
tmp = x + (y / (z / (z - t)))
else if (z <= 2.2d+44) then
tmp = x + (y * (t / (a - z)))
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 <= -4.4e+69) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 2.2e+44) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (y * ((z - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.4e+69: tmp = x + (y / (z / (z - t))) elif z <= 2.2e+44: tmp = x + (y * (t / (a - z))) else: tmp = x + (y * ((z - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.4e+69) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (z <= 2.2e+44) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); 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 <= -4.4e+69) tmp = x + (y / (z / (z - t))); elseif (z <= 2.2e+44) tmp = x + (y * (t / (a - z))); else tmp = x + (y * ((z - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.4e+69], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+44], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $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.4 \cdot 10^{+69}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+44}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\end{array}
\end{array}
if z < -4.4000000000000003e69Initial program 99.9%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in a around 0 91.0%
if -4.4000000000000003e69 < z < 2.19999999999999996e44Initial program 98.5%
Taylor expanded in t around inf 87.6%
associate-*r/87.6%
mul-1-neg87.6%
distribute-lft-neg-out87.6%
*-commutative87.6%
associate-/l*89.5%
distribute-neg-frac89.5%
distribute-neg-frac289.5%
sub-neg89.5%
distribute-neg-in89.5%
remove-double-neg89.5%
Simplified89.5%
Taylor expanded in y around 0 87.6%
*-commutative87.6%
associate-*r/89.5%
Simplified89.5%
if 2.19999999999999996e44 < z Initial program 99.9%
Taylor expanded in a around 0 81.0%
Final simplification87.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.3e+70) (not (<= z 2.35e+44))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.3e+70) || !(z <= 2.35e+44)) {
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 <= (-4.3d+70)) .or. (.not. (z <= 2.35d+44))) 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 <= -4.3e+70) || !(z <= 2.35e+44)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.3e+70) or not (z <= 2.35e+44): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.3e+70) || !(z <= 2.35e+44)) 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 <= -4.3e+70) || ~((z <= 2.35e+44))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.3e+70], N[Not[LessEqual[z, 2.35e+44]], $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 -4.3 \cdot 10^{+70} \lor \neg \left(z \leq 2.35 \cdot 10^{+44}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -4.3000000000000001e70 or 2.35000000000000009e44 < z Initial program 99.9%
Taylor expanded in z around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -4.3000000000000001e70 < z < 2.35000000000000009e44Initial program 98.5%
Taylor expanded in z around 0 73.1%
*-commutative73.1%
associate-/l*75.0%
Simplified75.0%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4e+64) (not (<= z 1.65e+44))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4e+64) || !(z <= 1.65e+44)) {
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 <= (-4d+64)) .or. (.not. (z <= 1.65d+44))) 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 <= -4e+64) || !(z <= 1.65e+44)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4e+64) or not (z <= 1.65e+44): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4e+64) || !(z <= 1.65e+44)) 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 <= -4e+64) || ~((z <= 1.65e+44))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4e+64], N[Not[LessEqual[z, 1.65e+44]], $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 -4 \cdot 10^{+64} \lor \neg \left(z \leq 1.65 \cdot 10^{+44}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -4.00000000000000009e64 or 1.65000000000000007e44 < z Initial program 99.9%
Taylor expanded in z around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -4.00000000000000009e64 < z < 1.65000000000000007e44Initial program 98.5%
clear-num98.4%
un-div-inv98.5%
Applied egg-rr98.5%
Taylor expanded in z around 0 75.0%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.8e+20) (not (<= z 2.4e-38))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.8e+20) || !(z <= 2.4e-38)) {
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.8d+20)) .or. (.not. (z <= 2.4d-38))) 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.8e+20) || !(z <= 2.4e-38)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.8e+20) or not (z <= 2.4e-38): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.8e+20) || !(z <= 2.4e-38)) 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.8e+20) || ~((z <= 2.4e-38))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.8e+20], N[Not[LessEqual[z, 2.4e-38]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+20} \lor \neg \left(z \leq 2.4 \cdot 10^{-38}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.8e20 or 2.40000000000000022e-38 < z Initial program 99.9%
Taylor expanded in z around inf 72.9%
+-commutative72.9%
Simplified72.9%
if -1.8e20 < z < 2.40000000000000022e-38Initial program 98.1%
Taylor expanded in x around inf 55.1%
Final simplification65.1%
(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 99.1%
Final simplification99.1%
(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 99.1%
Taylor expanded in x around inf 48.5%
Final simplification48.5%
(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 2024078
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (* y (/ (- z t) (- z a)))))