
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
Initial program 97.6%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6498.3%
Applied egg-rr98.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- x y) (/ t (- z y)))))
(if (<= z -7.8e+69)
(* t (/ (- x y) z))
(if (<= z -5e-119) t_1 (if (<= z 8.5e-196) (* t (/ (- y x) y)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x - y) * (t / (z - y));
double tmp;
if (z <= -7.8e+69) {
tmp = t * ((x - y) / z);
} else if (z <= -5e-119) {
tmp = t_1;
} else if (z <= 8.5e-196) {
tmp = t * ((y - x) / y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x - y) * (t / (z - y))
if (z <= (-7.8d+69)) then
tmp = t * ((x - y) / z)
else if (z <= (-5d-119)) then
tmp = t_1
else if (z <= 8.5d-196) then
tmp = t * ((y - x) / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - y) * (t / (z - y));
double tmp;
if (z <= -7.8e+69) {
tmp = t * ((x - y) / z);
} else if (z <= -5e-119) {
tmp = t_1;
} else if (z <= 8.5e-196) {
tmp = t * ((y - x) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - y) * (t / (z - y)) tmp = 0 if z <= -7.8e+69: tmp = t * ((x - y) / z) elif z <= -5e-119: tmp = t_1 elif z <= 8.5e-196: tmp = t * ((y - x) / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - y) * Float64(t / Float64(z - y))) tmp = 0.0 if (z <= -7.8e+69) tmp = Float64(t * Float64(Float64(x - y) / z)); elseif (z <= -5e-119) tmp = t_1; elseif (z <= 8.5e-196) tmp = Float64(t * Float64(Float64(y - x) / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) * (t / (z - y)); tmp = 0.0; if (z <= -7.8e+69) tmp = t * ((x - y) / z); elseif (z <= -5e-119) tmp = t_1; elseif (z <= 8.5e-196) tmp = t * ((y - x) / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e+69], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5e-119], t$95$1, If[LessEqual[z, 8.5e-196], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{+69}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-119}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-196}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.7999999999999998e69Initial program 97.8%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f6486.7%
Simplified86.7%
if -7.7999999999999998e69 < z < -4.99999999999999993e-119 or 8.50000000000000004e-196 < z Initial program 96.7%
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6490.6%
Applied egg-rr90.6%
if -4.99999999999999993e-119 < z < 8.50000000000000004e-196Initial program 99.9%
Taylor expanded in z around 0
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6496.3%
Simplified96.3%
Final simplification91.1%
(FPCore (x y z t) :precision binary64 (if (<= z -1350000000.0) (* t (/ (- x y) z)) (if (<= z 1.2e-81) (* t (/ (- y x) y)) (/ t (/ z (- x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1350000000.0) {
tmp = t * ((x - y) / z);
} else if (z <= 1.2e-81) {
tmp = t * ((y - x) / y);
} else {
tmp = t / (z / (x - y));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-1350000000.0d0)) then
tmp = t * ((x - y) / z)
else if (z <= 1.2d-81) then
tmp = t * ((y - x) / y)
else
tmp = t / (z / (x - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1350000000.0) {
tmp = t * ((x - y) / z);
} else if (z <= 1.2e-81) {
tmp = t * ((y - x) / y);
} else {
tmp = t / (z / (x - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1350000000.0: tmp = t * ((x - y) / z) elif z <= 1.2e-81: tmp = t * ((y - x) / y) else: tmp = t / (z / (x - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1350000000.0) tmp = Float64(t * Float64(Float64(x - y) / z)); elseif (z <= 1.2e-81) tmp = Float64(t * Float64(Float64(y - x) / y)); else tmp = Float64(t / Float64(z / Float64(x - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1350000000.0) tmp = t * ((x - y) / z); elseif (z <= 1.2e-81) tmp = t * ((y - x) / y); else tmp = t / (z / (x - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1350000000.0], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e-81], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t / N[(z / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1350000000:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-81}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z}{x - y}}\\
\end{array}
\end{array}
if z < -1.35e9Initial program 98.3%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f6483.5%
Simplified83.5%
if -1.35e9 < z < 1.2e-81Initial program 98.1%
Taylor expanded in z around 0
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6489.6%
Simplified89.6%
if 1.2e-81 < z Initial program 96.7%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.6%
Applied egg-rr97.6%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f6466.7%
Simplified66.7%
Final simplification80.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* t (/ (- x y) z)))) (if (<= z -0.059) t_1 (if (<= z 1.2e-81) (* t (/ (- y x) y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = t * ((x - y) / z);
double tmp;
if (z <= -0.059) {
tmp = t_1;
} else if (z <= 1.2e-81) {
tmp = t * ((y - x) / y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = t * ((x - y) / z)
if (z <= (-0.059d0)) then
tmp = t_1
else if (z <= 1.2d-81) then
tmp = t * ((y - x) / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = t * ((x - y) / z);
double tmp;
if (z <= -0.059) {
tmp = t_1;
} else if (z <= 1.2e-81) {
tmp = t * ((y - x) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * ((x - y) / z) tmp = 0 if z <= -0.059: tmp = t_1 elif z <= 1.2e-81: tmp = t * ((y - x) / y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(Float64(x - y) / z)) tmp = 0.0 if (z <= -0.059) tmp = t_1; elseif (z <= 1.2e-81) tmp = Float64(t * Float64(Float64(y - x) / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * ((x - y) / z); tmp = 0.0; if (z <= -0.059) tmp = t_1; elseif (z <= 1.2e-81) tmp = t * ((y - x) / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.059], t$95$1, If[LessEqual[z, 1.2e-81], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{x - y}{z}\\
\mathbf{if}\;z \leq -0.059:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-81}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.058999999999999997 or 1.2e-81 < z Initial program 97.3%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f6473.1%
Simplified73.1%
if -0.058999999999999997 < z < 1.2e-81Initial program 98.1%
Taylor expanded in z around 0
associate-*r/N/A
/-lowering-/.f64N/A
mul-1-negN/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6489.6%
Simplified89.6%
Final simplification79.8%
(FPCore (x y z t) :precision binary64 (if (<= y -4.2e+161) t (if (<= y 7.2e+71) (* t (/ (- x y) z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e+161) {
tmp = t;
} else if (y <= 7.2e+71) {
tmp = t * ((x - y) / z);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.2d+161)) then
tmp = t
else if (y <= 7.2d+71) then
tmp = t * ((x - y) / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e+161) {
tmp = t;
} else if (y <= 7.2e+71) {
tmp = t * ((x - y) / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.2e+161: tmp = t elif y <= 7.2e+71: tmp = t * ((x - y) / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.2e+161) tmp = t; elseif (y <= 7.2e+71) tmp = Float64(t * Float64(Float64(x - y) / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.2e+161) tmp = t; elseif (y <= 7.2e+71) tmp = t * ((x - y) / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.2e+161], t, If[LessEqual[y, 7.2e+71], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+161}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+71}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -4.2e161 or 7.1999999999999999e71 < y Initial program 99.9%
Taylor expanded in y around inf
Simplified65.0%
if -4.2e161 < y < 7.1999999999999999e71Initial program 96.2%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f6467.3%
Simplified67.3%
Final simplification66.4%
(FPCore (x y z t) :precision binary64 (if (<= y -4.2e+161) t (if (<= y 5.3e+70) (* (- x y) (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e+161) {
tmp = t;
} else if (y <= 5.3e+70) {
tmp = (x - y) * (t / z);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.2d+161)) then
tmp = t
else if (y <= 5.3d+70) then
tmp = (x - y) * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e+161) {
tmp = t;
} else if (y <= 5.3e+70) {
tmp = (x - y) * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.2e+161: tmp = t elif y <= 5.3e+70: tmp = (x - y) * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.2e+161) tmp = t; elseif (y <= 5.3e+70) tmp = Float64(Float64(x - y) * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.2e+161) tmp = t; elseif (y <= 5.3e+70) tmp = (x - y) * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.2e+161], t, If[LessEqual[y, 5.3e+70], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+161}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{+70}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -4.2e161 or 5.3e70 < y Initial program 99.9%
Taylor expanded in y around inf
Simplified65.0%
if -4.2e161 < y < 5.3e70Initial program 96.2%
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6492.6%
Applied egg-rr92.6%
Taylor expanded in z around inf
/-lowering-/.f6465.5%
Simplified65.5%
Final simplification65.3%
(FPCore (x y z t) :precision binary64 (if (<= y -1.22e+42) t (if (<= y 7e-86) (/ t (/ z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.22e+42) {
tmp = t;
} else if (y <= 7e-86) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.22d+42)) then
tmp = t
else if (y <= 7d-86) then
tmp = t / (z / x)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.22e+42) {
tmp = t;
} else if (y <= 7e-86) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.22e+42: tmp = t elif y <= 7e-86: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.22e+42) tmp = t; elseif (y <= 7e-86) tmp = Float64(t / Float64(z / x)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.22e+42) tmp = t; elseif (y <= 7e-86) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.22e+42], t, If[LessEqual[y, 7e-86], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.22 \cdot 10^{+42}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-86}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.22e42 or 7.00000000000000041e-86 < y Initial program 99.9%
Taylor expanded in y around inf
Simplified54.6%
if -1.22e42 < y < 7.00000000000000041e-86Initial program 93.9%
Taylor expanded in y around 0
/-lowering-/.f6469.6%
Simplified69.6%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6470.4%
Applied egg-rr70.4%
(FPCore (x y z t) :precision binary64 (if (<= y -1.02e+42) t (if (<= y 7e-86) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.02e+42) {
tmp = t;
} else if (y <= 7e-86) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-1.02d+42)) then
tmp = t
else if (y <= 7d-86) then
tmp = t * (x / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.02e+42) {
tmp = t;
} else if (y <= 7e-86) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.02e+42: tmp = t elif y <= 7e-86: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.02e+42) tmp = t; elseif (y <= 7e-86) tmp = Float64(t * Float64(x / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.02e+42) tmp = t; elseif (y <= 7e-86) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.02e+42], t, If[LessEqual[y, 7e-86], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{+42}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-86}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.01999999999999996e42 or 7.00000000000000041e-86 < y Initial program 99.9%
Taylor expanded in y around inf
Simplified54.6%
if -1.01999999999999996e42 < y < 7.00000000000000041e-86Initial program 93.9%
Taylor expanded in y around 0
/-lowering-/.f6469.6%
Simplified69.6%
Final simplification60.1%
(FPCore (x y z t) :precision binary64 (if (<= y -6.6e+41) t (if (<= y 7e-86) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.6e+41) {
tmp = t;
} else if (y <= 7e-86) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-6.6d+41)) then
tmp = t
else if (y <= 7d-86) then
tmp = x * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.6e+41) {
tmp = t;
} else if (y <= 7e-86) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.6e+41: tmp = t elif y <= 7e-86: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.6e+41) tmp = t; elseif (y <= 7e-86) tmp = Float64(x * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.6e+41) tmp = t; elseif (y <= 7e-86) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.6e+41], t, If[LessEqual[y, 7e-86], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{+41}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-86}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -6.6000000000000001e41 or 7.00000000000000041e-86 < y Initial program 99.9%
Taylor expanded in y around inf
Simplified54.6%
if -6.6000000000000001e41 < y < 7.00000000000000041e-86Initial program 93.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6465.7%
Simplified65.7%
(FPCore (x y z t) :precision binary64 (* t (/ (- x y) (- z y))))
double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t * ((x - y) / (z - y))
end function
public static double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
def code(x, y, z, t): return t * ((x - y) / (z - y))
function code(x, y, z, t) return Float64(t * Float64(Float64(x - y) / Float64(z - y))) end
function tmp = code(x, y, z, t) tmp = t * ((x - y) / (z - y)); end
code[x_, y_, z_, t_] := N[(t * N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \frac{x - y}{z - y}
\end{array}
Initial program 97.6%
Final simplification97.6%
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
return t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 97.6%
Taylor expanded in y around inf
Simplified36.8%
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
herbie shell --seed 2024161
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:alt
(! :herbie-platform default (/ t (/ (- z y) (- x y))))
(* (/ (- x y) (- z y)) t))