
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - 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 - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\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)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - 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 - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* (/ (- z t) (- a t)) y)))
double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (a - t)) * y);
}
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 + (((z - t) / (a - t)) * y)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((z - t) / (a - t)) * y);
}
def code(x, y, z, t, a): return x + (((z - t) / (a - t)) * y)
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(z - t) / Float64(a - t)) * y)) end
function tmp = code(x, y, z, t, a) tmp = x + (((z - t) / (a - t)) * y); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{a - t} \cdot y
\end{array}
Initial program 84.4%
*-commutative84.4%
associate-/l*96.8%
associate-/r/99.2%
Applied egg-rr99.2%
Final simplification99.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.52e+57) (not (<= z 8.4e-27))) (+ x (* z (/ y (- a t)))) (+ x (/ y (/ (- t a) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.52e+57) || !(z <= 8.4e-27)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y / ((t - 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 <= (-1.52d+57)) .or. (.not. (z <= 8.4d-27))) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (y / ((t - 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 <= -1.52e+57) || !(z <= 8.4e-27)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y / ((t - a) / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.52e+57) or not (z <= 8.4e-27): tmp = x + (z * (y / (a - t))) else: tmp = x + (y / ((t - a) / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.52e+57) || !(z <= 8.4e-27)) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(y / Float64(Float64(t - a) / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.52e+57) || ~((z <= 8.4e-27))) tmp = x + (z * (y / (a - t))); else tmp = x + (y / ((t - a) / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.52e+57], N[Not[LessEqual[z, 8.4e-27]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.52 \cdot 10^{+57} \lor \neg \left(z \leq 8.4 \cdot 10^{-27}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\
\end{array}
\end{array}
if z < -1.51999999999999998e57 or 8.40000000000000061e-27 < z Initial program 83.1%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in z around inf 79.5%
associate-*l/87.4%
*-commutative87.4%
Simplified87.4%
if -1.51999999999999998e57 < z < 8.40000000000000061e-27Initial program 85.8%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in z around 0 79.6%
associate-*r/79.6%
mul-1-neg79.6%
*-commutative79.6%
distribute-rgt-neg-out79.6%
associate-*l/90.4%
Simplified90.4%
associate-*l/79.6%
associate-/l*92.9%
frac-2neg92.9%
neg-sub092.9%
associate-+l-92.9%
neg-sub092.9%
+-commutative92.9%
sub-neg92.9%
remove-double-neg92.9%
Applied egg-rr92.9%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.5e+79) (+ x y) (if (<= t 2.8e+88) (+ x (* z (/ y (- a t)))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.5e+79) {
tmp = x + y;
} else if (t <= 2.8e+88) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + 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 (t <= (-4.5d+79)) then
tmp = x + y
else if (t <= 2.8d+88) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.5e+79) {
tmp = x + y;
} else if (t <= 2.8e+88) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.5e+79: tmp = x + y elif t <= 2.8e+88: tmp = x + (z * (y / (a - t))) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.5e+79) tmp = Float64(x + y); elseif (t <= 2.8e+88) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.5e+79) tmp = x + y; elseif (t <= 2.8e+88) tmp = x + (z * (y / (a - t))); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.5e+79], N[(x + y), $MachinePrecision], If[LessEqual[t, 2.8e+88], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+79}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{+88}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4.49999999999999994e79 or 2.79999999999999989e88 < t Initial program 63.5%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in t around inf 90.2%
+-commutative90.2%
Simplified90.2%
if -4.49999999999999994e79 < t < 2.79999999999999989e88Initial program 96.5%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in z around inf 84.6%
associate-*l/85.8%
*-commutative85.8%
Simplified85.8%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.65e+57) (- x (/ y (/ (- t a) z))) (if (<= z 2.55e-27) (+ x (/ y (/ (- t a) t))) (+ x (* z (/ y (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.65e+57) {
tmp = x - (y / ((t - a) / z));
} else if (z <= 2.55e-27) {
tmp = x + (y / ((t - a) / t));
} else {
tmp = x + (z * (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 <= (-1.65d+57)) then
tmp = x - (y / ((t - a) / z))
else if (z <= 2.55d-27) then
tmp = x + (y / ((t - a) / t))
else
tmp = x + (z * (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 <= -1.65e+57) {
tmp = x - (y / ((t - a) / z));
} else if (z <= 2.55e-27) {
tmp = x + (y / ((t - a) / t));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.65e+57: tmp = x - (y / ((t - a) / z)) elif z <= 2.55e-27: tmp = x + (y / ((t - a) / t)) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.65e+57) tmp = Float64(x - Float64(y / Float64(Float64(t - a) / z))); elseif (z <= 2.55e-27) tmp = Float64(x + Float64(y / Float64(Float64(t - a) / t))); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.65e+57) tmp = x - (y / ((t - a) / z)); elseif (z <= 2.55e-27) tmp = x + (y / ((t - a) / t)); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.65e+57], N[(x - N[(y / N[(N[(t - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.55e-27], N[(x + N[(y / N[(N[(t - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+57}:\\
\;\;\;\;x - \frac{y}{\frac{t - a}{z}}\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-27}:\\
\;\;\;\;x + \frac{y}{\frac{t - a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if z < -1.6500000000000001e57Initial program 91.8%
associate-*l/93.9%
Simplified93.9%
associate-*l/91.8%
frac-2neg91.8%
distribute-frac-neg91.8%
remove-double-neg91.8%
distribute-frac-neg91.8%
frac-2neg91.8%
associate-*l/93.9%
unsub-neg93.9%
associate-*l/91.8%
frac-2neg91.8%
distribute-frac-neg91.8%
remove-double-neg91.8%
associate-/l*99.9%
neg-sub099.9%
sub-neg99.9%
+-commutative99.9%
associate--r+99.9%
neg-sub099.9%
remove-double-neg99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 93.9%
if -1.6500000000000001e57 < z < 2.55e-27Initial program 85.8%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in z around 0 79.6%
associate-*r/79.6%
mul-1-neg79.6%
*-commutative79.6%
distribute-rgt-neg-out79.6%
associate-*l/90.4%
Simplified90.4%
associate-*l/79.6%
associate-/l*92.9%
frac-2neg92.9%
neg-sub092.9%
associate-+l-92.9%
neg-sub092.9%
+-commutative92.9%
sub-neg92.9%
remove-double-neg92.9%
Applied egg-rr92.9%
if 2.55e-27 < z Initial program 78.4%
associate-*l/98.7%
Simplified98.7%
Taylor expanded in z around inf 74.0%
associate-*l/86.0%
*-commutative86.0%
Simplified86.0%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.32e+70) (+ x y) (if (<= t 1.95) (+ x (* z (/ y a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.32e+70) {
tmp = x + y;
} else if (t <= 1.95) {
tmp = x + (z * (y / a));
} else {
tmp = x + 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 (t <= (-1.32d+70)) then
tmp = x + y
else if (t <= 1.95d0) then
tmp = x + (z * (y / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.32e+70) {
tmp = x + y;
} else if (t <= 1.95) {
tmp = x + (z * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.32e+70: tmp = x + y elif t <= 1.95: tmp = x + (z * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.32e+70) tmp = Float64(x + y); elseif (t <= 1.95) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.32e+70) tmp = x + y; elseif (t <= 1.95) tmp = x + (z * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.32e+70], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.95], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.32 \cdot 10^{+70}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.95:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -1.3199999999999999e70 or 1.94999999999999996 < t Initial program 69.6%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in t around inf 87.1%
+-commutative87.1%
Simplified87.1%
if -1.3199999999999999e70 < t < 1.94999999999999996Initial program 96.6%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in z around inf 85.0%
associate-*l/86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in a around inf 76.3%
Final simplification81.2%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.5e+68) (+ x y) (if (<= t 1.35) (+ x (* y (/ z a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.5e+68) {
tmp = x + y;
} else if (t <= 1.35) {
tmp = x + (y * (z / a));
} else {
tmp = x + 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 (t <= (-4.5d+68)) then
tmp = x + y
else if (t <= 1.35d0) then
tmp = x + (y * (z / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.5e+68) {
tmp = x + y;
} else if (t <= 1.35) {
tmp = x + (y * (z / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.5e+68: tmp = x + y elif t <= 1.35: tmp = x + (y * (z / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.5e+68) tmp = Float64(x + y); elseif (t <= 1.35) tmp = Float64(x + Float64(y * Float64(z / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.5e+68) tmp = x + y; elseif (t <= 1.35) tmp = x + (y * (z / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.5e+68], N[(x + y), $MachinePrecision], If[LessEqual[t, 1.35], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.5 \cdot 10^{+68}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq 1.35:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -4.5000000000000003e68 or 1.3500000000000001 < t Initial program 69.6%
associate-*l/96.3%
Simplified96.3%
Taylor expanded in t around inf 87.1%
+-commutative87.1%
Simplified87.1%
if -4.5000000000000003e68 < t < 1.3500000000000001Initial program 96.6%
*-commutative96.6%
associate-/l*97.2%
associate-/r/98.6%
Applied egg-rr98.6%
Taylor expanded in t around 0 77.0%
Final simplification81.5%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (a - 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 + ((z - t) * (y / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (a - t)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a - t}
\end{array}
Initial program 84.4%
associate-*l/96.8%
Simplified96.8%
Final simplification96.8%
(FPCore (x y z t a) :precision binary64 (if (<= z -3e+186) (* y (/ z a)) (if (<= z 4.2e+250) (+ x y) (* z (/ (- y) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3e+186) {
tmp = y * (z / a);
} else if (z <= 4.2e+250) {
tmp = x + y;
} else {
tmp = z * (-y / 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 <= (-3d+186)) then
tmp = y * (z / a)
else if (z <= 4.2d+250) then
tmp = x + y
else
tmp = z * (-y / 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 <= -3e+186) {
tmp = y * (z / a);
} else if (z <= 4.2e+250) {
tmp = x + y;
} else {
tmp = z * (-y / t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3e+186: tmp = y * (z / a) elif z <= 4.2e+250: tmp = x + y else: tmp = z * (-y / t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3e+186) tmp = Float64(y * Float64(z / a)); elseif (z <= 4.2e+250) tmp = Float64(x + y); else tmp = Float64(z * Float64(Float64(-y) / t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3e+186) tmp = y * (z / a); elseif (z <= 4.2e+250) tmp = x + y; else tmp = z * (-y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3e+186], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.2e+250], N[(x + y), $MachinePrecision], N[(z * N[((-y) / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+186}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+250}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-y}{t}\\
\end{array}
\end{array}
if z < -2.99999999999999982e186Initial program 87.6%
associate-*l/87.7%
Simplified87.7%
associate-*l/87.6%
frac-2neg87.6%
distribute-frac-neg87.6%
remove-double-neg87.6%
distribute-frac-neg87.6%
frac-2neg87.6%
associate-*l/87.7%
unsub-neg87.7%
associate-*l/87.6%
frac-2neg87.6%
distribute-frac-neg87.6%
remove-double-neg87.6%
associate-/l*99.9%
neg-sub099.9%
sub-neg99.9%
+-commutative99.9%
associate--r+99.9%
neg-sub099.9%
remove-double-neg99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 62.2%
mul-1-neg62.2%
*-commutative62.2%
associate-*r/62.3%
sub0-neg62.3%
cancel-sign-sub-inv62.3%
+-lft-identity62.3%
Simplified62.3%
Taylor expanded in z around 0 62.2%
mul-1-neg62.2%
distribute-frac-neg62.2%
distribute-rgt-neg-out62.2%
associate-*r/70.5%
Simplified70.5%
Taylor expanded in t around 0 66.5%
if -2.99999999999999982e186 < z < 4.2000000000000003e250Initial program 84.7%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in t around inf 70.2%
+-commutative70.2%
Simplified70.2%
if 4.2000000000000003e250 < z Initial program 68.4%
associate-*l/99.7%
Simplified99.7%
associate-*l/68.4%
frac-2neg68.4%
distribute-frac-neg68.4%
remove-double-neg68.4%
distribute-frac-neg68.4%
frac-2neg68.4%
associate-*l/99.7%
unsub-neg99.7%
associate-*l/68.4%
frac-2neg68.4%
distribute-frac-neg68.4%
remove-double-neg68.4%
associate-/l*78.8%
neg-sub078.8%
sub-neg78.8%
+-commutative78.8%
associate--r+78.8%
neg-sub078.8%
remove-double-neg78.8%
Applied egg-rr78.8%
Taylor expanded in z around inf 57.5%
mul-1-neg57.5%
*-commutative57.5%
associate-*r/84.7%
sub0-neg84.7%
cancel-sign-sub-inv84.7%
+-lft-identity84.7%
Simplified84.7%
Taylor expanded in t around inf 74.9%
Final simplification70.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.7e+186) (* y (/ z a)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.7e+186) {
tmp = y * (z / a);
} else {
tmp = x + 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 <= (-2.7d+186)) then
tmp = y * (z / a)
else
tmp = x + 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 <= -2.7e+186) {
tmp = y * (z / a);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.7e+186: tmp = y * (z / a) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.7e+186) tmp = Float64(y * Float64(z / a)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.7e+186) tmp = y * (z / a); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.7e+186], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+186}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -2.6999999999999999e186Initial program 87.6%
associate-*l/87.7%
Simplified87.7%
associate-*l/87.6%
frac-2neg87.6%
distribute-frac-neg87.6%
remove-double-neg87.6%
distribute-frac-neg87.6%
frac-2neg87.6%
associate-*l/87.7%
unsub-neg87.7%
associate-*l/87.6%
frac-2neg87.6%
distribute-frac-neg87.6%
remove-double-neg87.6%
associate-/l*99.9%
neg-sub099.9%
sub-neg99.9%
+-commutative99.9%
associate--r+99.9%
neg-sub099.9%
remove-double-neg99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 62.2%
mul-1-neg62.2%
*-commutative62.2%
associate-*r/62.3%
sub0-neg62.3%
cancel-sign-sub-inv62.3%
+-lft-identity62.3%
Simplified62.3%
Taylor expanded in z around 0 62.2%
mul-1-neg62.2%
distribute-frac-neg62.2%
distribute-rgt-neg-out62.2%
associate-*r/70.5%
Simplified70.5%
Taylor expanded in t around 0 66.5%
if -2.6999999999999999e186 < z Initial program 84.1%
associate-*l/97.7%
Simplified97.7%
Taylor expanded in t around inf 68.1%
+-commutative68.1%
Simplified68.1%
Final simplification67.9%
(FPCore (x y z t a) :precision binary64 (if (<= a 1.02e+192) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 1.02e+192) {
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.02d+192) 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.02e+192) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 1.02e+192: tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 1.02e+192) 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.02e+192) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 1.02e+192], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.02 \cdot 10^{+192}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 1.01999999999999996e192Initial program 83.8%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in t around inf 65.3%
+-commutative65.3%
Simplified65.3%
if 1.01999999999999996e192 < a Initial program 91.0%
associate-*l/95.9%
Simplified95.9%
Taylor expanded in x around inf 87.0%
Final simplification67.2%
(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 84.4%
associate-*l/96.8%
Simplified96.8%
Taylor expanded in x around inf 51.0%
Final simplification51.0%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (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 / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2023297
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:herbie-target
(+ x (/ y (/ (- a t) (- z t))))
(+ x (/ (* y (- z t)) (- a t))))