
(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 14 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 (let* ((t_1 (+ (/ (- y z) (/ (- a z) t)) x)) (t_2 (/ (* (- y z) t) (- a z)))) (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 1e+218) (+ t_2 x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) / ((a - z) / t)) + x;
double t_2 = ((y - z) * t) / (a - z);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 1e+218) {
tmp = t_2 + x;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - z) / ((a - z) / t)) + x;
double t_2 = ((y - z) * t) / (a - z);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= 1e+218) {
tmp = t_2 + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - z) / ((a - z) / t)) + x t_2 = ((y - z) * t) / (a - z) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= 1e+218: tmp = t_2 + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - z) / Float64(Float64(a - z) / t)) + x) t_2 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 1e+218) tmp = Float64(t_2 + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - z) / ((a - z) / t)) + x; t_2 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= 1e+218) tmp = t_2 + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 1e+218], N[(t$95$2 + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - z}{\frac{a - z}{t}} + x\\
t_2 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+218}:\\
\;\;\;\;t\_2 + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 1.00000000000000008e218 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 47.3%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f64100.0%
Applied egg-rr100.0%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1.00000000000000008e218Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (* (- y z) (/ t (- a z))))) (t_2 (/ (* (- y z) t) (- a z)))) (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 5e+223) (+ t_2 x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * (t / (a - z)));
double t_2 = ((y - z) * t) / (a - z);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 5e+223) {
tmp = t_2 + x;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * (t / (a - z)));
double t_2 = ((y - z) * t) / (a - z);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= 5e+223) {
tmp = t_2 + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y - z) * (t / (a - z))) t_2 = ((y - z) * t) / (a - z) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= 5e+223: tmp = t_2 + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))) t_2 = Float64(Float64(Float64(y - z) * t) / Float64(a - z)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 5e+223) tmp = Float64(t_2 + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y - z) * (t / (a - z))); t_2 = ((y - z) * t) / (a - z); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= 5e+223) tmp = t_2 + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 5e+223], N[(t$95$2 + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t}{a - z}\\
t_2 := \frac{\left(y - z\right) \cdot t}{a - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+223}:\\
\;\;\;\;t\_2 + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 4.99999999999999985e223 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 46.4%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 4.99999999999999985e223Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- x (* t (+ -1.0 (/ y z))))))
(if (<= z -4400000000000.0)
t_1
(if (<= z 1.1e+27) (+ x (/ y (/ (- a z) t))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x - (t * (-1.0 + (y / z)));
double tmp;
if (z <= -4400000000000.0) {
tmp = t_1;
} else if (z <= 1.1e+27) {
tmp = x + (y / ((a - z) / t));
} 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 - (t * ((-1.0d0) + (y / z)))
if (z <= (-4400000000000.0d0)) then
tmp = t_1
else if (z <= 1.1d+27) then
tmp = x + (y / ((a - z) / t))
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 - (t * (-1.0 + (y / z)));
double tmp;
if (z <= -4400000000000.0) {
tmp = t_1;
} else if (z <= 1.1e+27) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x - (t * (-1.0 + (y / z))) tmp = 0 if z <= -4400000000000.0: tmp = t_1 elif z <= 1.1e+27: tmp = x + (y / ((a - z) / t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x - Float64(t * Float64(-1.0 + Float64(y / z)))) tmp = 0.0 if (z <= -4400000000000.0) tmp = t_1; elseif (z <= 1.1e+27) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x - (t * (-1.0 + (y / z))); tmp = 0.0; if (z <= -4400000000000.0) tmp = t_1; elseif (z <= 1.1e+27) tmp = x + (y / ((a - z) / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(t * N[(-1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4400000000000.0], t$95$1, If[LessEqual[z, 1.1e+27], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - t \cdot \left(-1 + \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -4400000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+27}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.4e12 or 1.0999999999999999e27 < z Initial program 70.9%
Taylor expanded in a around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
div-subN/A
sub-negN/A
*-inversesN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f6491.4%
Simplified91.4%
if -4.4e12 < z < 1.0999999999999999e27Initial program 96.2%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6496.4%
Applied egg-rr96.4%
Taylor expanded in y around inf
Simplified88.1%
Final simplification89.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.6e+18) (+ t x) (if (<= z 7.5e+75) (+ x (/ y (/ (- a z) t))) (+ t x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.6e+18) {
tmp = t + x;
} else if (z <= 7.5e+75) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = t + 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 <= (-5.6d+18)) then
tmp = t + x
else if (z <= 7.5d+75) then
tmp = x + (y / ((a - z) / t))
else
tmp = t + 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 <= -5.6e+18) {
tmp = t + x;
} else if (z <= 7.5e+75) {
tmp = x + (y / ((a - z) / t));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.6e+18: tmp = t + x elif z <= 7.5e+75: tmp = x + (y / ((a - z) / t)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.6e+18) tmp = Float64(t + x); elseif (z <= 7.5e+75) tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.6e+18) tmp = t + x; elseif (z <= 7.5e+75) tmp = x + (y / ((a - z) / t)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.6e+18], N[(t + x), $MachinePrecision], If[LessEqual[z, 7.5e+75], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+18}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+75}:\\
\;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -5.6e18 or 7.4999999999999995e75 < z Initial program 66.9%
Taylor expanded in z around inf
Simplified85.3%
if -5.6e18 < z < 7.4999999999999995e75Initial program 96.0%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6496.6%
Applied egg-rr96.6%
Taylor expanded in y around inf
Simplified87.4%
Final simplification86.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.75e-15) (+ t x) (if (<= z 4.1e+21) (+ x (/ (* (- y z) t) a)) (+ t x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e-15) {
tmp = t + x;
} else if (z <= 4.1e+21) {
tmp = x + (((y - z) * t) / a);
} else {
tmp = t + 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.75d-15)) then
tmp = t + x
else if (z <= 4.1d+21) then
tmp = x + (((y - z) * t) / a)
else
tmp = t + 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.75e-15) {
tmp = t + x;
} else if (z <= 4.1e+21) {
tmp = x + (((y - z) * t) / a);
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.75e-15: tmp = t + x elif z <= 4.1e+21: tmp = x + (((y - z) * t) / a) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.75e-15) tmp = Float64(t + x); elseif (z <= 4.1e+21) tmp = Float64(x + Float64(Float64(Float64(y - z) * t) / a)); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.75e-15) tmp = t + x; elseif (z <= 4.1e+21) tmp = x + (((y - z) * t) / a); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.75e-15], N[(t + x), $MachinePrecision], If[LessEqual[z, 4.1e+21], N[(x + N[(N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-15}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+21}:\\
\;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -1.75e-15 or 4.1e21 < z Initial program 72.6%
Taylor expanded in z around inf
Simplified82.6%
if -1.75e-15 < z < 4.1e21Initial program 96.1%
Taylor expanded in a around inf
Simplified80.9%
Final simplification81.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.65e-16) (+ t x) (if (<= z 2.25e+22) (+ x (/ y (/ a t))) (+ t x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.65e-16) {
tmp = t + x;
} else if (z <= 2.25e+22) {
tmp = x + (y / (a / t));
} else {
tmp = t + 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.65d-16)) then
tmp = t + x
else if (z <= 2.25d+22) then
tmp = x + (y / (a / t))
else
tmp = t + 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.65e-16) {
tmp = t + x;
} else if (z <= 2.25e+22) {
tmp = x + (y / (a / t));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.65e-16: tmp = t + x elif z <= 2.25e+22: tmp = x + (y / (a / t)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.65e-16) tmp = Float64(t + x); elseif (z <= 2.25e+22) tmp = Float64(x + Float64(y / Float64(a / t))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.65e-16) tmp = t + x; elseif (z <= 2.25e+22) tmp = x + (y / (a / t)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.65e-16], N[(t + x), $MachinePrecision], If[LessEqual[z, 2.25e+22], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{-16}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{+22}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -1.64999999999999994e-16 or 2.2499999999999999e22 < z Initial program 72.6%
Taylor expanded in z around inf
Simplified82.6%
if -1.64999999999999994e-16 < z < 2.2499999999999999e22Initial program 96.1%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6496.2%
Applied egg-rr96.2%
Taylor expanded in a around inf
/-lowering-/.f6483.4%
Simplified83.4%
Taylor expanded in y around inf
Simplified78.3%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.5e-15) (+ t x) (if (<= z 4.4e+18) (+ x (* y (/ t a))) (+ t x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e-15) {
tmp = t + x;
} else if (z <= 4.4e+18) {
tmp = x + (y * (t / a));
} else {
tmp = t + 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 <= (-5.5d-15)) then
tmp = t + x
else if (z <= 4.4d+18) then
tmp = x + (y * (t / a))
else
tmp = t + 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 <= -5.5e-15) {
tmp = t + x;
} else if (z <= 4.4e+18) {
tmp = x + (y * (t / a));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e-15: tmp = t + x elif z <= 4.4e+18: tmp = x + (y * (t / a)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e-15) tmp = Float64(t + x); elseif (z <= 4.4e+18) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.5e-15) tmp = t + x; elseif (z <= 4.4e+18) tmp = x + (y * (t / a)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e-15], N[(t + x), $MachinePrecision], If[LessEqual[z, 4.4e+18], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-15}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+18}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -5.5000000000000002e-15 or 4.4e18 < z Initial program 72.6%
Taylor expanded in z around inf
Simplified82.6%
if -5.5000000000000002e-15 < z < 4.4e18Initial program 96.1%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6476.5%
Simplified76.5%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6478.3%
Applied egg-rr78.3%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.25e-80) (+ t x) (if (<= x 1.12e-163) (* t (/ y (- a z))) (+ t x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.25e-80) {
tmp = t + x;
} else if (x <= 1.12e-163) {
tmp = t * (y / (a - z));
} else {
tmp = t + 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-80)) then
tmp = t + x
else if (x <= 1.12d-163) then
tmp = t * (y / (a - z))
else
tmp = t + 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-80) {
tmp = t + x;
} else if (x <= 1.12e-163) {
tmp = t * (y / (a - z));
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.25e-80: tmp = t + x elif x <= 1.12e-163: tmp = t * (y / (a - z)) else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.25e-80) tmp = Float64(t + x); elseif (x <= 1.12e-163) tmp = Float64(t * Float64(y / Float64(a - z))); else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.25e-80) tmp = t + x; elseif (x <= 1.12e-163) tmp = t * (y / (a - z)); else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.25e-80], N[(t + x), $MachinePrecision], If[LessEqual[x, 1.12e-163], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-80}:\\
\;\;\;\;t + x\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{-163}:\\
\;\;\;\;t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if x < -1.25e-80 or 1.12e-163 < x Initial program 85.7%
Taylor expanded in z around inf
Simplified76.6%
if -1.25e-80 < x < 1.12e-163Initial program 87.9%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
--lowering--.f6491.3%
Applied egg-rr91.3%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6454.7%
Simplified54.7%
Final simplification69.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -1500000000000.0) (+ t x) (if (<= z 4.8e-234) x (+ t x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1500000000000.0) {
tmp = t + x;
} else if (z <= 4.8e-234) {
tmp = x;
} else {
tmp = t + 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 <= (-1500000000000.0d0)) then
tmp = t + x
else if (z <= 4.8d-234) then
tmp = x
else
tmp = t + 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 <= -1500000000000.0) {
tmp = t + x;
} else if (z <= 4.8e-234) {
tmp = x;
} else {
tmp = t + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1500000000000.0: tmp = t + x elif z <= 4.8e-234: tmp = x else: tmp = t + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1500000000000.0) tmp = Float64(t + x); elseif (z <= 4.8e-234) tmp = x; else tmp = Float64(t + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1500000000000.0) tmp = t + x; elseif (z <= 4.8e-234) tmp = x; else tmp = t + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1500000000000.0], N[(t + x), $MachinePrecision], If[LessEqual[z, 4.8e-234], x, N[(t + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1500000000000:\\
\;\;\;\;t + x\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-234}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t + x\\
\end{array}
\end{array}
if z < -1.5e12 or 4.7999999999999998e-234 < z Initial program 79.9%
Taylor expanded in z around inf
Simplified74.1%
if -1.5e12 < z < 4.7999999999999998e-234Initial program 96.1%
Taylor expanded in x around inf
Simplified53.4%
Final simplification65.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.3e+91) t (if (<= t 7.2e+130) x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.3e+91) {
tmp = t;
} else if (t <= 7.2e+130) {
tmp = x;
} else {
tmp = 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 (t <= (-6.3d+91)) then
tmp = t
else if (t <= 7.2d+130) then
tmp = x
else
tmp = t
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.3e+91) {
tmp = t;
} else if (t <= 7.2e+130) {
tmp = x;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.3e+91: tmp = t elif t <= 7.2e+130: tmp = x else: tmp = t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.3e+91) tmp = t; elseif (t <= 7.2e+130) tmp = x; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6.3e+91) tmp = t; elseif (t <= 7.2e+130) tmp = x; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.3e+91], t, If[LessEqual[t, 7.2e+130], x, t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.3 \cdot 10^{+91}:\\
\;\;\;\;t\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+130}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if t < -6.3e91 or 7.2000000000000002e130 < t Initial program 66.7%
Taylor expanded in z around inf
Simplified45.0%
Taylor expanded in x around 0
Simplified38.3%
if -6.3e91 < t < 7.2000000000000002e130Initial program 96.0%
Taylor expanded in x around inf
Simplified69.6%
(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(y - z) * Float64(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[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \frac{t}{a - z}
\end{array}
Initial program 86.4%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6495.8%
Applied egg-rr95.8%
Final simplification95.8%
(FPCore (x y z t a) :precision binary64 (if (<= y 4.8e+227) (+ t x) (/ (* y t) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 4.8e+227) {
tmp = t + x;
} 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 <= 4.8d+227) then
tmp = t + x
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 <= 4.8e+227) {
tmp = t + x;
} else {
tmp = (y * t) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 4.8e+227: tmp = t + x else: tmp = (y * t) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 4.8e+227) tmp = Float64(t + x); 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 <= 4.8e+227) tmp = t + x; else tmp = (y * t) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 4.8e+227], N[(t + x), $MachinePrecision], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.8 \cdot 10^{+227}:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\end{array}
\end{array}
if y < 4.7999999999999996e227Initial program 86.0%
Taylor expanded in z around inf
Simplified65.7%
if 4.7999999999999996e227 < y Initial program 90.7%
Taylor expanded in z around 0
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6475.4%
Simplified75.4%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f6470.5%
Simplified70.5%
Final simplification66.1%
(FPCore (x y z t a) :precision binary64 (if (<= y 5.5e+227) (+ t x) (* t (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 5.5e+227) {
tmp = t + x;
} else {
tmp = t * (y / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= 5.5d+227) then
tmp = t + x
else
tmp = t * (y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 5.5e+227) {
tmp = t + x;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 5.5e+227: tmp = t + x else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 5.5e+227) tmp = Float64(t + x); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 5.5e+227) tmp = t + x; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 5.5e+227], N[(t + x), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.5 \cdot 10^{+227}:\\
\;\;\;\;t + x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < 5.5000000000000001e227Initial program 86.0%
Taylor expanded in z around inf
Simplified65.7%
if 5.5000000000000001e227 < y Initial program 90.7%
Taylor expanded in a around inf
Simplified75.8%
Taylor expanded in x around 0
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6470.8%
Simplified70.8%
Taylor expanded in y around inf
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6470.3%
Simplified70.3%
Final simplification66.1%
(FPCore (x y z t a) :precision binary64 t)
double code(double x, double y, double z, double t, double a) {
return 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 = t
end function
public static double code(double x, double y, double z, double t, double a) {
return t;
}
def code(x, y, z, t, a): return t
function code(x, y, z, t, a) return t end
function tmp = code(x, y, z, t, a) tmp = t; end
code[x_, y_, z_, t_, a_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 86.4%
Taylor expanded in z around inf
Simplified61.6%
Taylor expanded in x around 0
Simplified18.7%
(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 2024161
(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))))