
(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 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.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (* y (- 1.0 (/ t z))) x))) (if (<= z -6.2e-65) t_1 (if (<= z 3.9e+43) (- x (/ (- z t) (/ a y))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (1.0 - (t / z))) + x;
double tmp;
if (z <= -6.2e-65) {
tmp = t_1;
} else if (z <= 3.9e+43) {
tmp = x - ((z - t) / (a / y));
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = (y * (1.0d0 - (t / z))) + x
if (z <= (-6.2d-65)) then
tmp = t_1
else if (z <= 3.9d+43) then
tmp = x - ((z - t) / (a / y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (1.0 - (t / z))) + x;
double tmp;
if (z <= -6.2e-65) {
tmp = t_1;
} else if (z <= 3.9e+43) {
tmp = x - ((z - t) / (a / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (1.0 - (t / z))) + x tmp = 0 if z <= -6.2e-65: tmp = t_1 elif z <= 3.9e+43: tmp = x - ((z - t) / (a / y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(1.0 - Float64(t / z))) + x) tmp = 0.0 if (z <= -6.2e-65) tmp = t_1; elseif (z <= 3.9e+43) tmp = Float64(x - Float64(Float64(z - t) / Float64(a / y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (1.0 - (t / z))) + x; tmp = 0.0; if (z <= -6.2e-65) tmp = t_1; elseif (z <= 3.9e+43) tmp = x - ((z - t) / (a / y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -6.2e-65], t$95$1, If[LessEqual[z, 3.9e+43], N[(x - N[(N[(z - t), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(1 - \frac{t}{z}\right) + x\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+43}:\\
\;\;\;\;x - \frac{z - t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.20000000000000032e-65 or 3.9000000000000001e43 < z Initial program 99.9%
Taylor expanded in a around 0 0
Simplified0
if -6.20000000000000032e-65 < z < 3.9000000000000001e43Initial program 94.6%
Simplified0
Applied egg-rr0
Applied egg-rr0
Taylor expanded in a around inf 0
Simplified0
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (* y (- 1.0 (/ t z))) x))) (if (<= z -9.6e-64) t_1 (if (<= z 3.9e+43) (+ (* (/ y a) t) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (1.0 - (t / z))) + x;
double tmp;
if (z <= -9.6e-64) {
tmp = t_1;
} else if (z <= 3.9e+43) {
tmp = ((y / a) * t) + x;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = (y * (1.0d0 - (t / z))) + x
if (z <= (-9.6d-64)) then
tmp = t_1
else if (z <= 3.9d+43) then
tmp = ((y / a) * t) + x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (1.0 - (t / z))) + x;
double tmp;
if (z <= -9.6e-64) {
tmp = t_1;
} else if (z <= 3.9e+43) {
tmp = ((y / a) * t) + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (1.0 - (t / z))) + x tmp = 0 if z <= -9.6e-64: tmp = t_1 elif z <= 3.9e+43: tmp = ((y / a) * t) + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(1.0 - Float64(t / z))) + x) tmp = 0.0 if (z <= -9.6e-64) tmp = t_1; elseif (z <= 3.9e+43) tmp = Float64(Float64(Float64(y / a) * t) + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (1.0 - (t / z))) + x; tmp = 0.0; if (z <= -9.6e-64) tmp = t_1; elseif (z <= 3.9e+43) tmp = ((y / a) * t) + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -9.6e-64], t$95$1, If[LessEqual[z, 3.9e+43], N[(N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(1 - \frac{t}{z}\right) + x\\
\mathbf{if}\;z \leq -9.6 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{+43}:\\
\;\;\;\;\frac{y}{a} \cdot t + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.59999999999999994e-64 or 3.9000000000000001e43 < z Initial program 99.9%
Taylor expanded in a around 0 0
Simplified0
if -9.59999999999999994e-64 < z < 3.9000000000000001e43Initial program 94.6%
Taylor expanded in z around 0 0
Simplified0
Applied egg-rr0
Applied egg-rr0
(FPCore (x y z t a) :precision binary64 (if (<= z -2.15e+21) (+ y x) (if (<= z 1.25e+35) (+ (* (/ y a) t) x) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.15e+21) {
tmp = y + x;
} else if (z <= 1.25e+35) {
tmp = ((y / a) * t) + x;
} else {
tmp = y + 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 <= (-2.15d+21)) then
tmp = y + x
else if (z <= 1.25d+35) then
tmp = ((y / a) * t) + x
else
tmp = y + 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 <= -2.15e+21) {
tmp = y + x;
} else if (z <= 1.25e+35) {
tmp = ((y / a) * t) + x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.15e+21: tmp = y + x elif z <= 1.25e+35: tmp = ((y / a) * t) + x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.15e+21) tmp = Float64(y + x); elseif (z <= 1.25e+35) tmp = Float64(Float64(Float64(y / a) * t) + x); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.15e+21) tmp = y + x; elseif (z <= 1.25e+35) tmp = ((y / a) * t) + x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.15e+21], N[(y + x), $MachinePrecision], If[LessEqual[z, 1.25e+35], N[(N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision] + x), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.15 \cdot 10^{+21}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+35}:\\
\;\;\;\;\frac{y}{a} \cdot t + x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -2.15e21 or 1.25000000000000005e35 < z Initial program 99.9%
Taylor expanded in z around inf 0
Simplified0
if -2.15e21 < z < 1.25000000000000005e35Initial program 95.1%
Taylor expanded in z around 0 0
Simplified0
Applied egg-rr0
Applied egg-rr0
(FPCore (x y z t a) :precision binary64 (if (<= z -1.85e+21) (+ y x) (if (<= z 4.4e+34) (+ x (* y (/ t a))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.85e+21) {
tmp = y + x;
} else if (z <= 4.4e+34) {
tmp = x + (y * (t / a));
} else {
tmp = y + 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.85d+21)) then
tmp = y + x
else if (z <= 4.4d+34) then
tmp = x + (y * (t / a))
else
tmp = y + 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.85e+21) {
tmp = y + x;
} else if (z <= 4.4e+34) {
tmp = x + (y * (t / a));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.85e+21: tmp = y + x elif z <= 4.4e+34: tmp = x + (y * (t / a)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.85e+21) tmp = Float64(y + x); elseif (z <= 4.4e+34) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.85e+21) tmp = y + x; elseif (z <= 4.4e+34) tmp = x + (y * (t / a)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.85e+21], N[(y + x), $MachinePrecision], If[LessEqual[z, 4.4e+34], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+21}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+34}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.85e21 or 4.4000000000000005e34 < z Initial program 99.9%
Taylor expanded in z around inf 0
Simplified0
if -1.85e21 < z < 4.4000000000000005e34Initial program 95.1%
Taylor expanded in z around 0 0
Simplified0
(FPCore (x y z t a) :precision binary64 (if (<= z -1.1e-188) (+ y x) (if (<= z 2.1e-157) (* t (/ y (- a z))) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e-188) {
tmp = y + x;
} else if (z <= 2.1e-157) {
tmp = t * (y / (a - z));
} else {
tmp = y + 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.1d-188)) then
tmp = y + x
else if (z <= 2.1d-157) then
tmp = t * (y / (a - z))
else
tmp = y + 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.1e-188) {
tmp = y + x;
} else if (z <= 2.1e-157) {
tmp = t * (y / (a - z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e-188: tmp = y + x elif z <= 2.1e-157: tmp = t * (y / (a - z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e-188) tmp = Float64(y + x); elseif (z <= 2.1e-157) tmp = Float64(t * Float64(y / Float64(a - z))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.1e-188) tmp = y + x; elseif (z <= 2.1e-157) tmp = t * (y / (a - z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e-188], N[(y + x), $MachinePrecision], If[LessEqual[z, 2.1e-157], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{-188}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-157}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -1.1e-188 or 2.1e-157 < z Initial program 99.4%
Taylor expanded in z around inf 0
Simplified0
if -1.1e-188 < z < 2.1e-157Initial program 91.9%
Simplified0
Taylor expanded in t around inf 0
Simplified0
(FPCore (x y z t a) :precision binary64 (if (<= z -6.4e-230) (+ y x) (if (<= z 3.9e-157) (/ t (/ a y)) (+ y x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.4e-230) {
tmp = y + x;
} else if (z <= 3.9e-157) {
tmp = t / (a / y);
} else {
tmp = y + 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 <= (-6.4d-230)) then
tmp = y + x
else if (z <= 3.9d-157) then
tmp = t / (a / y)
else
tmp = y + 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 <= -6.4e-230) {
tmp = y + x;
} else if (z <= 3.9e-157) {
tmp = t / (a / y);
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.4e-230: tmp = y + x elif z <= 3.9e-157: tmp = t / (a / y) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.4e-230) tmp = Float64(y + x); elseif (z <= 3.9e-157) tmp = Float64(t / Float64(a / y)); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.4e-230) tmp = y + x; elseif (z <= 3.9e-157) tmp = t / (a / y); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.4e-230], N[(y + x), $MachinePrecision], If[LessEqual[z, 3.9e-157], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{-230}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-157}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -6.3999999999999999e-230 or 3.89999999999999999e-157 < z Initial program 99.4%
Taylor expanded in z around inf 0
Simplified0
if -6.3999999999999999e-230 < z < 3.89999999999999999e-157Initial program 91.2%
Simplified0
Applied egg-rr0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
Taylor expanded in a around inf 0
Simplified0
(FPCore (x y z t a) :precision binary64 (if (<= x -1.25e-180) x (if (<= x 1e-15) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.25e-180) {
tmp = x;
} else if (x <= 1e-15) {
tmp = 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 (x <= (-1.25d-180)) then
tmp = x
else if (x <= 1d-15) then
tmp = 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 (x <= -1.25e-180) {
tmp = x;
} else if (x <= 1e-15) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.25e-180: tmp = x elif x <= 1e-15: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.25e-180) tmp = x; elseif (x <= 1e-15) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.25e-180) tmp = x; elseif (x <= 1e-15) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.25e-180], x, If[LessEqual[x, 1e-15], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-180}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 10^{-15}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.25e-180 or 1.0000000000000001e-15 < x Initial program 98.8%
Taylor expanded in x around inf 0
Simplified0
if -1.25e-180 < x < 1.0000000000000001e-15Initial program 95.3%
Taylor expanded in z around inf 0
Simplified0
Taylor expanded in y around inf 0
Simplified0
(FPCore (x y z t a) :precision binary64 (if (<= a 8.6e+48) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 8.6e+48) {
tmp = y + x;
} 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 <= 8.6d+48) then
tmp = y + x
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 <= 8.6e+48) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 8.6e+48: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 8.6e+48) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 8.6e+48) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 8.6e+48], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 8.6 \cdot 10^{+48}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 8.59999999999999957e48Initial program 97.1%
Taylor expanded in z around inf 0
Simplified0
if 8.59999999999999957e48 < a Initial program 99.6%
Taylor expanded in x around inf 0
Simplified0
(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.6%
Taylor expanded in x around inf 0
Simplified0
(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 2024111
(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)))))