
(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 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 98.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.5e+81) (not (<= t 1.4))) (+ 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 <= -6.5e+81) || !(t <= 1.4)) {
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 <= (-6.5d+81)) .or. (.not. (t <= 1.4d0))) 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 <= -6.5e+81) || !(t <= 1.4)) {
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 <= -6.5e+81) or not (t <= 1.4): 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 <= -6.5e+81) || !(t <= 1.4)) 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 <= -6.5e+81) || ~((t <= 1.4))) 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, -6.5e+81], N[Not[LessEqual[t, 1.4]], $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 -6.5 \cdot 10^{+81} \lor \neg \left(t \leq 1.4\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z}}\\
\end{array}
\end{array}
if t < -6.4999999999999996e81 or 1.3999999999999999 < t Initial program 98.2%
Taylor expanded in t around inf 78.3%
associate-*r/78.3%
mul-1-neg78.3%
distribute-lft-neg-out78.3%
*-commutative78.3%
*-lft-identity78.3%
times-frac87.2%
/-rgt-identity87.2%
distribute-neg-frac87.2%
distribute-neg-frac287.2%
neg-sub087.2%
sub-neg87.2%
+-commutative87.2%
associate--r+87.2%
neg-sub087.2%
remove-double-neg87.2%
Simplified87.2%
if -6.4999999999999996e81 < t < 1.3999999999999999Initial program 99.5%
clear-num99.6%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in t around 0 94.1%
Final simplification91.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.6e+58) (not (<= z 6.6e+59))) (+ 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 <= -4.6e+58) || !(z <= 6.6e+59)) {
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 <= (-4.6d+58)) .or. (.not. (z <= 6.6d+59))) 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 <= -4.6e+58) || !(z <= 6.6e+59)) {
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 <= -4.6e+58) or not (z <= 6.6e+59): 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 <= -4.6e+58) || !(z <= 6.6e+59)) 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 <= -4.6e+58) || ~((z <= 6.6e+59))) 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, -4.6e+58], N[Not[LessEqual[z, 6.6e+59]], $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 -4.6 \cdot 10^{+58} \lor \neg \left(z \leq 6.6 \cdot 10^{+59}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -4.60000000000000005e58 or 6.5999999999999999e59 < z Initial program 99.9%
Taylor expanded in a around 0 88.6%
if -4.60000000000000005e58 < z < 6.5999999999999999e59Initial program 98.3%
Taylor expanded in t around inf 86.6%
associate-*r/86.6%
mul-1-neg86.6%
distribute-lft-neg-out86.6%
*-commutative86.6%
*-lft-identity86.6%
times-frac89.9%
/-rgt-identity89.9%
distribute-neg-frac89.9%
distribute-neg-frac289.9%
neg-sub089.9%
sub-neg89.9%
+-commutative89.9%
associate--r+89.9%
neg-sub089.9%
remove-double-neg89.9%
Simplified89.9%
Final simplification89.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.5e+184) (not (<= z 3.9e+67))) (+ x y) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.5e+184) || !(z <= 3.9e+67)) {
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 <= (-3.5d+184)) .or. (.not. (z <= 3.9d+67))) 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 <= -3.5e+184) || !(z <= 3.9e+67)) {
tmp = x + y;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.5e+184) or not (z <= 3.9e+67): tmp = x + y else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.5e+184) || !(z <= 3.9e+67)) 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 <= -3.5e+184) || ~((z <= 3.9e+67))) 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, -3.5e+184], N[Not[LessEqual[z, 3.9e+67]], $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 -3.5 \cdot 10^{+184} \lor \neg \left(z \leq 3.9 \cdot 10^{+67}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -3.49999999999999978e184 or 3.90000000000000007e67 < z Initial program 100.0%
Taylor expanded in z around inf 87.8%
+-commutative87.8%
Simplified87.8%
if -3.49999999999999978e184 < z < 3.90000000000000007e67Initial program 98.5%
Taylor expanded in t around inf 83.2%
associate-*r/83.2%
mul-1-neg83.2%
distribute-lft-neg-out83.2%
*-commutative83.2%
*-lft-identity83.2%
times-frac87.0%
/-rgt-identity87.0%
distribute-neg-frac87.0%
distribute-neg-frac287.0%
neg-sub087.0%
sub-neg87.0%
+-commutative87.0%
associate--r+87.0%
neg-sub087.0%
remove-double-neg87.0%
Simplified87.0%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.65e+54) (+ x (* y (/ (- z t) z))) (if (<= z 3.8e+59) (+ x (* y (/ t (- a z)))) (+ x (* z (/ y (- z a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.65e+54) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 3.8e+59) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (z * (y / (z - 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 <= (-2.65d+54)) then
tmp = x + (y * ((z - t) / z))
else if (z <= 3.8d+59) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (z * (y / (z - 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 <= -2.65e+54) {
tmp = x + (y * ((z - t) / z));
} else if (z <= 3.8e+59) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.65e+54: tmp = x + (y * ((z - t) / z)) elif z <= 3.8e+59: tmp = x + (y * (t / (a - z))) else: tmp = x + (z * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.65e+54) tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z))); elseif (z <= 3.8e+59) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.65e+54) tmp = x + (y * ((z - t) / z)); elseif (z <= 3.8e+59) tmp = x + (y * (t / (a - z))); else tmp = x + (z * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.65e+54], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+59], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.65 \cdot 10^{+54}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+59}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if z < -2.65000000000000009e54Initial program 99.9%
Taylor expanded in a around 0 88.5%
if -2.65000000000000009e54 < z < 3.8000000000000001e59Initial program 98.3%
Taylor expanded in t around inf 86.6%
associate-*r/86.6%
mul-1-neg86.6%
distribute-lft-neg-out86.6%
*-commutative86.6%
*-lft-identity86.6%
times-frac89.9%
/-rgt-identity89.9%
distribute-neg-frac89.9%
distribute-neg-frac289.9%
neg-sub089.9%
sub-neg89.9%
+-commutative89.9%
associate--r+89.9%
neg-sub089.9%
remove-double-neg89.9%
Simplified89.9%
if 3.8000000000000001e59 < z Initial program 99.9%
clear-num100.0%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in t around 0 66.7%
associate-*l/89.6%
*-commutative89.6%
Simplified89.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.285) (not (<= z 1.65e+66))) (+ x y) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.285) || !(z <= 1.65e+66)) {
tmp = x + y;
} else {
tmp = x + (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 ((z <= (-0.285d0)) .or. (.not. (z <= 1.65d+66))) then
tmp = x + y
else
tmp = x + (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 ((z <= -0.285) || !(z <= 1.65e+66)) {
tmp = x + y;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.285) or not (z <= 1.65e+66): tmp = x + y else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.285) || !(z <= 1.65e+66)) tmp = Float64(x + y); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -0.285) || ~((z <= 1.65e+66))) tmp = x + y; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.285], N[Not[LessEqual[z, 1.65e+66]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.285 \lor \neg \left(z \leq 1.65 \cdot 10^{+66}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -0.284999999999999976 or 1.6500000000000001e66 < z Initial program 99.9%
Taylor expanded in z around inf 78.2%
+-commutative78.2%
Simplified78.2%
if -0.284999999999999976 < z < 1.6500000000000001e66Initial program 98.1%
Taylor expanded in z around 0 77.7%
+-commutative77.7%
associate-/l*79.7%
Simplified79.7%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.285) (not (<= z 8e+60))) (+ x y) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.285) || !(z <= 8e+60)) {
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 <= (-0.285d0)) .or. (.not. (z <= 8d+60))) 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 <= -0.285) || !(z <= 8e+60)) {
tmp = x + y;
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.285) or not (z <= 8e+60): tmp = x + y else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.285) || !(z <= 8e+60)) 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 <= -0.285) || ~((z <= 8e+60))) tmp = x + y; else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.285], N[Not[LessEqual[z, 8e+60]], $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 -0.285 \lor \neg \left(z \leq 8 \cdot 10^{+60}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if z < -0.284999999999999976 or 7.9999999999999996e60 < z Initial program 99.9%
Taylor expanded in z around inf 78.2%
+-commutative78.2%
Simplified78.2%
if -0.284999999999999976 < z < 7.9999999999999996e60Initial program 98.1%
clear-num98.1%
un-div-inv98.2%
Applied egg-rr98.2%
Taylor expanded in z around 0 79.4%
Final simplification78.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -0.285) (not (<= z 5.8e+58))) (+ x y) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -0.285) || !(z <= 5.8e+58)) {
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 <= (-0.285d0)) .or. (.not. (z <= 5.8d+58))) 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 <= -0.285) || !(z <= 5.8e+58)) {
tmp = x + y;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -0.285) or not (z <= 5.8e+58): tmp = x + y else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -0.285) || !(z <= 5.8e+58)) 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 <= -0.285) || ~((z <= 5.8e+58))) tmp = x + y; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -0.285], N[Not[LessEqual[z, 5.8e+58]], $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 -0.285 \lor \neg \left(z \leq 5.8 \cdot 10^{+58}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -0.284999999999999976 or 5.80000000000000004e58 < z Initial program 99.9%
Taylor expanded in z around inf 78.2%
+-commutative78.2%
Simplified78.2%
if -0.284999999999999976 < z < 5.80000000000000004e58Initial program 98.1%
Taylor expanded in z around 0 79.4%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9.5e-19) (not (<= z 1.35e+47))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9.5e-19) || !(z <= 1.35e+47)) {
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 <= (-9.5d-19)) .or. (.not. (z <= 1.35d+47))) 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 <= -9.5e-19) || !(z <= 1.35e+47)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9.5e-19) or not (z <= 1.35e+47): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9.5e-19) || !(z <= 1.35e+47)) 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 <= -9.5e-19) || ~((z <= 1.35e+47))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9.5e-19], N[Not[LessEqual[z, 1.35e+47]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-19} \lor \neg \left(z \leq 1.35 \cdot 10^{+47}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -9.4999999999999995e-19 or 1.34999999999999998e47 < z Initial program 99.9%
Taylor expanded in z around inf 75.6%
+-commutative75.6%
Simplified75.6%
if -9.4999999999999995e-19 < z < 1.34999999999999998e47Initial program 98.0%
Taylor expanded in x around inf 53.9%
Final simplification64.4%
(FPCore (x y z t a) :precision binary64 (if (<= x -4.5e-147) x (if (<= x 3.8e-178) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -4.5e-147) {
tmp = x;
} else if (x <= 3.8e-178) {
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 <= (-4.5d-147)) then
tmp = x
else if (x <= 3.8d-178) 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 <= -4.5e-147) {
tmp = x;
} else if (x <= 3.8e-178) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -4.5e-147: tmp = x elif x <= 3.8e-178: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -4.5e-147) tmp = x; elseif (x <= 3.8e-178) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -4.5e-147) tmp = x; elseif (x <= 3.8e-178) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -4.5e-147], x, If[LessEqual[x, 3.8e-178], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{-147}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-178}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.49999999999999973e-147 or 3.80000000000000015e-178 < x Initial program 99.2%
Taylor expanded in x around inf 62.1%
if -4.49999999999999973e-147 < x < 3.80000000000000015e-178Initial program 98.3%
Taylor expanded in z around inf 39.2%
+-commutative39.2%
Simplified39.2%
Taylor expanded in y around inf 33.6%
(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 98.9%
Taylor expanded in x around inf 50.0%
(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 2024174
(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)))))