
(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 (/ (* t (- y z)) (- a z))))
(if (<= t_1 (- INFINITY))
(+ x (/ (- y z) (/ (- a z) t)))
(if (<= t_1 2e+261) (+ x t_1) (+ x (* (- y z) (/ t (- a z))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t * (y - z)) / (a - z);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + ((y - z) / ((a - z) / t));
} else if (t_1 <= 2e+261) {
tmp = x + t_1;
} else {
tmp = x + ((y - z) * (t / (a - z)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t * (y - z)) / (a - z);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + ((y - z) / ((a - z) / t));
} else if (t_1 <= 2e+261) {
tmp = x + t_1;
} else {
tmp = x + ((y - z) * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t * (y - z)) / (a - z) tmp = 0 if t_1 <= -math.inf: tmp = x + ((y - z) / ((a - z) / t)) elif t_1 <= 2e+261: tmp = x + t_1 else: tmp = x + ((y - z) * (t / (a - z))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t * Float64(y - z)) / Float64(a - z)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / t))); elseif (t_1 <= 2e+261) tmp = Float64(x + t_1); else tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t * (y - z)) / (a - z); tmp = 0.0; if (t_1 <= -Inf) tmp = x + ((y - z) / ((a - z) / t)); elseif (t_1 <= 2e+261) tmp = x + t_1; else tmp = x + ((y - z) * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+261], N[(x + t$95$1), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+261}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0Initial program 47.5%
associate-/l*99.8%
Simplified99.8%
clear-num99.7%
un-div-inv99.9%
Applied egg-rr99.9%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1.9999999999999999e261Initial program 99.4%
if 1.9999999999999999e261 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 65.4%
associate-/l*100.0%
Simplified100.0%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* t (- y z)) (- a z))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+261)))
(+ x (* (- y z) (/ t (- a z))))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t * (y - z)) / (a - z);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+261)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = x + t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (t * (y - z)) / (a - z);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+261)) {
tmp = x + ((y - z) * (t / (a - z)));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t * (y - z)) / (a - z) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 2e+261): tmp = x + ((y - z) * (t / (a - z))) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t * Float64(y - z)) / Float64(a - z)) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+261)) tmp = Float64(x + Float64(Float64(y - z) * Float64(t / Float64(a - z)))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t * (y - z)) / (a - z); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 2e+261))) tmp = x + ((y - z) * (t / (a - z))); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+261]], $MachinePrecision]], N[(x + N[(N[(y - z), $MachinePrecision] * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+261}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < -inf.0 or 1.9999999999999999e261 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) Initial program 56.7%
associate-/l*99.9%
Simplified99.9%
if -inf.0 < (/.f64 (*.f64 (-.f64 y z) t) (-.f64 a z)) < 1.9999999999999999e261Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.8e+95)
(+ x t)
(if (<= z -6.8e-17)
(- x (* y (/ t z)))
(if (<= z 7.8e-25) (+ x (* y (/ t a))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.8e+95) {
tmp = x + t;
} else if (z <= -6.8e-17) {
tmp = x - (y * (t / z));
} else if (z <= 7.8e-25) {
tmp = x + (y * (t / 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 (z <= (-1.8d+95)) then
tmp = x + t
else if (z <= (-6.8d-17)) then
tmp = x - (y * (t / z))
else if (z <= 7.8d-25) then
tmp = x + (y * (t / 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 (z <= -1.8e+95) {
tmp = x + t;
} else if (z <= -6.8e-17) {
tmp = x - (y * (t / z));
} else if (z <= 7.8e-25) {
tmp = x + (y * (t / a));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.8e+95: tmp = x + t elif z <= -6.8e-17: tmp = x - (y * (t / z)) elif z <= 7.8e-25: tmp = x + (y * (t / a)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.8e+95) tmp = Float64(x + t); elseif (z <= -6.8e-17) tmp = Float64(x - Float64(y * Float64(t / z))); elseif (z <= 7.8e-25) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.8e+95) tmp = x + t; elseif (z <= -6.8e-17) tmp = x - (y * (t / z)); elseif (z <= 7.8e-25) tmp = x + (y * (t / a)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.8e+95], N[(x + t), $MachinePrecision], If[LessEqual[z, -6.8e-17], N[(x - N[(y * N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e-25], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+95}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-17}:\\
\;\;\;\;x - y \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-25}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -1.79999999999999989e95 or 7.8e-25 < z Initial program 76.6%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in z around inf 75.0%
if -1.79999999999999989e95 < z < -6.7999999999999996e-17Initial program 99.9%
associate-/l*97.9%
Simplified97.9%
Taylor expanded in y around inf 81.0%
Taylor expanded in a around 0 80.8%
associate-*r/80.8%
neg-mul-180.8%
Simplified80.8%
distribute-frac-neg80.8%
distribute-rgt-neg-out80.8%
add-sqr-sqrt56.4%
sqrt-unprod64.3%
sqr-neg64.3%
sqrt-unprod11.7%
add-sqr-sqrt42.2%
sub-neg42.2%
add-sqr-sqrt11.7%
sqrt-unprod64.3%
sqr-neg64.3%
sqrt-unprod56.4%
add-sqr-sqrt80.8%
Applied egg-rr80.8%
if -6.7999999999999996e-17 < z < 7.8e-25Initial program 94.3%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in y around inf 89.7%
Taylor expanded in a around inf 76.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.25e+95)
(+ x t)
(if (<= z -6.8e-22)
(- x (* t (/ y z)))
(if (<= z 3.5e-36) (+ x (* y (/ t a))) (+ x t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.25e+95) {
tmp = x + t;
} else if (z <= -6.8e-22) {
tmp = x - (t * (y / z));
} else if (z <= 3.5e-36) {
tmp = x + (y * (t / 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 (z <= (-2.25d+95)) then
tmp = x + t
else if (z <= (-6.8d-22)) then
tmp = x - (t * (y / z))
else if (z <= 3.5d-36) then
tmp = x + (y * (t / 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 (z <= -2.25e+95) {
tmp = x + t;
} else if (z <= -6.8e-22) {
tmp = x - (t * (y / z));
} else if (z <= 3.5e-36) {
tmp = x + (y * (t / a));
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.25e+95: tmp = x + t elif z <= -6.8e-22: tmp = x - (t * (y / z)) elif z <= 3.5e-36: tmp = x + (y * (t / a)) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.25e+95) tmp = Float64(x + t); elseif (z <= -6.8e-22) tmp = Float64(x - Float64(t * Float64(y / z))); elseif (z <= 3.5e-36) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.25e+95) tmp = x + t; elseif (z <= -6.8e-22) tmp = x - (t * (y / z)); elseif (z <= 3.5e-36) tmp = x + (y * (t / a)); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.25e+95], N[(x + t), $MachinePrecision], If[LessEqual[z, -6.8e-22], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e-36], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+95}:\\
\;\;\;\;x + t\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-22}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-36}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if z < -2.25000000000000008e95 or 3.5e-36 < z Initial program 76.6%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in z around inf 75.0%
if -2.25000000000000008e95 < z < -6.7999999999999997e-22Initial program 99.9%
associate-/l*97.9%
Simplified97.9%
Taylor expanded in y around inf 81.0%
Taylor expanded in a around 0 80.8%
mul-1-neg80.8%
unsub-neg80.8%
associate-/l*80.8%
Simplified80.8%
if -6.7999999999999997e-22 < z < 3.5e-36Initial program 94.3%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in y around inf 89.7%
Taylor expanded in a around inf 76.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.35e-21) (not (<= y 390000.0))) (+ x (* y (/ t (- a z)))) (- x (* t (/ z (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.35e-21) || !(y <= 390000.0)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x - (t * (z / (a - z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-1.35d-21)) .or. (.not. (y <= 390000.0d0))) then
tmp = x + (y * (t / (a - z)))
else
tmp = x - (t * (z / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.35e-21) || !(y <= 390000.0)) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x - (t * (z / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.35e-21) or not (y <= 390000.0): tmp = x + (y * (t / (a - z))) else: tmp = x - (t * (z / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.35e-21) || !(y <= 390000.0)) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x - Float64(t * Float64(z / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.35e-21) || ~((y <= 390000.0))) tmp = x + (y * (t / (a - z))); else tmp = x - (t * (z / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.35e-21], N[Not[LessEqual[y, 390000.0]], $MachinePrecision]], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(t * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{-21} \lor \neg \left(y \leq 390000\right):\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - t \cdot \frac{z}{a - z}\\
\end{array}
\end{array}
if y < -1.3500000000000001e-21 or 3.9e5 < y Initial program 85.1%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in y around inf 89.3%
if -1.3500000000000001e-21 < y < 3.9e5Initial program 89.8%
associate-*r/93.9%
*-commutative93.9%
div-inv93.7%
associate-*l*98.9%
Applied egg-rr98.9%
Taylor expanded in y around 0 84.3%
mul-1-neg84.3%
unsub-neg84.3%
associate-/l*92.6%
Simplified92.6%
Final simplification90.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ t (- a z))))
(if (or (<= y -2e-21) (not (<= y 5.2e-16)))
(+ x (* y t_1))
(- x (* z t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t / (a - z);
double tmp;
if ((y <= -2e-21) || !(y <= 5.2e-16)) {
tmp = x + (y * t_1);
} else {
tmp = x - (z * 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 = t / (a - z)
if ((y <= (-2d-21)) .or. (.not. (y <= 5.2d-16))) then
tmp = x + (y * t_1)
else
tmp = x - (z * 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 = t / (a - z);
double tmp;
if ((y <= -2e-21) || !(y <= 5.2e-16)) {
tmp = x + (y * t_1);
} else {
tmp = x - (z * t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t / (a - z) tmp = 0 if (y <= -2e-21) or not (y <= 5.2e-16): tmp = x + (y * t_1) else: tmp = x - (z * t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(t / Float64(a - z)) tmp = 0.0 if ((y <= -2e-21) || !(y <= 5.2e-16)) tmp = Float64(x + Float64(y * t_1)); else tmp = Float64(x - Float64(z * t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t / (a - z); tmp = 0.0; if ((y <= -2e-21) || ~((y <= 5.2e-16))) tmp = x + (y * t_1); else tmp = x - (z * t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[y, -2e-21], N[Not[LessEqual[y, 5.2e-16]], $MachinePrecision]], N[(x + N[(y * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{a - z}\\
\mathbf{if}\;y \leq -2 \cdot 10^{-21} \lor \neg \left(y \leq 5.2 \cdot 10^{-16}\right):\\
\;\;\;\;x + y \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot t\_1\\
\end{array}
\end{array}
if y < -1.99999999999999982e-21 or 5.1999999999999997e-16 < y Initial program 85.4%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in y around inf 88.2%
if -1.99999999999999982e-21 < y < 5.1999999999999997e-16Initial program 89.5%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in y around 0 84.7%
associate-*r/84.7%
mul-1-neg84.7%
distribute-rgt-neg-out84.7%
associate-*l/89.0%
*-commutative89.0%
distribute-lft-neg-out89.0%
distribute-rgt-neg-in89.0%
distribute-frac-neg289.0%
neg-sub089.0%
sub-neg89.0%
+-commutative89.0%
associate--r+89.0%
neg-sub089.0%
remove-double-neg89.0%
Simplified89.0%
Final simplification88.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6e+96) (not (<= z 3.95e+124))) (+ x t) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6e+96) || !(z <= 3.95e+124)) {
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 <= (-6d+96)) .or. (.not. (z <= 3.95d+124))) 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 <= -6e+96) || !(z <= 3.95e+124)) {
tmp = x + t;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6e+96) or not (z <= 3.95e+124): tmp = x + t else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6e+96) || !(z <= 3.95e+124)) 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 <= -6e+96) || ~((z <= 3.95e+124))) 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, -6e+96], N[Not[LessEqual[z, 3.95e+124]], $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 -6 \cdot 10^{+96} \lor \neg \left(z \leq 3.95 \cdot 10^{+124}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -6.0000000000000001e96 or 3.9500000000000002e124 < z Initial program 69.8%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in z around inf 85.0%
if -6.0000000000000001e96 < z < 3.9500000000000002e124Initial program 94.2%
associate-/l*97.0%
Simplified97.0%
Taylor expanded in y around inf 83.9%
Final simplification84.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2e+62) (not (<= z 8.4e-45))) (+ x t) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2e+62) || !(z <= 8.4e-45)) {
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 <= (-2d+62)) .or. (.not. (z <= 8.4d-45))) 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 <= -2e+62) || !(z <= 8.4e-45)) {
tmp = x + t;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2e+62) or not (z <= 8.4e-45): tmp = x + t else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2e+62) || !(z <= 8.4e-45)) 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 <= -2e+62) || ~((z <= 8.4e-45))) tmp = x + t; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2e+62], N[Not[LessEqual[z, 8.4e-45]], $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 \cdot 10^{+62} \lor \neg \left(z \leq 8.4 \cdot 10^{-45}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -2.00000000000000007e62 or 8.3999999999999998e-45 < z Initial program 77.8%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in z around inf 74.7%
if -2.00000000000000007e62 < z < 8.3999999999999998e-45Initial program 95.0%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in y around inf 88.8%
Taylor expanded in a around inf 73.3%
Final simplification73.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.2e+62) (not (<= z 8.2e-38))) (+ x t) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.2e+62) || !(z <= 8.2e-38)) {
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 <= (-2.2d+62)) .or. (.not. (z <= 8.2d-38))) 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 <= -2.2e+62) || !(z <= 8.2e-38)) {
tmp = x + t;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.2e+62) or not (z <= 8.2e-38): tmp = x + t else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.2e+62) || !(z <= 8.2e-38)) 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 <= -2.2e+62) || ~((z <= 8.2e-38))) tmp = x + t; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.2e+62], N[Not[LessEqual[z, 8.2e-38]], $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 -2.2 \cdot 10^{+62} \lor \neg \left(z \leq 8.2 \cdot 10^{-38}\right):\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.20000000000000015e62 or 8.1999999999999996e-38 < z Initial program 77.8%
associate-/l*95.7%
Simplified95.7%
Taylor expanded in z around inf 74.7%
if -2.20000000000000015e62 < z < 8.1999999999999996e-38Initial program 95.0%
associate-/l*96.4%
Simplified96.4%
Taylor expanded in z around 0 70.5%
associate-/l*71.8%
Simplified71.8%
Final simplification73.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -6.2e+224) (not (<= y 1.45e+221))) (* t (/ (- y) z)) (+ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -6.2e+224) || !(y <= 1.45e+221)) {
tmp = 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 ((y <= (-6.2d+224)) .or. (.not. (y <= 1.45d+221))) then
tmp = 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 ((y <= -6.2e+224) || !(y <= 1.45e+221)) {
tmp = t * (-y / z);
} else {
tmp = x + t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -6.2e+224) or not (y <= 1.45e+221): tmp = t * (-y / z) else: tmp = x + t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -6.2e+224) || !(y <= 1.45e+221)) tmp = Float64(t * Float64(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 ((y <= -6.2e+224) || ~((y <= 1.45e+221))) tmp = t * (-y / z); else tmp = x + t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -6.2e+224], N[Not[LessEqual[y, 1.45e+221]], $MachinePrecision]], N[(t * N[((-y) / z), $MachinePrecision]), $MachinePrecision], N[(x + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+224} \lor \neg \left(y \leq 1.45 \cdot 10^{+221}\right):\\
\;\;\;\;t \cdot \frac{-y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t\\
\end{array}
\end{array}
if y < -6.1999999999999999e224 or 1.4499999999999999e221 < y Initial program 82.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
Taylor expanded in a around 0 64.3%
associate-*r/64.3%
neg-mul-164.3%
Simplified64.3%
Taylor expanded in x around 0 49.0%
mul-1-neg49.0%
distribute-frac-neg249.0%
associate-/l*50.9%
Simplified50.9%
if -6.1999999999999999e224 < y < 1.4499999999999999e221Initial program 87.9%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in z around inf 59.9%
Final simplification58.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.1e+198) x (if (<= a 2.3e+146) (+ x t) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.1e+198) {
tmp = x;
} else if (a <= 2.3e+146) {
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 (a <= (-2.1d+198)) then
tmp = x
else if (a <= 2.3d+146) 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 (a <= -2.1e+198) {
tmp = x;
} else if (a <= 2.3e+146) {
tmp = x + t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.1e+198: tmp = x elif a <= 2.3e+146: tmp = x + t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.1e+198) tmp = x; elseif (a <= 2.3e+146) tmp = Float64(x + t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.1e+198) tmp = x; elseif (a <= 2.3e+146) tmp = x + t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.1e+198], x, If[LessEqual[a, 2.3e+146], N[(x + t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{+198}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{+146}:\\
\;\;\;\;x + t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.10000000000000013e198 or 2.3e146 < a Initial program 78.8%
associate-/l*95.9%
Simplified95.9%
Taylor expanded in x around inf 68.5%
if -2.10000000000000013e198 < a < 2.3e146Initial program 89.0%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in z around inf 54.5%
(FPCore (x y z t a) :precision binary64 (+ x (* t (* (/ 1.0 (- a z)) (- y z)))))
double code(double x, double y, double z, double t, double a) {
return x + (t * ((1.0 / (a - z)) * (y - 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 + (t * ((1.0d0 / (a - z)) * (y - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t * ((1.0 / (a - z)) * (y - z)));
}
def code(x, y, z, t, a): return x + (t * ((1.0 / (a - z)) * (y - z)))
function code(x, y, z, t, a) return Float64(x + Float64(t * Float64(Float64(1.0 / Float64(a - z)) * Float64(y - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + (t * ((1.0 / (a - z)) * (y - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t * N[(N[(1.0 / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + t \cdot \left(\frac{1}{a - z} \cdot \left(y - z\right)\right)
\end{array}
Initial program 87.0%
associate-*r/96.1%
*-commutative96.1%
div-inv96.0%
associate-*l*97.3%
Applied egg-rr97.3%
(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 87.0%
associate-/l*96.1%
Simplified96.1%
(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 87.0%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in x around inf 44.2%
(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 2024172
(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))))