
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - 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) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y z) t) (- a z))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - 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) * t) / (a - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - z) * t) / (a - z));
}
def code(x, y, z, t, a): return x + (((y - z) * t) / (a - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - z) * t) / (a - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - z\right) \cdot t}{a - z}
\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(Float64(y - z) * Float64(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[(N[(y - z), $MachinePrecision] * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(y - z\right) \cdot \frac{t}{z - a}
\end{array}
Initial program 88.5%
associate-/l*97.1%
Simplified97.1%
Final simplification97.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.3e-8)
(+ x t)
(if (<= z 1.4e-53)
(+ x (* y (/ t a)))
(if (<= z 3.6e+129) (- x (* t (/ y z))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.3e-8) {
tmp = x + t;
} else if (z <= 1.4e-53) {
tmp = x + (y * (t / a));
} else if (z <= 3.6e+129) {
tmp = x - (t * (y / z));
} else {
tmp = x + 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.3d-8)) then
tmp = x + t
else if (z <= 1.4d-53) then
tmp = x + (y * (t / a))
else if (z <= 3.6d+129) then
tmp = x - (t * (y / z))
else
tmp = x + 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.3e-8) {
tmp = x + t;
} else if (z <= 1.4e-53) {
tmp = x + (y * (t / a));
} else if (z <= 3.6e+129) {
tmp = x - (t * (y / z));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.3e-8: tmp = x + t elif z <= 1.4e-53: tmp = x + (y * (t / a)) elif z <= 3.6e+129: tmp = x - (t * (y / z)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.3e-8) tmp = Float64(x + t); elseif (z <= 1.4e-53) tmp = Float64(x + Float64(y * Float64(t / a))); elseif (z <= 3.6e+129) tmp = Float64(x - Float64(t * Float64(y / z))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.3e-8) tmp = x + t; elseif (z <= 1.4e-53) tmp = x + (y * (t / a)); elseif (z <= 3.6e+129) tmp = x - (t * (y / z)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.3e-8], N[(x + t), $MachinePrecision], If[LessEqual[z, 1.4e-53], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+129], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{-8}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-53}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+129}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.3000000000000001e-8 or 3.6000000000000001e129 < z Initial program 73.7%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around inf 79.4%
if -2.3000000000000001e-8 < z < 1.39999999999999993e-53Initial program 97.0%
*-commutative97.0%
sub-neg97.0%
distribute-rgt-in97.0%
Applied egg-rr97.0%
Taylor expanded in z around 0 81.4%
associate-*l/82.6%
*-commutative82.6%
Simplified82.6%
if 1.39999999999999993e-53 < z < 3.6000000000000001e129Initial program 99.7%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in y around inf 81.4%
Taylor expanded in a around 0 78.3%
mul-1-neg78.3%
unsub-neg78.3%
associate-/l*78.3%
Simplified78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.16e-6) (not (<= z 7e-8))) (+ x (* t (/ (- z y) z))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.16e-6) || !(z <= 7e-8)) {
tmp = x + (t * ((z - y) / 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 <= (-1.16d-6)) .or. (.not. (z <= 7d-8))) then
tmp = x + (t * ((z - y) / 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 <= -1.16e-6) || !(z <= 7e-8)) {
tmp = x + (t * ((z - y) / z));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.16e-6) or not (z <= 7e-8): tmp = x + (t * ((z - y) / z)) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.16e-6) || !(z <= 7e-8)) tmp = Float64(x + Float64(t * Float64(Float64(z - y) / 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 <= -1.16e-6) || ~((z <= 7e-8))) tmp = x + (t * ((z - y) / z)); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.16e-6], N[Not[LessEqual[z, 7e-8]], $MachinePrecision]], N[(x + N[(t * N[(N[(z - y), $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 -1.16 \cdot 10^{-6} \lor \neg \left(z \leq 7 \cdot 10^{-8}\right):\\
\;\;\;\;x + t \cdot \frac{z - y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -1.1599999999999999e-6 or 7.00000000000000048e-8 < z Initial program 78.5%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in a around 0 71.2%
mul-1-neg71.2%
unsub-neg71.2%
associate-/l*88.2%
Simplified88.2%
if -1.1599999999999999e-6 < z < 7.00000000000000048e-8Initial program 97.2%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in y around inf 93.0%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.05e-99) (not (<= y 14000000000.0))) (+ x (* y (/ t (- a z)))) (+ x (* z (/ t (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.05e-99) || !(y <= 14000000000.0)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (z * (t / (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 ((y <= (-1.05d-99)) .or. (.not. (y <= 14000000000.0d0))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x + (z * (t / (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 ((y <= -1.05e-99) || !(y <= 14000000000.0)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x + (z * (t / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.05e-99) or not (y <= 14000000000.0): tmp = x + (y * (t / (a - z))) else: tmp = x + (z * (t / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.05e-99) || !(y <= 14000000000.0)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x + Float64(z * Float64(t / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.05e-99) || ~((y <= 14000000000.0))) tmp = x + (y * (t / (a - z))); else tmp = x + (z * (t / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.05e-99], N[Not[LessEqual[y, 14000000000.0]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-99} \lor \neg \left(y \leq 14000000000\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{t}{z - a}\\
\end{array}
\end{array}
if y < -1.04999999999999992e-99 or 1.4e10 < y Initial program 88.6%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in y around inf 89.9%
if -1.04999999999999992e-99 < y < 1.4e10Initial program 88.3%
associate-/l*96.2%
Simplified96.2%
Taylor expanded in y around 0 81.7%
associate-*r/81.7%
mul-1-neg81.7%
distribute-rgt-neg-out81.7%
associate-*l/90.1%
*-commutative90.1%
distribute-lft-neg-out90.1%
distribute-rgt-neg-in90.1%
distribute-frac-neg290.1%
neg-sub090.1%
sub-neg90.1%
+-commutative90.1%
associate--r+90.1%
neg-sub090.1%
remove-double-neg90.1%
Simplified90.1%
Final simplification90.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.2e+147) (not (<= z 2.2e+129))) (+ x t) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.2e+147) || !(z <= 2.2e+129)) {
tmp = x + t;
} 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 <= (-2.2d+147)) .or. (.not. (z <= 2.2d+129))) then
tmp = x + t
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 <= -2.2e+147) || !(z <= 2.2e+129)) {
tmp = x + t;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.2e+147) or not (z <= 2.2e+129): tmp = x + t else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.2e+147) || !(z <= 2.2e+129)) tmp = Float64(x + t); 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 <= -2.2e+147) || ~((z <= 2.2e+129))) tmp = x + t; else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.2e+147], N[Not[LessEqual[z, 2.2e+129]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+147} \lor \neg \left(z \leq 2.2 \cdot 10^{+129}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -2.2000000000000002e147 or 2.1999999999999999e129 < z Initial program 65.3%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in z around inf 83.6%
if -2.2000000000000002e147 < z < 2.1999999999999999e129Initial program 96.9%
associate-/l*97.9%
Simplified97.9%
Taylor expanded in y around inf 89.5%
Final simplification87.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.55e-8) (not (<= z 1.4e+60))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.55e-8) || !(z <= 1.4e+60)) {
tmp = x + t;
} 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 <= (-2.55d-8)) .or. (.not. (z <= 1.4d+60))) then
tmp = x + t
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 <= -2.55e-8) || !(z <= 1.4e+60)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.55e-8) or not (z <= 1.4e+60): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.55e-8) || !(z <= 1.4e+60)) tmp = Float64(x + t); 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 <= -2.55e-8) || ~((z <= 1.4e+60))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.55e-8], N[Not[LessEqual[z, 1.4e+60]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.55 \cdot 10^{-8} \lor \neg \left(z \leq 1.4 \cdot 10^{+60}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.55e-8 or 1.4e60 < z Initial program 77.4%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in z around inf 76.5%
if -2.55e-8 < z < 1.4e60Initial program 97.3%
*-commutative97.3%
sub-neg97.3%
distribute-rgt-in97.3%
Applied egg-rr97.3%
Taylor expanded in z around 0 78.2%
associate-*l/79.3%
*-commutative79.3%
Simplified79.3%
Final simplification78.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.02e-8) (not (<= z 7.5e+59))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.02e-8) || !(z <= 7.5e+59)) {
tmp = x + t;
} 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 <= (-1.02d-8)) .or. (.not. (z <= 7.5d+59))) then
tmp = x + t
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 <= -1.02e-8) || !(z <= 7.5e+59)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.02e-8) or not (z <= 7.5e+59): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.02e-8) || !(z <= 7.5e+59)) tmp = Float64(x + t); 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 <= -1.02e-8) || ~((z <= 7.5e+59))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.02e-8], N[Not[LessEqual[z, 7.5e+59]], $MachinePrecision]], N[(x + t), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{-8} \lor \neg \left(z \leq 7.5 \cdot 10^{+59}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.02000000000000003e-8 or 7.4999999999999996e59 < z Initial program 77.4%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in z around inf 76.5%
if -1.02000000000000003e-8 < z < 7.4999999999999996e59Initial program 97.3%
associate-/l*97.9%
Simplified97.9%
Taylor expanded in z around 0 78.2%
associate-/l*77.9%
Simplified77.9%
Final simplification77.3%
(FPCore (x y z t a) :precision binary64 (if (<= y -9.5e+274) (/ t (/ a y)) (if (<= y 5e+227) (+ x t) (* t (/ y (- z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -9.5e+274) {
tmp = t / (a / y);
} else if (y <= 5e+227) {
tmp = x + t;
} else {
tmp = t * (y / -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 (y <= (-9.5d+274)) then
tmp = t / (a / y)
else if (y <= 5d+227) then
tmp = x + t
else
tmp = t * (y / -z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -9.5e+274) {
tmp = t / (a / y);
} else if (y <= 5e+227) {
tmp = x + t;
} else {
tmp = t * (y / -z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -9.5e+274: tmp = t / (a / y) elif y <= 5e+227: tmp = x + t else: tmp = t * (y / -z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -9.5e+274) tmp = Float64(t / Float64(a / y)); elseif (y <= 5e+227) tmp = Float64(x + t); else tmp = Float64(t * Float64(y / Float64(-z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -9.5e+274) tmp = t / (a / y); elseif (y <= 5e+227) tmp = x + t; else tmp = t * (y / -z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -9.5e+274], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+227], N[(x + t), $MachinePrecision], N[(t * N[(y / (-z)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+274}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+227}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{-z}\\
\end{array}
\end{array}
if y < -9.50000000000000031e274Initial program 84.6%
associate-/l*91.6%
Simplified91.6%
Taylor expanded in z around 0 68.5%
+-commutative68.5%
Simplified68.5%
Taylor expanded in t around inf 60.8%
associate-*r/76.0%
Simplified76.0%
clear-num76.0%
un-div-inv76.2%
Applied egg-rr76.2%
if -9.50000000000000031e274 < y < 4.9999999999999996e227Initial program 88.7%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in z around inf 63.8%
if 4.9999999999999996e227 < y Initial program 88.8%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in y around inf 94.2%
Taylor expanded in a around 0 65.7%
mul-1-neg65.7%
unsub-neg65.7%
associate-/l*71.2%
Simplified71.2%
Taylor expanded in x around 0 65.7%
mul-1-neg65.7%
associate-*r/71.2%
distribute-rgt-neg-out71.2%
distribute-frac-neg271.2%
Simplified71.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.05e+275) (not (<= y 4.7e+225))) (/ t (/ a y)) (+ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.05e+275) || !(y <= 4.7e+225)) {
tmp = t / (a / y);
} else {
tmp = x + 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 ((y <= (-1.05d+275)) .or. (.not. (y <= 4.7d+225))) then
tmp = t / (a / y)
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.05e+275) || !(y <= 4.7e+225)) {
tmp = t / (a / y);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.05e+275) or not (y <= 4.7e+225): tmp = t / (a / y) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.05e+275) || !(y <= 4.7e+225)) tmp = Float64(t / Float64(a / y)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.05e+275) || ~((y <= 4.7e+225))) tmp = t / (a / y); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.05e+275], N[Not[LessEqual[y, 4.7e+225]], $MachinePrecision]], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{+275} \lor \neg \left(y \leq 4.7 \cdot 10^{+225}\right):\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if y < -1.05e275 or 4.70000000000000004e225 < y Initial program 87.5%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in z around 0 61.3%
+-commutative61.3%
Simplified61.3%
Taylor expanded in t around inf 58.2%
associate-*r/64.2%
Simplified64.2%
clear-num64.2%
un-div-inv64.3%
Applied egg-rr64.3%
if -1.05e275 < y < 4.70000000000000004e225Initial program 88.6%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in z around inf 64.0%
Final simplification64.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -9e+274) (not (<= y 4.7e+223))) (* t (/ y a)) (+ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -9e+274) || !(y <= 4.7e+223)) {
tmp = t * (y / a);
} else {
tmp = x + 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 ((y <= (-9d+274)) .or. (.not. (y <= 4.7d+223))) then
tmp = t * (y / a)
else
tmp = x + t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -9e+274) || !(y <= 4.7e+223)) {
tmp = t * (y / a);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -9e+274) or not (y <= 4.7e+223): tmp = t * (y / a) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -9e+274) || !(y <= 4.7e+223)) tmp = Float64(t * Float64(y / a)); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -9e+274) || ~((y <= 4.7e+223))) tmp = t * (y / a); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -9e+274], N[Not[LessEqual[y, 4.7e+223]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+274} \lor \neg \left(y \leq 4.7 \cdot 10^{+223}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if y < -8.9999999999999995e274 or 4.70000000000000041e223 < y Initial program 87.5%
associate-/l*93.4%
Simplified93.4%
Taylor expanded in z around 0 61.3%
+-commutative61.3%
Simplified61.3%
Taylor expanded in t around inf 58.2%
associate-*r/64.2%
Simplified64.2%
if -8.9999999999999995e274 < y < 4.70000000000000041e223Initial program 88.6%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in z around inf 64.0%
Final simplification64.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -8.5e+274) (/ t (/ a y)) (if (<= y 6.2e+222) (+ x t) (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -8.5e+274) {
tmp = t / (a / y);
} else if (y <= 6.2e+222) {
tmp = x + t;
} else {
tmp = (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 (y <= (-8.5d+274)) then
tmp = t / (a / y)
else if (y <= 6.2d+222) then
tmp = x + t
else
tmp = (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 (y <= -8.5e+274) {
tmp = t / (a / y);
} else if (y <= 6.2e+222) {
tmp = x + t;
} else {
tmp = (y * t) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -8.5e+274: tmp = t / (a / y) elif y <= 6.2e+222: tmp = x + t else: tmp = (y * t) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -8.5e+274) tmp = Float64(t / Float64(a / y)); elseif (y <= 6.2e+222) tmp = Float64(x + t); else tmp = Float64(Float64(y * t) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -8.5e+274) tmp = t / (a / y); elseif (y <= 6.2e+222) tmp = x + t; else tmp = (y * t) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -8.5e+274], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e+222], N[(x + t), $MachinePrecision], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+274}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+222}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\end{array}
\end{array}
if y < -8.5000000000000002e274Initial program 84.6%
associate-/l*91.6%
Simplified91.6%
Taylor expanded in z around 0 68.5%
+-commutative68.5%
Simplified68.5%
Taylor expanded in t around inf 60.8%
associate-*r/76.0%
Simplified76.0%
clear-num76.0%
un-div-inv76.2%
Applied egg-rr76.2%
if -8.5000000000000002e274 < y < 6.1999999999999996e222Initial program 88.6%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in z around inf 64.0%
if 6.1999999999999996e222 < y Initial program 89.5%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in z around 0 56.5%
+-commutative56.5%
Simplified56.5%
Taylor expanded in t around inf 56.5%
Final simplification64.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.4e-62) (not (<= z 1.15e-9))) (+ x t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.4e-62) || !(z <= 1.15e-9)) {
tmp = x + t;
} 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 <= (-3.4d-62)) .or. (.not. (z <= 1.15d-9))) then
tmp = x + t
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 <= -3.4e-62) || !(z <= 1.15e-9)) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.4e-62) or not (z <= 1.15e-9): tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.4e-62) || !(z <= 1.15e-9)) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.4e-62) || ~((z <= 1.15e-9))) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.4e-62], N[Not[LessEqual[z, 1.15e-9]], $MachinePrecision]], N[(x + t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{-62} \lor \neg \left(z \leq 1.15 \cdot 10^{-9}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.39999999999999988e-62 or 1.15e-9 < z Initial program 79.6%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in z around inf 72.8%
if -3.39999999999999988e-62 < z < 1.15e-9Initial program 97.7%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in x around inf 49.2%
Final simplification61.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 88.5%
associate-/l*97.1%
Simplified97.1%
Taylor expanded in x around inf 50.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (/ (- y z) (- a z)) t))))
(if (< t -1.0682974490174067e-39)
t_1
(if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} 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 = x + (((y - z) / (a - z)) * t)
if (t < (-1.0682974490174067d-39)) then
tmp = t_1
else if (t < 3.9110949887586375d-141) then
tmp = x + (((y - z) * t) / (a - z))
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 = x + (((y - z) / (a - z)) * t);
double tmp;
if (t < -1.0682974490174067e-39) {
tmp = t_1;
} else if (t < 3.9110949887586375e-141) {
tmp = x + (((y - z) * t) / (a - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (((y - z) / (a - z)) * t) tmp = 0 if t < -1.0682974490174067e-39: tmp = t_1 elif t < 3.9110949887586375e-141: tmp = x + (((y - z) * t) / (a - z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(Float64(y - z) / Float64(a - z)) * t)) tmp = 0.0 if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / Float64(a - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (((y - z) / (a - z)) * t); tmp = 0.0; if (t < -1.0682974490174067e-39) tmp = t_1; elseif (t < 3.9110949887586375e-141) tmp = x + (((y - z) * t) / (a - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.0682974490174067e-39], t$95$1, If[Less[t, 3.9110949887586375e-141], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y - z}{a - z} \cdot t\\
\mathbf{if}\;t < -1.0682974490174067 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < 3.9110949887586375 \cdot 10^{-141}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024170
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (if (< t -10682974490174067/10000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 312887599100691/80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t)))))
(+ x (/ (* (- y z) t) (- a z))))