
(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.0%
clear-num97.0%
un-div-inv97.4%
Applied egg-rr97.4%
Final simplification97.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.4e+30) (not (<= z 1.6e+68))) (- x (* y (+ -1.0 (/ t z)))) (+ x (/ t (/ (- a z) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.4e+30) || !(z <= 1.6e+68)) {
tmp = x - (y * (-1.0 + (t / z)));
} else {
tmp = x + (t / ((a - 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 <= (-3.4d+30)) .or. (.not. (z <= 1.6d+68))) then
tmp = x - (y * ((-1.0d0) + (t / z)))
else
tmp = x + (t / ((a - 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 <= -3.4e+30) || !(z <= 1.6e+68)) {
tmp = x - (y * (-1.0 + (t / z)));
} else {
tmp = x + (t / ((a - z) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.4e+30) or not (z <= 1.6e+68): tmp = x - (y * (-1.0 + (t / z))) else: tmp = x + (t / ((a - z) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.4e+30) || !(z <= 1.6e+68)) tmp = Float64(x - Float64(y * Float64(-1.0 + Float64(t / z)))); else tmp = Float64(x + Float64(t / Float64(Float64(a - z) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.4e+30) || ~((z <= 1.6e+68))) tmp = x - (y * (-1.0 + (t / z))); else tmp = x + (t / ((a - z) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.4e+30], N[Not[LessEqual[z, 1.6e+68]], $MachinePrecision]], N[(x - N[(y * N[(-1.0 + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(N[(a - z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+30} \lor \neg \left(z \leq 1.6 \cdot 10^{+68}\right):\\
\;\;\;\;x - y \cdot \left(-1 + \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\
\end{array}
\end{array}
if z < -3.4000000000000002e30 or 1.59999999999999997e68 < z Initial program 100.0%
Taylor expanded in a around 0 64.1%
associate-/l*91.8%
div-sub91.8%
*-inverses91.8%
Simplified91.8%
if -3.4000000000000002e30 < z < 1.59999999999999997e68Initial program 94.8%
Taylor expanded in t around inf 90.0%
mul-1-neg90.0%
associate-/l*90.4%
Simplified90.4%
unsub-neg90.4%
clear-num90.3%
un-div-inv90.8%
Applied egg-rr90.8%
Final simplification91.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.35e-43) (not (<= z 4.5e-142))) (- x (* y (+ -1.0 (/ t z)))) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.35e-43) || !(z <= 4.5e-142)) {
tmp = x - (y * (-1.0 + (t / 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 <= (-1.35d-43)) .or. (.not. (z <= 4.5d-142))) then
tmp = x - (y * ((-1.0d0) + (t / 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 <= -1.35e-43) || !(z <= 4.5e-142)) {
tmp = x - (y * (-1.0 + (t / z)));
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.35e-43) or not (z <= 4.5e-142): tmp = x - (y * (-1.0 + (t / z))) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.35e-43) || !(z <= 4.5e-142)) tmp = Float64(x - Float64(y * Float64(-1.0 + Float64(t / 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 <= -1.35e-43) || ~((z <= 4.5e-142))) tmp = x - (y * (-1.0 + (t / z))); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.35e-43], N[Not[LessEqual[z, 4.5e-142]], $MachinePrecision]], N[(x - N[(y * N[(-1.0 + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.35 \cdot 10^{-43} \lor \neg \left(z \leq 4.5 \cdot 10^{-142}\right):\\
\;\;\;\;x - y \cdot \left(-1 + \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.34999999999999996e-43 or 4.50000000000000019e-142 < z Initial program 98.7%
Taylor expanded in a around 0 68.3%
associate-/l*85.8%
div-sub85.8%
*-inverses85.8%
Simplified85.8%
if -1.34999999999999996e-43 < z < 4.50000000000000019e-142Initial program 93.9%
Taylor expanded in z around 0 85.1%
Final simplification85.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.4e-42) (- x (* y (+ -1.0 (/ t z)))) (if (<= z 3.5e-142) (+ x (/ (* y t) a)) (+ x (/ y (/ z (- z t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.4e-42) {
tmp = x - (y * (-1.0 + (t / z)));
} else if (z <= 3.5e-142) {
tmp = x + ((y * t) / a);
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.4d-42)) then
tmp = x - (y * ((-1.0d0) + (t / z)))
else if (z <= 3.5d-142) then
tmp = x + ((y * t) / a)
else
tmp = x + (y / (z / (z - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.4e-42) {
tmp = x - (y * (-1.0 + (t / z)));
} else if (z <= 3.5e-142) {
tmp = x + ((y * t) / a);
} else {
tmp = x + (y / (z / (z - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.4e-42: tmp = x - (y * (-1.0 + (t / z))) elif z <= 3.5e-142: tmp = x + ((y * t) / a) else: tmp = x + (y / (z / (z - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.4e-42) tmp = Float64(x - Float64(y * Float64(-1.0 + Float64(t / z)))); elseif (z <= 3.5e-142) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.4e-42) tmp = x - (y * (-1.0 + (t / z))); elseif (z <= 3.5e-142) tmp = x + ((y * t) / a); else tmp = x + (y / (z / (z - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.4e-42], N[(x - N[(y * N[(-1.0 + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e-142], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{-42}:\\
\;\;\;\;x - y \cdot \left(-1 + \frac{t}{z}\right)\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-142}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\end{array}
\end{array}
if z < -1.39999999999999999e-42Initial program 99.9%
Taylor expanded in a around 0 66.5%
associate-/l*90.9%
div-sub90.9%
*-inverses90.9%
Simplified90.9%
if -1.39999999999999999e-42 < z < 3.50000000000000015e-142Initial program 93.9%
Taylor expanded in z around 0 85.1%
if 3.50000000000000015e-142 < z Initial program 97.9%
clear-num97.9%
un-div-inv98.0%
Applied egg-rr98.0%
Taylor expanded in a around 0 82.3%
Final simplification85.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.6e+28) (not (<= z 2.05e+67))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.6e+28) || !(z <= 2.05e+67)) {
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.6d+28)) .or. (.not. (z <= 2.05d+67))) 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.6e+28) || !(z <= 2.05e+67)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.6e+28) or not (z <= 2.05e+67): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.6e+28) || !(z <= 2.05e+67)) 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.6e+28) || ~((z <= 2.05e+67))) 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.6e+28], N[Not[LessEqual[z, 2.05e+67]], $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.6 \cdot 10^{+28} \lor \neg \left(z \leq 2.05 \cdot 10^{+67}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -2.6000000000000002e28 or 2.0499999999999999e67 < z Initial program 100.0%
Taylor expanded in z around inf 81.7%
+-commutative81.7%
Simplified81.7%
if -2.6000000000000002e28 < z < 2.0499999999999999e67Initial program 94.8%
clear-num94.8%
un-div-inv95.6%
Applied egg-rr95.6%
Taylor expanded in z around 0 78.2%
Final simplification79.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -8.5e+27) (not (<= z 1.15e+67))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -8.5e+27) || !(z <= 1.15e+67)) {
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 <= (-8.5d+27)) .or. (.not. (z <= 1.15d+67))) 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 <= -8.5e+27) || !(z <= 1.15e+67)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -8.5e+27) or not (z <= 1.15e+67): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -8.5e+27) || !(z <= 1.15e+67)) 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 <= -8.5e+27) || ~((z <= 1.15e+67))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.5e+27], N[Not[LessEqual[z, 1.15e+67]], $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 -8.5 \cdot 10^{+27} \lor \neg \left(z \leq 1.15 \cdot 10^{+67}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -8.5e27 or 1.1499999999999999e67 < z Initial program 100.0%
Taylor expanded in z around inf 81.7%
+-commutative81.7%
Simplified81.7%
if -8.5e27 < z < 1.1499999999999999e67Initial program 94.8%
Taylor expanded in z around 0 77.6%
Final simplification79.3%
(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.0%
(FPCore (x y z t a) :precision binary64 (if (<= t 6.4e+209) (+ x y) (* t (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 6.4e+209) {
tmp = x + y;
} else {
tmp = 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 (t <= 6.4d+209) then
tmp = x + y
else
tmp = 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 (t <= 6.4e+209) {
tmp = x + y;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 6.4e+209: tmp = x + y else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 6.4e+209) tmp = Float64(x + y); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 6.4e+209) tmp = x + y; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 6.4e+209], N[(x + y), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.4 \cdot 10^{+209}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < 6.3999999999999999e209Initial program 97.3%
Taylor expanded in z around inf 66.4%
+-commutative66.4%
Simplified66.4%
if 6.3999999999999999e209 < t Initial program 92.2%
Taylor expanded in t around inf 85.7%
mul-1-neg85.7%
associate-/l*99.8%
Simplified99.8%
unsub-neg99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in x around 0 72.1%
associate-*r/72.1%
neg-mul-172.1%
distribute-rgt-neg-in72.1%
Simplified72.1%
Taylor expanded in z around 0 48.9%
associate-/l*63.1%
Simplified63.1%
Final simplification66.2%
(FPCore (x y z t a) :precision binary64 (if (<= a 1.16e+126) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 1.16e+126) {
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 (a <= 1.16d+126) 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 (a <= 1.16e+126) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 1.16e+126: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 1.16e+126) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 1.16e+126) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 1.16e+126], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.16 \cdot 10^{+126}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 1.15999999999999997e126Initial program 96.9%
Taylor expanded in z around inf 64.3%
+-commutative64.3%
Simplified64.3%
if 1.15999999999999997e126 < a Initial program 97.5%
Taylor expanded in x around inf 72.1%
Final simplification65.5%
(FPCore (x y z t a) :precision binary64 (if (<= y 8.2e+123) x y))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 8.2e+123) {
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 <= 8.2d+123) 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 <= 8.2e+123) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 8.2e+123: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 8.2e+123) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 8.2e+123) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 8.2e+123], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.2 \cdot 10^{+123}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 8.19999999999999979e123Initial program 96.4%
Taylor expanded in x around inf 59.6%
if 8.19999999999999979e123 < y Initial program 99.9%
Taylor expanded in z around inf 47.5%
+-commutative47.5%
Simplified47.5%
Taylor expanded in y around inf 41.0%
(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.0%
Taylor expanded in x around inf 51.9%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2024186
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (* y (/ (- z t) (- z a)))))