
(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 a) (- t z)))))
double code(double x, double y, double z, double t, double a) {
return x - (y / ((z - a) / (t - z)));
}
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) / (t - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y / ((z - a) / (t - z)));
}
def code(x, y, z, t, a): return x - (y / ((z - a) / (t - z)))
function code(x, y, z, t, a) return Float64(x - Float64(y / Float64(Float64(z - a) / Float64(t - z)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y / ((z - a) / (t - z))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y / N[(N[(z - a), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y}{\frac{z - a}{t - z}}
\end{array}
Initial program 97.3%
clear-num97.3%
un-div-inv98.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1e+21) (not (<= z 4.6e+23))) (- x (* y (/ (- t z) z))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e+21) || !(z <= 4.6e+23)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-1d+21)) .or. (.not. (z <= 4.6d+23))) then
tmp = x - (y * ((t - z) / z))
else
tmp = x + ((y * t) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1e+21) || !(z <= 4.6e+23)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1e+21) or not (z <= 4.6e+23): tmp = x - (y * ((t - z) / z)) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1e+21) || !(z <= 4.6e+23)) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1e+21) || ~((z <= 4.6e+23))) tmp = x - (y * ((t - z) / z)); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1e+21], N[Not[LessEqual[z, 4.6e+23]], $MachinePrecision]], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+21} \lor \neg \left(z \leq 4.6 \cdot 10^{+23}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1e21 or 4.6000000000000001e23 < z Initial program 99.9%
Taylor expanded in a around 0 86.2%
if -1e21 < z < 4.6000000000000001e23Initial program 94.9%
Taylor expanded in z around 0 85.3%
Final simplification85.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.2e+31) (not (<= z 8.6e+53))) (- x (* y (/ (- t z) z))) (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.2e+31) || !(z <= 8.6e+53)) {
tmp = x - (y * ((t - z) / z));
} 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 ((z <= (-3.2d+31)) .or. (.not. (z <= 8.6d+53))) then
tmp = x - (y * ((t - z) / z))
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 ((z <= -3.2e+31) || !(z <= 8.6e+53)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.2e+31) or not (z <= 8.6e+53): tmp = x - (y * ((t - z) / z)) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.2e+31) || !(z <= 8.6e+53)) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.2e+31) || ~((z <= 8.6e+53))) tmp = x - (y * ((t - z) / z)); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.2e+31], N[Not[LessEqual[z, 8.6e+53]], $MachinePrecision]], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+31} \lor \neg \left(z \leq 8.6 \cdot 10^{+53}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if z < -3.2000000000000001e31 or 8.5999999999999995e53 < z Initial program 99.9%
Taylor expanded in a around 0 87.0%
if -3.2000000000000001e31 < z < 8.5999999999999995e53Initial program 95.2%
clear-num95.2%
un-div-inv96.4%
Applied egg-rr96.4%
Taylor expanded in t around inf 90.5%
associate-*r/90.5%
neg-mul-190.5%
sub-neg90.5%
distribute-neg-in90.5%
remove-double-neg90.5%
Simplified90.5%
Taylor expanded in z around 0 89.7%
+-commutative89.7%
mul-1-neg89.7%
sub-neg89.7%
div-sub90.5%
Simplified90.5%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.9e+20) (not (<= t 1.02e-41))) (+ x (/ y (/ (- a z) t))) (- x (* y (/ z (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.9e+20) || !(t <= 1.02e-41)) {
tmp = x + (y / ((a - z) / t));
} 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 <= (-5.9d+20)) .or. (.not. (t <= 1.02d-41))) then
tmp = x + (y / ((a - z) / t))
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 <= -5.9e+20) || !(t <= 1.02e-41)) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = x - (y * (z / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.9e+20) or not (t <= 1.02e-41): tmp = x + (y / ((a - z) / t)) else: tmp = x - (y * (z / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.9e+20) || !(t <= 1.02e-41)) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); else tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.9e+20) || ~((t <= 1.02e-41))) tmp = x + (y / ((a - z) / t)); else tmp = x - (y * (z / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.9e+20], N[Not[LessEqual[t, 1.02e-41]], $MachinePrecision]], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.9 \cdot 10^{+20} \lor \neg \left(t \leq 1.02 \cdot 10^{-41}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\end{array}
\end{array}
if t < -5.9e20 or 1.02e-41 < t Initial program 94.9%
clear-num94.9%
un-div-inv96.1%
Applied egg-rr96.1%
Taylor expanded in t around inf 85.9%
associate-*r/85.9%
neg-mul-185.9%
sub-neg85.9%
distribute-neg-in85.9%
remove-double-neg85.9%
Simplified85.9%
Taylor expanded in z around 0 85.1%
+-commutative85.1%
mul-1-neg85.1%
sub-neg85.1%
div-sub85.9%
Simplified85.9%
if -5.9e20 < t < 1.02e-41Initial program 99.9%
Taylor expanded in t around 0 79.3%
+-commutative79.3%
associate-/l*94.6%
Simplified94.6%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -5.2e+91) (+ x (* t (/ y (- a z)))) (if (<= t 1.4e-40) (- x (* y (/ z (- a z)))) (+ x (/ y (/ (- a z) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.2e+91) {
tmp = x + (t * (y / (a - z)));
} else if (t <= 1.4e-40) {
tmp = x - (y * (z / (a - z)));
} 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 (t <= (-5.2d+91)) then
tmp = x + (t * (y / (a - z)))
else if (t <= 1.4d-40) then
tmp = x - (y * (z / (a - z)))
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 (t <= -5.2e+91) {
tmp = x + (t * (y / (a - z)));
} else if (t <= 1.4e-40) {
tmp = x - (y * (z / (a - z)));
} else {
tmp = x + (y / ((a - z) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.2e+91: tmp = x + (t * (y / (a - z))) elif t <= 1.4e-40: tmp = x - (y * (z / (a - z))) else: tmp = x + (y / ((a - z) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.2e+91) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); elseif (t <= 1.4e-40) tmp = Float64(x - Float64(y * Float64(z / Float64(a - z)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -5.2e+91) tmp = x + (t * (y / (a - z))); elseif (t <= 1.4e-40) tmp = x - (y * (z / (a - z))); else tmp = x + (y / ((a - z) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.2e+91], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e-40], N[(x - N[(y * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+91}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-40}:\\
\;\;\;\;x - y \cdot \frac{z}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\end{array}
\end{array}
if t < -5.2000000000000001e91Initial program 89.8%
Taylor expanded in t around inf 81.8%
mul-1-neg81.8%
associate-/l*88.7%
Simplified88.7%
if -5.2000000000000001e91 < t < 1.4e-40Initial program 99.3%
Taylor expanded in t around 0 76.6%
+-commutative76.6%
associate-/l*91.9%
Simplified91.9%
if 1.4e-40 < t Initial program 97.4%
clear-num97.4%
un-div-inv97.5%
Applied egg-rr97.5%
Taylor expanded in t around inf 88.7%
associate-*r/88.7%
neg-mul-188.7%
sub-neg88.7%
distribute-neg-in88.7%
remove-double-neg88.7%
Simplified88.7%
Taylor expanded in z around 0 87.3%
+-commutative87.3%
mul-1-neg87.3%
sub-neg87.3%
div-sub88.7%
Simplified88.7%
Final simplification90.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+22) (not (<= z 2.9e+49))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+22) || !(z <= 2.9e+49)) {
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.1d+22)) .or. (.not. (z <= 2.9d+49))) 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.1e+22) || !(z <= 2.9e+49)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e+22) or not (z <= 2.9e+49): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+22) || !(z <= 2.9e+49)) 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.1e+22) || ~((z <= 2.9e+49))) 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.1e+22], N[Not[LessEqual[z, 2.9e+49]], $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.1 \cdot 10^{+22} \lor \neg \left(z \leq 2.9 \cdot 10^{+49}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -1.1e22 or 2.9e49 < z Initial program 99.9%
Taylor expanded in z around inf 76.6%
+-commutative76.6%
Simplified76.6%
if -1.1e22 < z < 2.9e49Initial program 95.2%
Taylor expanded in z around 0 83.3%
*-commutative83.3%
associate-/l*80.9%
Simplified80.9%
Final simplification78.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.6e+21) (not (<= z 1.9e+51))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.6e+21) || !(z <= 1.9e+51)) {
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 <= (-7.6d+21)) .or. (.not. (z <= 1.9d+51))) 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 <= -7.6e+21) || !(z <= 1.9e+51)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.6e+21) or not (z <= 1.9e+51): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.6e+21) || !(z <= 1.9e+51)) 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 <= -7.6e+21) || ~((z <= 1.9e+51))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.6e+21], N[Not[LessEqual[z, 1.9e+51]], $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 -7.6 \cdot 10^{+21} \lor \neg \left(z \leq 1.9 \cdot 10^{+51}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -7.6e21 or 1.8999999999999999e51 < z Initial program 99.9%
Taylor expanded in z around inf 76.6%
+-commutative76.6%
Simplified76.6%
if -7.6e21 < z < 1.8999999999999999e51Initial program 95.2%
clear-num95.2%
un-div-inv96.4%
Applied egg-rr96.4%
Taylor expanded in z around 0 81.0%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+23) (not (<= z 1.2e+56))) (+ x y) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.1e+23) || !(z <= 1.2e+56)) {
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.1d+23)) .or. (.not. (z <= 1.2d+56))) 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.1e+23) || !(z <= 1.2e+56)) {
tmp = x + y;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.1e+23) or not (z <= 1.2e+56): tmp = x + y else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.1e+23) || !(z <= 1.2e+56)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.1e+23) || ~((z <= 1.2e+56))) 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.1e+23], N[Not[LessEqual[z, 1.2e+56]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+23} \lor \neg \left(z \leq 1.2 \cdot 10^{+56}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.10000000000000004e23 or 1.20000000000000007e56 < z Initial program 99.9%
Taylor expanded in z around inf 76.6%
+-commutative76.6%
Simplified76.6%
if -1.10000000000000004e23 < z < 1.20000000000000007e56Initial program 95.2%
Taylor expanded in z around 0 83.3%
Final simplification80.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.45e+21) (not (<= z 9.6e+42))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.45e+21) || !(z <= 9.6e+42)) {
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.45d+21)) .or. (.not. (z <= 9.6d+42))) 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.45e+21) || !(z <= 9.6e+42)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.45e+21) or not (z <= 9.6e+42): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.45e+21) || !(z <= 9.6e+42)) 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.45e+21) || ~((z <= 9.6e+42))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.45e+21], N[Not[LessEqual[z, 9.6e+42]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+21} \lor \neg \left(z \leq 9.6 \cdot 10^{+42}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.45e21 or 9.5999999999999994e42 < z Initial program 99.9%
Taylor expanded in z around inf 75.4%
+-commutative75.4%
Simplified75.4%
if -1.45e21 < z < 9.5999999999999994e42Initial program 95.1%
Taylor expanded in x around inf 59.7%
Final simplification67.0%
(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 97.3%
Final simplification97.3%
(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 97.3%
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 2024055
(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)))))